Difference between revisions of "Generate Authorlist from Head Content"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | == | + | ==User Content in Heads and Table of Contents== |
− | + | With the new head syntax (MkIV) one can easy add information to chapters, sections, etc. | |
+ | |||
+ | Here is an example from Wolfgang Schuster ([http://archive.contextgarden.net/message/20100919.163604.e1f8cb40.en.html]) | ||
<texcode> | <texcode> | ||
+ | \define[3]\ChapterList | ||
+ | {\bTABLE[offset=0pt,strut=yes,frame=off,width=.5\textwidth] | ||
+ | \bTR | ||
+ | \bTD \structurelistuservariable{date} \eTD | ||
+ | \bTD #2 \eTD | ||
+ | \bTD (\structurelistuservariable{author}) \eTD | ||
+ | \eTR | ||
+ | \eTABLE} | ||
− | \ | + | \setuplist |
− | + | [chapter] | |
− | + | [alternative=command, | |
− | + | command=\ChapterList] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | \define[2]\ChapterHead | |
+ | {\startframedtext[frame=off,width=broad,offset=0pt,align=middle] | ||
+ | \doifsomething | ||
+ | {\structureuservariable{date}} | ||
+ | {\structureuservariable{date}\blank} | ||
+ | #2 | ||
+ | \doifsomething | ||
+ | {\structureuservariable{author}} | ||
+ | {\blank\structureuservariable{author}} | ||
+ | \stopframedtext} | ||
− | + | \setuphead | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | \setuphead | ||
[chapter] | [chapter] | ||
− | + | [command=\ChapterHead] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [command= | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | \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 | ||
</texcode> | </texcode> |
Revision as of 23:19, 29 September 2010
User Content in Heads and Table of Contents
With the new head syntax (MkIV) one can easy add information to chapters, sections, etc.
Here is an example from Wolfgang Schuster ([1])
\define[3]\ChapterList {\bTABLE[offset=0pt,strut=yes,frame=off,width=.5\textwidth] \bTR \bTD \structurelistuservariable{date} \eTD \bTD #2 \eTD \bTD (\structurelistuservariable{author}) \eTD \eTR \eTABLE} \setuplist [chapter] [alternative=command, command=\ChapterList] \define[2]\ChapterHead {\startframedtext[frame=off,width=broad,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