On Jan 19, 2008 9:51 PM, Henning Hraban Ramm
Ahoi!
For a songbook I need a alphabetically sorted TOC. As easy workaround I tried to use an register/index. But I'd like to get my headers into the index without typing \index all the time. But with my following setup I get only garbage numbers instead of my titles:
\setuphead[Titel] [style={\hw\tfa}, page=yes, number=no, textcommand=\TitelFrame] \def\TitelFrame#1{\index{#1}% \framed[ width=\textwidth, height=7.5mm, frame=off, align={right,high}, after={}, before={}]% {\switchtobodyfont[12pt]\hw\tfa #1}% }
My .tuo file contains lines like:
\listentry{Titel}{2}{}{nihil ita ut videtur}{2--0-1-0-0-0-0-0--1}{3}% ... \registerpage{index}{,}{1}{\dowritetolist \@@koppeling {}{nihil ita ut videtur}\v!head }}\fi \executeifdefined {\??ko Titel\c! deeptextcommand }\firstofoneargument {nihil ita ut videtur}\endstrut } {2--0-1-0-0-0-0-0--1}%
The 5th instead of the 4th parameter of \listentry is printed in the index.
My fault or a bug?
I haven't tested you example but you can try my solution. \def\doplacesectiontitles#1:#2\relax {\line{#1\hfill\hbox to 3em{#2\hss}}} \def\placesectiontitles#1% {\doplacesectiontitles#1\relax} \definesorting [sectiontitle] [sectiontitles] \setupsorting [sectiontitle] [criterium=all, command=\placesectiontitles] \def\titleformat#1% {\bgroup \expanded{\sectiontitle[music:#1]{#1:\pagenumber}}% #1% \egroup} \setuphead [chapter] [incrementnumber=list, coupling=chapter, deeptextcommand=\titleformat] \def\placetitle {\setbox\scratchbox\vbox{\placelist[chapter][]}% \placelistofsectiontitles} \starttext \placetitle \chapter{Knuth}\input knuth\par \chapter{Tufte}\input tufte\par \chapter{Reich}\input reich\par \chapter{Materie}\input douglas\par \chapter{Douglas}\input douglas\par \chapter{Dawkins}\input dawkins\par \chapter{Ward}\input ward\par \chapter{Zapf}\input zapf\par \chapter{Bryson}\input bryson\par \chapter{Davis}\input davis\par \chapter{Thuan}\input thuan\par \chapter{Hawking}\input hawking\par \chapter{Linden}\input linden\par \chapter{Weisman}\input weisman\par \stoptext The names for the macros are not very well choosen and should be renamed and the format the toc and the headers is also should be also changed but the sorting works. Wolfgang