ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] What could possibly be wrong with 'P'?
@ 2024-09-10  0:36 jbf
  2024-09-10  3:25 ` [NTG-context] " Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: jbf @ 2024-09-10  0:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3158 bytes --]

Here is a really odd one that I have a simple workaround for, but for 
the life of me I cannot work out why this is happening. Is 'p' (or 'P') 
some sort of restricted letter in certain circumstances?

Here is the issue:

\startdocument

[metadata:author={Author name},

metadata:title={Psalms}]

And I get an error. Document will not compile. Any other initial letter 
than 'p' (in Psalms) does not produce the error.


So if I do something like:

\startdocument

[metadata:author={Janet Dawson},

metadata:title={~Psalms}]

Then I no longer get the problem. Which just seems to confirm the fact 
that it is the initial letter 'p' that is the problem. I can also change 
the spelling of 'psalms' (anything really, asalms, xsalms) and there is 
no problem, but of course that would be silly.

I have never had this issue before, so while it looks like 'p' is the 
problem (it can hardly be the Psalms!), it is possibly something else, 
but what, I would not know. If it helps, I am calling in that 
metadata:title in the header in the usual way, e.g.:

\setupheadertexts

[ ] [{\getmarking[chapter]\hskip1em \pagenumber}]

[] [ {\pagenumber \hskip1em \documentvariable{metadata:title}}]

But that should not be a problem.

Below is the error log, but it refers to line 346, which happens to be 
\stopfrontmatter so does not seem relevant. However, it is my previous 
experience that sometimes this is telling me that the error is somewhere 
in the frontmatter, not necessarily on that final line.

return { ["errortype"]=0, ["filename"]="./test.tex", 
["lastcontext"]="\n<macro> \n Ps\n alms\n<argument> \n {\\pagenumber 
\\hskip 1em \\documentvariable {metadata:title}\n }\n<macro> 
\\secondoftwoarguments \n #-#1->#1\n<macro> 
\\page_layouts_process_element_single \n ...content {\\detokenize 
{#1}}\\ifcsname \\??layouttextspecial \\m_page_layouts_element_content 
\\endcsname \\lastnamedcs \\else \\doifelsemarking 
\\m_page_layouts_element_content {\\getmarking 
[\\m_page_layouts_element_content ][\\v!first ]}{#1}\n \\fi \n<macro> 
\\page_layouts_process_element_indeed \n ...andcolor #1#2\\begincsname 
\\??layouttextstrut \\layoutelementparameter \\c!strut \\endcsname 
\\ignorecrlf \\edef \\p_width {\\layoutelementparameter #3}\\ifempty 
\\p_width \\else \\expandafter \\page_layouts_process_element_limited 
\\fi \\p_text \n \\endgroup \n<macro> \\currentlayoutelement \n ...h 
\\bgroup \\page_layouts_place_extra_text_left \\hss \\egroup \\kern 
-\\makeupwidth \\fi \\else \\hbox to \\makeupwidth \\bgroup 
\\page_layouts_place_extra_text_left 
\\page_layouts_process_element_indeed \\c!leftstyle \\c!leftcolor 
\\c!leftwidth \n \\hss \\egroup ...\n ...\n\n<line 3.346> \n 
\\stopfrontmatter\n\n", ["lastluaerror"]="", ["lasttexerror"]="Valid 
keyword expected, likely 'plus'", ["lasttexhelp"]="You started a keyword 
but it seems to be an invalid one. The first character(s)\nmight give 
you a clue. You might want to quit unwanted lookahead with \\relax.", 
["linenumber"]=346, ["offset"]=10, ["skiplinenumber"]=346,

Version no. is 20220825 LMTX but that should not be a problem either. I 
have used it consistently for other titles.

Julian

[-- Attachment #1.2: Type: text/html, Size: 7889 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [NTG-context] Re: What could possibly be wrong with 'P'?
  2024-09-10  0:36 [NTG-context] What could possibly be wrong with 'P'? jbf
@ 2024-09-10  3:25 ` Wolfgang Schuster
  2024-09-10  3:52   ` jbf
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2024-09-10  3:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users, jbf


[-- Attachment #1.1: Type: text/plain, Size: 1961 bytes --]

jbf schrieb am 10.09.2024 um 02:36:
>
> Here is a really odd one that I have a simple workaround for, but for 
> the life of me I cannot work out why this is happening. Is 'p' (or 
> 'P') some sort of restricted letter in certain circumstances?
>
> Here is the issue:
>
> \startdocument
>
> [metadata:author={Author name},
>
> metadata:title={Psalms}]
>

1. This is *not* a complete minimal working example.

2. The following example works (with and without \setupinteraction) here 
with the latest version.

\setupinteraction[state=start]

\startdocument
   [metadata:author={Author name},
    metadata:title={Psalms}]

Psalms.

\stopdocument

> And I get an error. Document will not compile. Any other initial 
> letter than 'p' (in Psalms) does not produce the error.
>
> So if I do something like:
>
> \startdocument
>
> [metadata:author={Janet Dawson},
>
> metadata:title={~Psalms}]
>
> Then I no longer get the problem. Which just seems to confirm the fact 
> that it is the initial letter 'p' that is the problem. I can also 
> change the spelling of 'psalms' (anything really, asalms, xsalms) and 
> there is no problem, but of course that would be silly.
>
> I have never had this issue before, so while it looks like 'p' is the 
> problem (it can hardly be the Psalms!), it is possibly something else, 
> but what, I would not know. If it helps, I am calling in that 
> metadata:title in the header in the usual way, e.g.:
>
> \setupheadertexts
>
> [ ] [{\getmarking[chapter]\hskip1em \pagenumber}]
>
> [] [ {\pagenumber \hskip1em \documentvariable{metadata:title}}]
>
> But that should not be a problem.
>

The \hskip is a problem because the commands is looking for additional 
parameters and when it encounters the "p" at the beginning of 
metadata:title it assumes you set the plus parameter.

To prevent the error either add a \relax after the dimension (i.e. 
\hskip1em\relax) or use \quad which inserts a horizontal space of 1em.

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 5293 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [NTG-context] Re: What could possibly be wrong with 'P'?
  2024-09-10  3:25 ` [NTG-context] " Wolfgang Schuster
@ 2024-09-10  3:52   ` jbf
  0 siblings, 0 replies; 3+ messages in thread
From: jbf @ 2024-09-10  3:52 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2488 bytes --]

Thanks for this. I can understand now where the problem lies, and sorry 
about the minimal example, but I had hoped that the three items I gave 
(the metadata info, the \setupheadertexts and the error message) was in 
fact a minimal example. I should have placed the \setupheadertexts 
immediately after the \startdocument, I guess.

But just the same, grateful for your patience and clarity.

Julian

On 10/9/24 13:25, Wolfgang Schuster wrote:
> jbf schrieb am 10.09.2024 um 02:36:
>>
>> Here is a really odd one that I have a simple workaround for, but for 
>> the life of me I cannot work out why this is happening. Is 'p' (or 
>> 'P') some sort of restricted letter in certain circumstances?
>>
>> Here is the issue:
>>
>> \startdocument
>>
>> [metadata:author={Author name},
>>
>> metadata:title={Psalms}]
>>
>
> 1. This is *not* a complete minimal working example.
>
> 2. The following example works (with and without \setupinteraction) 
> here with the latest version.
>
> \setupinteraction[state=start]
>
> \startdocument
>   [metadata:author={Author name},
>    metadata:title={Psalms}]
>
> Psalms.
>
> \stopdocument
>
>> And I get an error. Document will not compile. Any other initial 
>> letter than 'p' (in Psalms) does not produce the error.
>>
>> So if I do something like:
>>
>> \startdocument
>>
>> [metadata:author={Janet Dawson},
>>
>> metadata:title={~Psalms}]
>>
>> Then I no longer get the problem. Which just seems to confirm the 
>> fact that it is the initial letter 'p' that is the problem. I can 
>> also change the spelling of 'psalms' (anything really, asalms, 
>> xsalms) and there is no problem, but of course that would be silly.
>>
>> I have never had this issue before, so while it looks like 'p' is the 
>> problem (it can hardly be the Psalms!), it is possibly something 
>> else, but what, I would not know. If it helps, I am calling in that 
>> metadata:title in the header in the usual way, e.g.:
>>
>> \setupheadertexts
>>
>> [ ] [{\getmarking[chapter]\hskip1em \pagenumber}]
>>
>> [] [ {\pagenumber \hskip1em \documentvariable{metadata:title}}]
>>
>> But that should not be a problem.
>>
>
> The \hskip is a problem because the commands is looking for additional 
> parameters and when it encounters the "p" at the beginning of 
> metadata:title it assumes you set the plus parameter.
>
> To prevent the error either add a \relax after the dimension (i.e. 
> \hskip1em\relax) or use \quad which inserts a horizontal space of 1em.
>
> Wolfgang
>

[-- Attachment #1.2: Type: text/html, Size: 6212 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-10  3:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-10  0:36 [NTG-context] What could possibly be wrong with 'P'? jbf
2024-09-10  3:25 ` [NTG-context] " Wolfgang Schuster
2024-09-10  3:52   ` jbf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).