* Chapter-author in TOC
@ 2010-09-19 15:44 Andreas Harder
2010-09-19 16:36 ` Wolfgang Schuster
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Harder @ 2010-09-19 15:44 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi all!
I’m using the structureuservariable to set an author on a per chapter basis. But I would also like to have them in the table of contents, so I tried the following:
\setuplist[chapter][alternative=MyListItem]
\definelistplacement[MyListItem][none]#1#2#3%
{#1 #2 (\structureuservariable{author}) #3}
\starttext
\placelist[chapter]
\startchapter[title=Quote from Tufte][author=Tufte]
\input tufte
\stopchapter
\startchapter[title=Quote from Knuth][author=Knuth]
\input Knuth
\stopchapter
\stoptext
… without success. I appreciate any help.
Greeting
Andreas
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Chapter-author in TOC
2010-09-19 15:44 Chapter-author in TOC Andreas Harder
@ 2010-09-19 16:36 ` Wolfgang Schuster
2010-09-19 16:50 ` Andreas Harder
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2010-09-19 16:36 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Harald Koenig
Am 19.09.2010 um 17:44 schrieb Andreas Harder:
> Hi all!
>
> I’m using the structureuservariable to set an author on a per chapter basis. But I would also like to have them in the table of contents, so I tried the following:
>
> [...]
>
> … without success. I appreciate any help.
Hi Andreas,
your question comes just in time, here is a example i planned to send to Harald only.
\define[3]\ChapterList
{\bTABLE[offset=0pt,strut=yes,frame=off,width=.5\textwidth]
\bTR
\bTD \structurelistuservariable{date} \eTD
\bTD #2 \eTD
\eTR
\eTABLE}
\setuplist
[chapter]
[alternative=command,
command=\ChapterList]
\define[2]\ChapterHead
{\startframedtext[frame=off,width=\textwidth,offset=0pt,align=middle]
\doifsomething{\structureuservariable{date}}{\structureuservariable{date}\blank}
#2
\doifsomething{\structureuservariable{author}}{\blank\structureuservariable{author}}
\stopframedtext}
\setuphead
[chapter]
[command=\ChapterHead]
\starttext
\completecontent
\startchapter[title=Rom][date=12.06.2010,author=Knuth]
\input knuth
\stopchapter
\startchapter[title=Pisa][date=14.06.2010,author=Tufte]
\input tufte
\stopchapter
\stoptext
Wolfgang
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Chapter-author in TOC
2010-09-19 16:36 ` Wolfgang Schuster
@ 2010-09-19 16:50 ` Andreas Harder
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Harder @ 2010-09-19 16:50 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 19.09.2010 um 18:36 schrieb Wolfgang Schuster:
>
> Am 19.09.2010 um 17:44 schrieb Andreas Harder:
>
>> Hi all!
>>
>> I’m using the structureuservariable to set an author on a per chapter basis. But I would also like to have them in the table of contents, so I tried the following:
>>
>> [...]
>>
>> … without success. I appreciate any help.
>
> Hi Andreas,
>
> your question comes just in time, here is a example i planned to send to Harald only.
>
> \define[3]\ChapterList
> {\bTABLE[offset=0pt,strut=yes,frame=off,width=.5\textwidth]
> \bTR
> \bTD \structurelistuservariable{date} \eTD
> \bTD #2 \eTD
> \eTR
> \eTABLE}
>
> \setuplist
> [chapter]
> [alternative=command,
> command=\ChapterList]
>
> \define[2]\ChapterHead
> {\startframedtext[frame=off,width=\textwidth,offset=0pt,align=middle]
> \doifsomething{\structureuservariable{date}}{\structureuservariable{date}\blank}
> #2
> \doifsomething{\structureuservariable{author}}{\blank\structureuservariable{author}}
> \stopframedtext}
>
> \setuphead
> [chapter]
> [command=\ChapterHead]
>
> \starttext
> \completecontent
> \startchapter[title=Rom][date=12.06.2010,author=Knuth]
> \input knuth
> \stopchapter
> \startchapter[title=Pisa][date=14.06.2010,author=Tufte]
> \input tufte
> \stopchapter
> \stoptext
Thank you very much Wolfgang, as always perfect!
Andreas
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-19 16:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-19 15:44 Chapter-author in TOC Andreas Harder
2010-09-19 16:36 ` Wolfgang Schuster
2010-09-19 16:50 ` Andreas Harder
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).