Re: [NTG-context] Part label and chapter numbers
On Tue, 5 Jan 2021 08:32:33 +1100
jbf
and apologies if you didn't think I provided an MWE.
The idea is that people can just copy-paste the code into an editor and keep tweaking. It doesn't have to produce the correct output, but it should compile. If you add an MWE you're more likely to get a response.
Of the three issues below, only the first is not resolved, meaning that part=Section\nobreakspace does not make any difference, or put another way, at least it stops things from throwing an error, but the result I get is not 'Section 1. My title' but simply '1. My title'.
Here's what an MWE with the code I posted looks like: \setuphead [part] [placehead=yes, bodypartlabel=part] \setuplabeltext [part=Section\nobreakspace] \setuplabeltext [chapter=Chapter\nobreakspace] \setuphead [chapter] [conversion=Words] \setuphead [chapter] [sectionsegments=chapter] \setuphead [section] [sectionsegments=chapter:section] \starttext \startpart [title=Mypart] \startchapter [title=Some Chapter] \startsection [title=Some Section] \samplefile{knuth} \stopsection \stopchapter \stoppart \stoptext And the string “Section 1 Mypart” shows up there.
Below is exactly what I have in my preamble. Note that I have also included \setuphead [section] which is the true 'section' level below 'chapter'. Is it possible that this causes some confusion? Unfortunately, the author still wants 'Part' to be actually named as 'Section'!
\setuphead [part] [ placehead=yes, page=no, bodypartlabel=part ]
First, there a bunch of (U+00A0) NO-BREAK SPACEs in your code. I don't know if that's added by your mail client or if that's actually in your code. If it's also in the code: Context doesn't like it. The NO-BREAK SPACEs have to go. Second, you have a space (new line) after “bodypartlabel=part”. Add a comma, percent sign or move the closing bracket after the word “part”. Marco
Indeed the no-break spaces were the problem, something I had quite overlooked (so have made a 'message to brain' not to overlook this in the future). I did know about the use of %, but if one searches on the Contextgarden Wiki for \nobreakspace, one finds nothing. Clearly a TeX command that one just has to know! Once again thank you for gently moving me in the right direction! Julian On 5/1/21 9:09 am, Marco Patzer wrote:
On Tue, 5 Jan 2021 08:32:33 +1100 jbf
wrote: and apologies if you didn't think I provided an MWE. The idea is that people can just copy-paste the code into an editor and keep tweaking. It doesn't have to produce the correct output, but it should compile. If you add an MWE you're more likely to get a response.
Of the three issues below, only the first is not resolved, meaning that part=Section\nobreakspace does not make any difference, or put another way, at least it stops things from throwing an error, but the result I get is not 'Section 1. My title' but simply '1. My title'. Here's what an MWE with the code I posted looks like:
\setuphead [part] [placehead=yes, bodypartlabel=part]
\setuplabeltext [part=Section\nobreakspace]
\setuplabeltext [chapter=Chapter\nobreakspace]
\setuphead [chapter] [conversion=Words]
\setuphead [chapter] [sectionsegments=chapter]
\setuphead [section] [sectionsegments=chapter:section]
\starttext \startpart [title=Mypart] \startchapter [title=Some Chapter] \startsection [title=Some Section] \samplefile{knuth} \stopsection \stopchapter \stoppart \stoptext
And the string “Section 1 Mypart” shows up there.
Below is exactly what I have in my preamble. Note that I have also included \setuphead [section] which is the true 'section' level below 'chapter'. Is it possible that this causes some confusion? Unfortunately, the author still wants 'Part' to be actually named as 'Section'!
\setuphead [part] [ placehead=yes, page=no, bodypartlabel=part ] First, there a bunch of (U+00A0) NO-BREAK SPACEs in your code. I don't know if that's added by your mail client or if that's actually in your code. If it's also in the code: Context doesn't like it. The NO-BREAK SPACEs have to go.
Second, you have a space (new line) after “bodypartlabel=part”. Add a comma, percent sign or move the closing bracket after the word “part”.
Marco ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (2)
-
jbf
-
Marco Patzer