ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Centered list of authors in ToC
@ 2021-02-09  9:49 jbf
  2021-02-09 10:02 ` mf
  0 siblings, 1 reply; 6+ messages in thread
From: jbf @ 2021-02-09  9:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I wonder if someone can assist me with the final step in a complicated 
Table of Contents where all items in the ToC are centred (except page 
numbers which continue to be on the right).

Beneath each chapter title is a list of authors (Yes, there can be up to 
four authors per chapter!)

I can successfully achieve everything (see MWE below) except for getting 
the list of authors to split and be centred. Because there are four of 
them, I would need to split them so they appear as two (centred) with 
the other two below(also centred).

Here is my MWE for the essential bit (which is then called in as 
textcommand=\SectionTocEntry in \setuplist[chapter], obviously):

\define[1]\SectionTocEntry{%
#1\crlf% title
\midaligned{\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}}%
}

My problem is that at the moment, the four authors appear on a single 
line, so I end up with:

            My chapter title
Mickey Mouse, Donald Duck, Uncle Scrooge, Minnie Mouse  [p. 1, but in 
fact, Minnie Mouse runs across the page number!]

What I want instead is:

           My chapter title
     Mickey Mouse, Donald Duck
    Uncle Scrooge, Minnie Mouse        [p. number]

Back at the chapter level my code reads:

\startchapter[title={Chapter title}][author={Mickey Mouse, Donald Duck, 
Uncle Scrooge, Minnie Mouse}].

Anyone able to help with this?

Julian







___________________________________________________________________________________
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] 6+ messages in thread

* Re: Centered list of authors in ToC
  2021-02-09  9:49 Centered list of authors in ToC jbf
@ 2021-02-09 10:02 ` mf
  2021-02-09 20:18   ` jbf
  2021-02-09 20:50   ` jbf
  0 siblings, 2 replies; 6+ messages in thread
From: mf @ 2021-02-09 10:02 UTC (permalink / raw)
  To: ntg-context

Il 09/02/21 10:49, jbf ha scritto:
> I wonder if someone can assist me with the final step in a complicated 
> Table of Contents where all items in the ToC are centred (except page 
> numbers which continue to be on the right).
> 
> Beneath each chapter title is a list of authors (Yes, there can be up to 
> four authors per chapter!)
> 
> I can successfully achieve everything (see MWE below) except for getting 
> the list of authors to split and be centred. Because there are four of 
> them, I would need to split them so they appear as two (centred) with 
> the other two below(also centred).
> 
> Here is my MWE for the essential bit (which is then called in as 
> textcommand=\SectionTocEntry in \setuplist[chapter], obviously):
> 
> \define[1]\SectionTocEntry{%
> #1\crlf% title
> \midaligned{\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}}% 
> 
> }

try \startalignment[middle] ... \stopalignment instead of \midaligned

> 
> My problem is that at the moment, the four authors appear on a single 
> line, so I end up with:
> 
>             My chapter title
> Mickey Mouse, Donald Duck, Uncle Scrooge, Minnie Mouse  [p. 1, but in 
> fact, Minnie Mouse runs across the page number!]
> 
> What I want instead is:
> 
>            My chapter title
>      Mickey Mouse, Donald Duck
>     Uncle Scrooge, Minnie Mouse        [p. number]
> 
> Back at the chapter level my code reads:
> 
> \startchapter[title={Chapter title}][author={Mickey Mouse, Donald Duck, 
> Uncle Scrooge, Minnie Mouse}].

\startchapter[title={Chapter title}][author={Mickey Mouse, Donald 
Duck,\crlf Uncle Scrooge, Minnie Mouse}].

Massi
___________________________________________________________________________________
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] 6+ messages in thread

* Re: Centered list of authors in ToC
  2021-02-09 10:02 ` mf
@ 2021-02-09 20:18   ` jbf
  2021-02-09 20:50   ` jbf
  1 sibling, 0 replies; 6+ messages in thread
From: jbf @ 2021-02-09 20:18 UTC (permalink / raw)
  To: mf; +Cc: mailing list for ConTeXt users

Thank you. Ci siamo quasi, ma non del tutto! Nearly there!

The \midaligned{... } was obviously preventing the \crlf in the 
\startchapter from working. Removing it altogether allowed the split to 
occur but obviously not centred. So i have tried now adding the 
\startalignment[middle] to the definition, but it has no effect if I do 
it as follows:

\define[1]\SectionTocEntry{%
#1\crlf% title
\doifnot{\startalignment[middle]\structurelistuservariable{author}}{}{\structurelistuservariable{author}}%
\stopalignment}

and if I do it as:

\define[1]\SectionTocEntry{%
#1\crlf% title
\startalignment[middle]\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}%
}\stopalignment

compilation fails, and also does so if I enclose everything after 
\startalignment and before \stopalignment in curly brackets. So how 
might I use \startalignment[middle] in the definition?

Julian


On 9/2/21 9:02 pm, mf wrote:
> Il 09/02/21 10:49, jbf ha scritto:
>> I wonder if someone can assist me with the final step in a 
>> complicated Table of Contents where all items in the ToC are centred 
>> (except page numbers which continue to be on the right).
>>
>> Beneath each chapter title is a list of authors (Yes, there can be up 
>> to four authors per chapter!)
>>
>> I can successfully achieve everything (see MWE below) except for 
>> getting the list of authors to split and be centred. Because there 
>> are four of them, I would need to split them so they appear as two 
>> (centred) with the other two below(also centred).
>>
>> Here is my MWE for the essential bit (which is then called in as 
>> textcommand=\SectionTocEntry in \setuplist[chapter], obviously):
>>
>> \define[1]\SectionTocEntry{%
>> #1\crlf% title
>> \midaligned{\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}}% 
>>
>> }
>
> try \startalignment[middle] ... \stopalignment instead of \midaligned
>
>>
>> My problem is that at the moment, the four authors appear on a single 
>> line, so I end up with:
>>
>>             My chapter title
>> Mickey Mouse, Donald Duck, Uncle Scrooge, Minnie Mouse  [p. 1, but in 
>> fact, Minnie Mouse runs across the page number!]
>>
>> What I want instead is:
>>
>>            My chapter title
>>      Mickey Mouse, Donald Duck
>>     Uncle Scrooge, Minnie Mouse        [p. number]
>>
>> Back at the chapter level my code reads:
>>
>> \startchapter[title={Chapter title}][author={Mickey Mouse, Donald 
>> Duck, Uncle Scrooge, Minnie Mouse}].
>
> \startchapter[title={Chapter title}][author={Mickey Mouse, Donald 
> Duck,\crlf Uncle Scrooge, Minnie Mouse}].
>
> Massi
> ___________________________________________________________________________________ 
>
> 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] 6+ messages in thread

* Re: Centered list of authors in ToC
  2021-02-09 10:02 ` mf
  2021-02-09 20:18   ` jbf
@ 2021-02-09 20:50   ` jbf
  2021-02-09 21:11     ` Hans Hagen
  1 sibling, 1 reply; 6+ messages in thread
From: jbf @ 2021-02-09 20:50 UTC (permalink / raw)
  To: mf; +Cc: mailing list for ConTeXt users

Resolved!

\define[1]\SectionTocEntry{%
#1\crlf% title
\startalignment[middle]\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}%
\stopalignment}

Julian

On 9/2/21 9:02 pm, mf wrote:
> Il 09/02/21 10:49, jbf ha scritto:
>> I wonder if someone can assist me with the final step in a 
>> complicated Table of Contents where all items in the ToC are centred 
>> (except page numbers which continue to be on the right).
>>
>> Beneath each chapter title is a list of authors (Yes, there can be up 
>> to four authors per chapter!)
>>
>> I can successfully achieve everything (see MWE below) except for 
>> getting the list of authors to split and be centred. Because there 
>> are four of them, I would need to split them so they appear as two 
>> (centred) with the other two below(also centred).
>>
>> Here is my MWE for the essential bit (which is then called in as 
>> textcommand=\SectionTocEntry in \setuplist[chapter], obviously):
>>
>> \define[1]\SectionTocEntry{%
>> #1\crlf% title
>> \midaligned{\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}}% 
>>
>> }
>
> try \startalignment[middle] ... \stopalignment instead of \midaligned
>
>>
>> My problem is that at the moment, the four authors appear on a single 
>> line, so I end up with:
>>
>>             My chapter title
>> Mickey Mouse, Donald Duck, Uncle Scrooge, Minnie Mouse  [p. 1, but in 
>> fact, Minnie Mouse runs across the page number!]
>>
>> What I want instead is:
>>
>>            My chapter title
>>      Mickey Mouse, Donald Duck
>>     Uncle Scrooge, Minnie Mouse        [p. number]
>>
>> Back at the chapter level my code reads:
>>
>> \startchapter[title={Chapter title}][author={Mickey Mouse, Donald 
>> Duck, Uncle Scrooge, Minnie Mouse}].
>
> \startchapter[title={Chapter title}][author={Mickey Mouse, Donald 
> Duck,\crlf Uncle Scrooge, Minnie Mouse}].
>
> Massi
> ___________________________________________________________________________________ 
>
> 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] 6+ messages in thread

* Re: Centered list of authors in ToC
  2021-02-09 20:50   ` jbf
@ 2021-02-09 21:11     ` Hans Hagen
  2021-02-09 21:58       ` jbf
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2021-02-09 21:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users, jbf, mf

On 2/9/2021 9:50 PM, jbf wrote:
> Resolved!
> 
> \define[1]\SectionTocEntry{%
> #1\crlf% title
> \startalignment[middle]\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}% 
> 
> \stopalignment}

You need to move the \startalignment into the test (you don't want en 
empty one

Anyway, here is an alternative:

\startsetups[MySectionTocEntry]
     \doifsomething{\structurelistuservariable{author}} {
         \startalignment[middle]
             \darkblue \tx \structurelistuservariable{author}
         \stopalignment
     }
\stopsetups

\setuplist[chapter][after=\setups{MySectionTocEntry}]



> Julian
> 
> On 9/2/21 9:02 pm, mf wrote:
>> Il 09/02/21 10:49, jbf ha scritto:
>>> I wonder if someone can assist me with the final step in a 
>>> complicated Table of Contents where all items in the ToC are centred 
>>> (except page numbers which continue to be on the right).
>>>
>>> Beneath each chapter title is a list of authors (Yes, there can be up 
>>> to four authors per chapter!)
>>>
>>> I can successfully achieve everything (see MWE below) except for 
>>> getting the list of authors to split and be centred. Because there 
>>> are four of them, I would need to split them so they appear as two 
>>> (centred) with the other two below(also centred).
>>>
>>> Here is my MWE for the essential bit (which is then called in as 
>>> textcommand=\SectionTocEntry in \setuplist[chapter], obviously):
>>>
>>> \define[1]\SectionTocEntry{%
>>> #1\crlf% title
>>> \midaligned{\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}}% 
>>>
>>> }
>>
>> try \startalignment[middle] ... \stopalignment instead of \midaligned
>>
>>>
>>> My problem is that at the moment, the four authors appear on a single 
>>> line, so I end up with:
>>>
>>>             My chapter title
>>> Mickey Mouse, Donald Duck, Uncle Scrooge, Minnie Mouse  [p. 1, but in 
>>> fact, Minnie Mouse runs across the page number!]
>>>
>>> What I want instead is:
>>>
>>>            My chapter title
>>>      Mickey Mouse, Donald Duck
>>>     Uncle Scrooge, Minnie Mouse        [p. number]
>>>
>>> Back at the chapter level my code reads:
>>>
>>> \startchapter[title={Chapter title}][author={Mickey Mouse, Donald 
>>> Duck, Uncle Scrooge, Minnie Mouse}].
>>
>> \startchapter[title={Chapter title}][author={Mickey Mouse, Donald 
>> Duck,\crlf Uncle Scrooge, Minnie Mouse}].
>>
>> Massi
>> ___________________________________________________________________________________ 
>>
>> 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
> ___________________________________________________________________________________ 
> 


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 6+ messages in thread

* Re: Centered list of authors in ToC
  2021-02-09 21:11     ` Hans Hagen
@ 2021-02-09 21:58       ` jbf
  0 siblings, 0 replies; 6+ messages in thread
From: jbf @ 2021-02-09 21:58 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Thanks for the alternative. Also gives me further ideas, especially 
regarding placement of the \startalignment

Julian

On 10/2/21 8:11 am, Hans Hagen wrote:
> On 2/9/2021 9:50 PM, jbf wrote:
>> Resolved!
>>
>> \define[1]\SectionTocEntry{%
>> #1\crlf% title
>> \startalignment[middle]\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}% 
>>
>> \stopalignment}
>
> You need to move the \startalignment into the test (you don't want en 
> empty one
>
> Anyway, here is an alternative:
>
> \startsetups[MySectionTocEntry]
>     \doifsomething{\structurelistuservariable{author}} {
>         \startalignment[middle]
>             \darkblue \tx \structurelistuservariable{author}
>         \stopalignment
>     }
> \stopsetups
>
> \setuplist[chapter][after=\setups{MySectionTocEntry}]
>
>
>
>> Julian
>>
>> On 9/2/21 9:02 pm, mf wrote:
>>> Il 09/02/21 10:49, jbf ha scritto:
>>>> I wonder if someone can assist me with the final step in a 
>>>> complicated Table of Contents where all items in the ToC are 
>>>> centred (except page numbers which continue to be on the right).
>>>>
>>>> Beneath each chapter title is a list of authors (Yes, there can be 
>>>> up to four authors per chapter!)
>>>>
>>>> I can successfully achieve everything (see MWE below) except for 
>>>> getting the list of authors to split and be centred. Because there 
>>>> are four of them, I would need to split them so they appear as two 
>>>> (centred) with the other two below(also centred).
>>>>
>>>> Here is my MWE for the essential bit (which is then called in as 
>>>> textcommand=\SectionTocEntry in \setuplist[chapter], obviously):
>>>>
>>>> \define[1]\SectionTocEntry{%
>>>> #1\crlf% title
>>>> \midaligned{\doifnot{\structurelistuservariable{author}}{}{\structurelistuservariable{author}}}% 
>>>>
>>>> }
>>>
>>> try \startalignment[middle] ... \stopalignment instead of \midaligned
>>>
>>>>
>>>> My problem is that at the moment, the four authors appear on a 
>>>> single line, so I end up with:
>>>>
>>>>             My chapter title
>>>> Mickey Mouse, Donald Duck, Uncle Scrooge, Minnie Mouse  [p. 1, but 
>>>> in fact, Minnie Mouse runs across the page number!]
>>>>
>>>> What I want instead is:
>>>>
>>>>            My chapter title
>>>>      Mickey Mouse, Donald Duck
>>>>     Uncle Scrooge, Minnie Mouse        [p. number]
>>>>
>>>> Back at the chapter level my code reads:
>>>>
>>>> \startchapter[title={Chapter title}][author={Mickey Mouse, Donald 
>>>> Duck, Uncle Scrooge, Minnie Mouse}].
>>>
>>> \startchapter[title={Chapter title}][author={Mickey Mouse, Donald 
>>> Duck,\crlf Uncle Scrooge, Minnie Mouse}].
>>>
>>> Massi
>>> ___________________________________________________________________________________ 
>>>
>>> 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
>> ___________________________________________________________________________________ 
>>
>
>
___________________________________________________________________________________
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] 6+ messages in thread

end of thread, other threads:[~2021-02-09 21:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09  9:49 Centered list of authors in ToC jbf
2021-02-09 10:02 ` mf
2021-02-09 20:18   ` jbf
2021-02-09 20:50   ` jbf
2021-02-09 21:11     ` Hans Hagen
2021-02-09 21:58       ` 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).