Command/setuplistalternative

From Wiki
< Command
Revision as of 20:46, 25 September 2020 by Taco (talk | contribs) (Created page with "Documentation for \setuplistalternative")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


\setuplistalternative

Summary

The command \setuplistalternative is used to set up options for the alternative key in \setuplist

Settings

\setuplistalternative[...,...][...=...,...]
[...,...]name
beforecommand
aftercommand
commandthreearguments
renderingsetupname
widthdimension
distancedimension
stretchdimension
fillercommand

OptionExplanation
renderingsetup
see below

Description

The renderingsetup in variant default points to a custom defined setup name.

This setup is executed once per list entry. Within this setup the following control sequences are defined to print the list contents or react to particular events.

\currentlistentrylocation the location number is a sequential number for the list entry
\namedstructureheadlocation{structureelementtype} location number of the current active chapter/section/other structure element.
\currentlistentrynumber location number of the current list entry
\currentlistentrytitle the argument of the title key of the structure element corresponding to the current list entry
\currentlistentrypagenumber the page number of the structure element corresponding to the current list entry

Examples

Example 1

The following example prints a table of contents on every page and highlights the current chapter name.

\setupfootertexts
  [\setups{footlist}]

\startsetups [footlist]
  \framed[align=normal, frame=off]
    {\placelist [chapter] [alternative=footlist, criterium=all]}
\stopsetups

\definelistalternative
  [footlist]
  [renderingsetup=list:footlist]

\startsetups [list:footlist]
\starttabulate
    \NC location                \EQ \currentlistentrylocation       \NC\NC\NR
    \NC headlocation\{chapter\} \EQ \namedstructureheadlocation{chapter} \NC\NC\NR
    \NC entrynumber             \EQ \currentlistentrynumber         \NC\NC\NR
    \NC title                   \EQ \currentlistentrytitle          \NC
        \doifelse\currentlistentrylocation{\structureheadlocation{chapter}}
            {%
              {\bfb\currentlistentrytitle}}
            {     \currentlistentrytitle}\NC\NR
    \NC page                    \EQ \currentlistentrypagenumber     \NC\NC\NR
    \HL
\stoptabulate
\stopsetups

\starttext
  \startchapter [title=alpha] \stopchapter
  \startchapter [title=beta]  \stopchapter
  \startchapter [title=gamma] \stopchapter
\stoptext

This is the resulting table from the second page, i.e. in chapter Beta:

result.png

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: