chapter setup / table of contents
Ahoi! In a volume of proceedings, each chapter has an author and title and sometimes a subtitle. The ToC entry should look like: Author: Title \hfill Page (no indents!) At the moment I've this setup: --- \def\Titel#1#2#3{% author, title, subtitle \page% {\writebetweenlist[chapter]{\placeongrid{\noindent #1:}} \switchtobodyfont[12pt]\noindent #1% \chapter{\noindent #2}% {\ss\bf #3}% \blank[2*big]}% } \setuphead[chapter][page=no, number=no, align= {flushleft,nothyphenated,verytolerant}, style={\ss\bfa}, before={}, after={\blank}] \definecombinedlist[toc][chapter][level=chapter, placehead=no, criterium=all, alternative=b, offset=none] \setupcombinedlist [toc] [partnumber=no] --- Please don't cry, I know it's ugly... ;-) What it does is close, but nood good enough. - Is there a way to use the normal chapter (or any head) mechanism with such "feathered" titles? - How do I get my special ToC? Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
On Mon, Apr 14, 2008 at 10:06 PM, Henning Hraban Ramm
Ahoi!
In a volume of proceedings, each chapter has an author and title and sometimes a subtitle. The ToC entry should look like:
Author: Title \hfill Page (no indents!)
At the moment I've this setup:
---
\def\Titel#1#2#3{% author, title, subtitle \page% {\writebetweenlist[chapter]{\placeongrid{\noindent #1:}} \switchtobodyfont[12pt]\noindent #1% \chapter{\noindent #2}% {\ss\bf #3}% \blank[2*big]}% }
\setuphead[chapter][page=no, number=no, align= {flushleft,nothyphenated,verytolerant}, style={\ss\bfa}, before={}, after={\blank}]
\definecombinedlist[toc][chapter][level=chapter, placehead=no, criterium=all, alternative=b, offset=none] \setupcombinedlist [toc] [partnumber=no]
---
Please don't cry, I know it's ugly... ;-)
What it does is close, but nood good enough.
- Is there a way to use the normal chapter (or any head) mechanism with such "feathered" titles? - How do I get my special ToC?
I've seen in core-lst % \setuplist % [section] % [alternative=MyListItem, % after=\blank, % before=\blank] % % \definelistplacement[MyListItem][none]#1#2#3% % {(#1) (#2) (#3)} Maybe this can help you ? -- luigi it's new . it's powerful . it's luatex . http://www.luatex.org
Am 2008-04-14 um 22:26 schrieb luigi scarso:
I've seen in core-lst
% \setuplist % [section] % [alternative=MyListItem, % after=\blank, % before=\blank] % % \definelistplacement[MyListItem][none]#1#2#3% % {(#1) (#2) (#3)}
Maybe this can help you ?
I guess not - these 3 parameters are AFAIK part no., title and page no., and it's called "automatically" for the ToC entry, so I don't know how I could replace #2 with "<author>: #2" i.e. "alternative" in \setuplist is only for defining a different format for the ToC line, not for changing the *content* of it. Probably I must utilize that, too, but it doesn't solve my problem on its own. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
a bit of lua code ? \startluacode MyStuff = {} SecCount = 0 SecIndexCount = 0 \stopluacode \definelistplacement[MyListItem][none]#1#2#3{% \ctxlua{SecIndexCount = SecIndexCount +1} %% Do something with %%\ctxlua{tex.sprint(MyStuff[SecIndexCount])} %% } \setuplist[section][alternative=MyListItem, ] \def\SectionHeadCommand#1#2{% \ctxlua{SecCount = SecCount +1} %% Here set MyStuff %% \ctxlua{MyStuff[SecCount] = "...."}% %% } \setuphead[section][command={\SectionHeadCommand}]
I guess not - these 3 parameters are AFAIK part no., title and page no., and it's called "automatically" for the ToC entry, so I don't know how I could replace #2 with "<author>: #2"
i.e. "alternative" in \setuplist is only for defining a different format for the ToC line, not for changing the *content* of it.
Probably I must utilize that, too, but it doesn't solve my problem on its own.
Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
-- luigi it's new . it's powerful . it's luatex . http://www.luatex.org
On Mon, Apr 14, 2008 at 10:06 PM, Henning Hraban Ramm
Ahoi!
In a volume of proceedings, each chapter has an author and title and sometimes a subtitle. The ToC entry should look like:
Author: Title \hfill Page (no indents!)
At the moment I've this setup:
---
\def\Titel#1#2#3{% author, title, subtitle \page% {\writebetweenlist[chapter]{\placeongrid{\noindent #1:}} \switchtobodyfont[12pt]\noindent #1% \chapter{\noindent #2}% {\ss\bf #3}% \blank[2*big]}% }
\setuphead[chapter][page=no, number=no, align= {flushleft,nothyphenated,verytolerant}, style={\ss\bfa}, before={}, after={\blank}]
\definecombinedlist[toc][chapter][level=chapter, placehead=no, criterium=all, alternative=b, offset=none] \setupcombinedlist [toc] [partnumber=no]
---
Please don't cry, I know it's ugly... ;-)
What it does is close, but nood good enough.
- Is there a way to use the normal chapter (or any head) mechanism with such "feathered" titles? - How do I get my special ToC?
Try this. \unprotect \resetvalue{\??sw\v!chapter} \startsetups chapter:list \doifsomething{\sectionworldparameter\c!author} {\expanded{\writetolist[\v!chapter] {\sectionworldparameter\c!author:\space \sectionworldparameter\c!text}{}}} \def\ChapterSubTitle{\sectionworldparameter\c!subtitle} \stopsetups \setupsectionworld [chapter] [setups={chapter:list}, author=] \def\ChapterCommand#1#2% {\vbox{#2\crlf\ChapterSubTitle}} \let\ChapterSubTitle\relax \protect \setuphead [chapter] [incrementnumber=no, command=\ChapterCommand] \starttext \completecontent \startsectionworld[chapter][author=Hans,text=Chapter One,subtitle=The Beginning] \startsectionworld[chapter][author=Tom,text=Chapter Two,subtitle=The End] \stopsectionworld \stopsectionworld \stoptext Wolfgang
Am 2008-04-15 um 10:03 schrieb Wolfgang Schuster:
Try this.
\unprotect
\resetvalue{\??sw\v!chapter}
\startsetups chapter:list
\doifsomething{\sectionworldparameter\c!author} {\expanded{\writetolist[\v!chapter] {\sectionworldparameter\c!author:\space \sectionworldparameter\c!text}{}}}
\def\ChapterSubTitle{\sectionworldparameter\c!subtitle}
\stopsetups
\setupsectionworld [chapter] [setups={chapter:list}, author=]
\def\ChapterCommand#1#2% {\vbox{#2\crlf\ChapterSubTitle}}
\let\ChapterSubTitle\relax
\protect
\setuphead [chapter] [incrementnumber=no, command=\ChapterCommand]
\starttext \completecontent \startsectionworld[chapter][author=Hans,text=Chapter One,subtitle=The Beginning] \startsectionworld[chapter][author=Tom,text=Chapter Two,subtitle=The End] \stopsectionworld \stopsectionworld \stoptext
Interesting idea, thank you very much! Never heard about sectionworld before - ConTeXt's sources still aren't my usual bedtime reading. I just managed to add outputting the author (not only in the ToC)... Could you please show me how to set also the header to "Author: Title"? BTW: Just added rsyncing luaTeX binaries to my daily update script, format generation went through, will try more tomorrow... (Thanks Mojca, Wolfgang, Hans, Taco, Luigi etc. so far!) Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
I have now: \unprotect \resetvalue{\??sw\v!chapter} \startsetups chapter:list \doifsomething{\sectionworldparameter\c!author} {\expanded{\writetolist[\v!chapter] {\sectionworldparameter\c!author:\space \sectionworldparameter\c!text}{}}} \def\ChapterAuthor{{\rm\tf\sectionworldparameter\c!author}} \def\ChapterTitle{{\ss\bfa\sectionworldparameter\c!text}} \def\ChapterSubTitle{{\ss\bf\sectionworldparameter\c!subtitle}} \stopsetups \setupsectionworld [chapter] [setups={chapter:list}, author=] \def\ChapterCommand#1#2% {\vbox{\ChapterAuthor\crlf\ChapterTitle\crlf\ChapterSubTitle}} \let\ChapterAuthor\relax \let\ChapterTitle\relax \let\ChapterSubTitle\relax \protect \setuphead [chapter] [incrementnumber=no, command=\ChapterCommand, page=yes, number=no, align={flushleft,nothyphenated,verytolerant} ] The result is about: \rm\tfa Author \ss\bf Title \ss\bfa Subtitle instead of (like I defined): \rm\tf Author \ss\bfa Title \ss\bf SubTitle Why? Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
On Wed, Apr 16, 2008 at 12:32 AM, Henning Hraban Ramm
I have now:
\unprotect
\resetvalue{\??sw\v!chapter}
\startsetups chapter:list
\doifsomething{\sectionworldparameter\c!author} {\expanded{\writetolist[\v!chapter] {\sectionworldparameter\c!author:\space \sectionworldparameter\c!text}{}}}
\def\ChapterAuthor{{\rm\tf\sectionworldparameter\c!author}} \def\ChapterTitle{{\ss\bfa\sectionworldparameter\c!text}} \def\ChapterSubTitle{{\ss\bf\sectionworldparameter\c!subtitle}}
\stopsetups
\setupsectionworld [chapter] [setups={chapter:list}, author=]
\def\ChapterCommand#1#2% {\vbox{\ChapterAuthor\crlf\ChapterTitle\crlf\ChapterSubTitle}}
\let\ChapterAuthor\relax \let\ChapterTitle\relax \let\ChapterSubTitle\relax
\protect
\setuphead [chapter] [incrementnumber=no, command=\ChapterCommand, page=yes, number=no, align={flushleft,nothyphenated,verytolerant} ]
The result is about:
\rm\tfa Author \ss\bf Title \ss\bfa Subtitle
instead of (like I defined):
\rm\tf Author \ss\bfa Title \ss\bf SubTitle
Add "style=," to \setuphead[chapter] because the default value influence your own settings. You should also define a new header for the ToC because it use \title by default and this is also changed with \setuphead[chapter]. Wolfgang
2008/4/16, Wolfgang Schuster
Add "style=," to \setuphead[chapter] because the default value influence your own settings.
I tried that before but the results were not satisfying (it was unclear to me, where it did apply and where not) - I need a different style for the three lines anyway.
You should also define a new header for the ToC because it use \title by default and this is also changed with \setuphead[chapter].
ok, will try tonight. Greetlings, Hraban
I just documented my whole setup at: http://wiki.contextgarden.net/Proceedings_style Hope it helps someone with something similar. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
Hi Hraban,
Never heard about sectionworld before - ConTeXt's sources still aren't my usual bedtime reading.
It was only mentioned in one of the release notes.
I just managed to add outputting the author (not only in the ToC)...
Could you please show me how to set also the header to "Author: Title"?
BTW: Just added rsyncing luaTeX binaries to my daily update script, format generation went through, will try more tomorrow... (Thanks Mojca, Wolfgang, Hans, Taco, Luigi etc. so far!)
No problem. Wolfgang
participants (3)
-
Henning Hraban Ramm
-
luigi scarso
-
Wolfgang Schuster