Difference between revisions of "Command/definelistalternative"

From Wiki
Jump to navigation Jump to search
m (Fix renamed command in code)
(remove obsolete syntax tables)
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
== [[Help:Reference|Syntax]] ==
== [[Help:Reference|Syntax]] (autogenerated) ==
<table cellspacing="4" cellpadding="2" class="cmd">
    <td colspan="2" class="cmd">\definelistalternative<span class="first" >[...]</span><span class="second" style="color:red;">[...,...=...,...]</span></td>
  <tr valign="top" class="first">
    <td class="cmd">[...]</td>
    <td>list name </td>
  <tr valign="top" class="second">
    <td class="cmd">renderingsetup</td>
== Description ==
== Description ==
Line 60: Line 49:
%% NB: this code is not executed on the wiki
Line 99: Line 87:
== See also ==
== See also ==
* {{cmd|setuplist}}
* {{cmd|setuplistalternative}}
* {{cmd|setupcombinedlist}}
* [[Table of Contents]]
== Help from ConTeXt-Mailinglist/Forum ==
== Help from ConTeXt-Mailinglist/Forum ==

Latest revision as of 14:39, 16 May 2020


Syntax (autogenerated)

...=...,...inherits from \setuplistalternative



The renderingsetup 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


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


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


\startsetups [list:footlist]
    \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
            {     \currentlistentrytitle}\NC\NR
    \NC page                    \EQ \currentlistentrypagenumber     \NC\NC\NR

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

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


See also

Help from ConTeXt-Mailinglist/Forum

All issues with: