[NTG-context] structureuservariable in ToC

Henning Hraban Ramm texml at fiee.net
Tue Jan 23 21:16:00 CET 2018


Some hint on that would be nice.
Is it maybe related to the "Registers and getparameters" problem?
I tried a few things WRT expansion, but it seems like I didn’t find the right command in the right place.

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

Am 2018-01-14 um 21:44 schrieb Henning Hraban Ramm <texml at fiee.net>:

> Now, my second issue with user variables:
> 
> """
> \define[1]\ChapterTocEntry{%
>  \doifnotempty{\structureuservariable{author}}{\structureuservariable{author}\crlf }%
>  #1%
>  \doifnotempty{\structureuservariable{subtitle}}{\crlf\structureuservariable{subtitle}}}
> 
> \setuplist[chapter][textcommand=\ChapterTocEntry]
> 
> \starttext
> \completelist[chapter][criterium=all]
> 
> \startchapter[
>  title={The Use of Typefaces}][%
>  author={Hermann Zapf},
>  subtitle={Ein zapfiges Zitat}]
> 
> \input zapf
> 
> \stopchapter
> 
> \startchapter[
>  title={Sheep and Goats}][%
>  author={Siegfried Tufte},
>  subtitle={Tofte Tufte-Zitat}]
> 
> \input tufte
> 
> \stopchapter
> 
> \stoptext
> """
> 
> I’m trying to get author and subtitle into the ToC (while in the content, subtitle goes to the margin and author to the end of the chapter).
> But in this example, both are empty (but not empty enough for doifnotempty), while in my actual project I always get author and subtitle from the first chapter.
> I guess this is an expansion problem?
> 
> 
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> GPG Key ID 1C9B22FD



More information about the ntg-context mailing list