[NTG-context] styling individual parts of ToC entry

jbf roma83537 at gmail.com
Wed Sep 9 11:39:11 CEST 2020


Thanks. Just two clarifications (also noting that I altered 'forword' in 
yours to 'foreword' in mine in every instance, just to get the spelling 
right):

1. Compiling your example just as it is below produces a result like:

[foreword: – – 2]Chapter 1 Chapter 1
                                            A. u. thor                  3

We obviously should not be getting [foreword: --2] in our result, nor a 
doubling up of Chapter 1

2. Where do I stand now with the earlier definition  (I mean the 
\define[3]\ChapterListCommand. Is that still used? Including its 
\setuplist part? What you have just given me now makes no reference to 
\ChapterListCommand, so perhaps it is no longer relevant?

Julian





On 9/9/20 5:10 pm, Wolfgang Schuster wrote:
> jbf schrieb am 09.09.2020 um 08:04:
>> Have to confess I am still not getting far with the final problem in 
>> a book that is now fully laid out: frontmatter through to appendices 
>> is all correct and working, but the Table of Contents not the way I 
>> need it (as explained earlier and listed in a previous email).
>>
>> My latest effort focuses on just one item, the Foreword, since if I 
>> get that right, I can apply the same logic to sections. Chapters are 
>> already working correctly, thanks to Wolfgang's ChapterListCommand 
>> and I am assuming I need that for the several frontmatter 'chapters'.
>>
>> I was earlier using \title for foreword, preface and notes to 
>> contributors, but have abandoned that as complicating things, and am 
>> now using \chapter, since it does not produce a numbered item - 
>> however, it is producing the label 'Chapter' which I don't want for 
>> these item. You can see below how I tried to avoid that, but it 
>> failed. My MWE addition to what Wolfgang provided is:
>>
>> \definehead [foreword] [chapter]
>>
>> \setuphead [foreword]
>>
>> \setuplist [foreword]
>>   [label=foreword,
>>   alternative=command,
>>   command=\ChapterListCommand]% definition not included here. It was 
>> given in an earlier response from Wolfgang.
>>
>> .... And in the frontmatter itself:
>>
>> \startchapter[foreword][title={\ss Foreword}][author={A. Uthor}]
>>
>> ..........
>
> You can set the forword string as labeltext and ignore the title (but 
> use a empty argument when set userdata like the author).
>
> \definehead
>   [forword] [chapter]
>
> \setuplabeltext
>   [en]
>   [forword=Forword,
>    chapter=Chapter ]
>
> \setuphead
>   [forword]
>   [frontpartlabel=forword,
>    conversion=empty]
>
> \setupsectionblock
>   [frontpart]
>   [number=yes]
>
> \setuplist
>   [forword]
>   [label=forword,
>    width=2cm]
>
> \setuplist
>   [chapter]
>   [label=chapter,
>    width=2cm]
>
> \starttext
>
> \startfrontmatter
>
> \placelist [chapter,forword]
>
> \startforword [] [author={A. u. thor}] \stopforword
>
> \stopfrontmatter
>
> \startbodymatter
>
> \startchapter [title=Chapter 1] [author={A. u. thor}] \stopchapter
>
> \stopbodymatter
>
> \stoptext
>
> Wolfgang


More information about the ntg-context mailing list