[NTG-context] structureuservariable in ToC

Henning Hraban Ramm texml at fiee.net
Sun Jan 14 21:44:39 CET 2018


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