ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Part label and chapter numbers
@ 2021-01-04  2:22 jbf
  2021-01-04  9:27 ` Marco Patzer
  0 siblings, 1 reply; 4+ messages in thread
From: jbf @ 2021-01-04  2:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

This is a Mark IV issue rather than LMTX, and while it is almost 
certainly simple enough, I seem to have got myself confused and am not 
getting the results I need. essentially I am dealing with a book that is 
divided into parts and chapter, but the parts need to be called 
'Section' not 'Part', and the Chapter numbers need to be words and 
sequential throughout the book, not restarting at each part/section.

Issue 1:

Parts need to be called 'Section' (Section 1, section 2 etc.). I thought 
I could achieve this with:

\setuphead
   [part]
   [
   placehead=yes,
   bodypartlabel=section,

]

but then I just get the number 1, 2, not Section 1, Section 2

Of  course, if I write bodypartlabel=part, then I do get Part 1, Part 2, 
etc. How do I achieve 'Section' rather than 'Part'?

Issue 2:

While the above 'sections' are numbered in arabic numbers, Chapters are 
meant to be in words. I thought I could do it with

\setuphead
   [chapter]
   [deepnumbercommand=\convertnumber{words}]

but this throws an error. How do I achieve this? I want Chapter One, not 
Chapter 1.1

Issue 3 might already be solved once I resolve Issue 2!

But given that I have parts, the chapters at the moment come out as 
Chapter 1.1... Chapter 2.1 etc. and I simply want Chapter One, Chapter 
Two and so on, sequentially throughout the book. I thought I might be 
able to do it with something like

\setuphead[section-2][bodypartconversion=Characters]

|But that doesn't work. Any thoughts? Julian |


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

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

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Part label and chapter numbers
  2021-01-04  2:22 Part label and chapter numbers jbf
@ 2021-01-04  9:27 ` Marco Patzer
       [not found]   ` <138bedb9-f559-cf6b-db34-e012f8c19ddb@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Marco Patzer @ 2021-01-04  9:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 4 Jan 2021 13:22:55 +1100
jbf <roma83537@gmail.com> wrote:

> Issue 1:
> 
> Parts need to be called 'Section' (Section 1, section 2 etc.).

\setuphead
  [part]
  [placehead=yes,
   bodypartlabel=part]

\setuplabeltext
  [part=Section\nobreakspace]

> Issue 2:
> 
> While the above 'sections' are numbered in arabic numbers, Chapters
> are meant to be in words.

\setuplabeltext
  [chapter=Chapter\nobreakspace]

\setuphead
  [chapter]
  [conversion=Words]

> Issue 3 might already be solved once I resolve Issue 2!
> 
> But given that I have parts, the chapters at the moment come out as 
> Chapter 1.1... Chapter 2.1 etc. and I simply want Chapter One,
> Chapter Two and so on

\setuphead
  [chapter]
  [sectionsegments=chapter]

\setuphead
  [section]
  [sectionsegments=chapter:section]

> Any thoughts?

An MWE would have been nice to have.

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
___________________________________________________________________________________

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

* Re: Part label and chapter numbers
       [not found]   ` <138bedb9-f559-cf6b-db34-e012f8c19ddb@gmail.com>
@ 2021-01-04 22:09     ` Marco Patzer
  2021-01-04 22:27       ` jbf
  0 siblings, 1 reply; 4+ messages in thread
From: Marco Patzer @ 2021-01-04 22:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, 5 Jan 2021 08:32:33 +1100
jbf <roma83537@gmail.com> 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
___________________________________________________________________________________

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

* Re: Part label and chapter numbers
  2021-01-04 22:09     ` Marco Patzer
@ 2021-01-04 22:27       ` jbf
  0 siblings, 0 replies; 4+ messages in thread
From: jbf @ 2021-01-04 22:27 UTC (permalink / raw)
  To: Marco Patzer; +Cc: mailing list for ConTeXt users

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 <roma83537@gmail.com> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2021-01-04 22:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04  2:22 Part label and chapter numbers jbf
2021-01-04  9:27 ` Marco Patzer
     [not found]   ` <138bedb9-f559-cf6b-db34-e012f8c19ddb@gmail.com>
2021-01-04 22:09     ` Marco Patzer
2021-01-04 22:27       ` 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).