Difference between revisions of "Command/setuplist"

From ConTeXt wiki
(remove MkII cruft, add autogenerated syntax)
(better structure)
 
Line 164: Line 164:
  
 
== Description ==  
 
== Description ==  
interaction: what part of content line should be interactive if \setupinteraction[state=start].
 
 
== List layout ==
 
The overall layout of the list is determined by the
 
{{code|alternative}} key. The alternatives a,b,c, etc. and a few
 
more are predefined. The most flexible solution to implement a
 
custom layout is to define a new custom one which can be set as
 
argument to {{code|alternative}}, see {{cmd|definelistalternative}}.
 
  
 +
* alternative: Overall layout of the list. The alternatives a, b, c, etc. are predefined. The most flexible solution to implement a custom layout is to define a new custom one which can be set as argument to {{code|alternative}}, see {{cmd|definelistalternative}}.
 +
* interaction: what part of content line should be interactive if {{cmd|setupinteraction}}<tt>[state=start]</tt>.
 +
* criterium: Default criterium is <tt>local</tt> for a newly defined list. That can cause an empty {{cmd|placelist}}. Criterium <tt>component</tt> is used to establish [http://wiki.contextgarden.net/Table_of_Contents#ToC_.28and_other_lists.29_via_project_structures ToC (and other lists) via project structures].
  
 
== Comment ==
 
== Comment ==
 +
 
  
Default criterium is LOCAL for newly defined list. That can cause strange empty \placelist.
+
== Examples ==
 
 
Criterium COMPONENT is used to establish [http://wiki.contextgarden.net/Table_of_Contents#ToC_.28and_other_lists.29_via_project_structures ToC (and other lists) via project structures]. 
 
 
 
== Example ==
 
  
 
<context source=yes>
 
<context source=yes>
Line 217: Line 209:
 
The `alternative=interactive` is required to maintain hyperlinked page numbers when links are enabled in the document. Without the `after=\endgraf` items would be displayed on one line.
 
The `alternative=interactive` is required to maintain hyperlinked page numbers when links are enabled in the document. Without the `after=\endgraf` items would be displayed on one line.
  
== Using tabular numbers==
+
=== Using tabular numbers===
  
 
In a long TOC it looks awkward if proportional numbers are used. It is better to enable the font feature tabularnumbers:
 
In a long TOC it looks awkward if proportional numbers are used. It is better to enable the font feature tabularnumbers:
Line 223: Line 215:
 
\setuplist[chapter][pagestyle={\feature[+][tabularnumbers]}]
 
\setuplist[chapter][pagestyle={\feature[+][tabularnumbers]}]
  
This was posted by Wolfgang Schuster upon a question on the mailing list. Thank you!
 
 
== See also ==
 
== See also ==
{{cmd|definelistalternative}}
+
 
 +
* {{cmd|definelist}}
 +
* {{cmd|definelistalternative}}
 +
* {{cmd|definecombinedlist}}
 +
* {{cmd|setupcombinedlist}}
 +
* [[Table of Contents]]
 +
* {{cmd|setupframed}}
  
 
== Help from ConTeXt-Mailinglist/Forum ==
 
== Help from ConTeXt-Mailinglist/Forum ==

Latest revision as of 20:05, 17 September 2019

\setuplist

Syntax (autogenerated)

\setuplist[...,...][...=...,...]
[...,...]list
statestart stop
locationnone here
typesimple command userdata
criteriumlocal intro reference sectionblock:reference all sectionblock:all text sectionblock:text current sectionblock:current here previous sectionblock:previous component section sectionblock:section
listname
widthfit broad dimension
heightfit broad dimension
depthfit broad dimension
symbolone two three none default
labelyes no none name
startercommand
stoppercommand
commandthreearguments
numbercommandoneargument
textcommandoneargument
pagecommandoneargument
pagenumberyes no always
headnumberyes no always
beforecommand
aftercommand
inbetweencommand
marginnone dimension
distancenone dimension
aligntitleyes no
numberalignleft right middle flushleft flushright inner outer
alignsee \setupalign
hangyes no
leftcommand
rightcommand
interactionyes no all number text title page sectionnumber pagenumber
limittextyes no text
stylestyle command
colorcolor
numberstylestyle command
numbercolorcolor
textstylestyle command
textcolorcolor
pagestylestyle command
pagecolorcolor
referencenumber
extrasname
ordercommand all title
alternativea b c d e f g left right top bottom command none interactive paragraph horizontal vertical name
maxwidthdimension
pageprefixyes no
pageprefixseparatorsetname
pageprefixconversionsetname
pageprefixsetname
pageprefixsegmentsnumber number:number number:* number:all section section:section section:* section:all current
pageprefixconnectorcommand processor->command
pageconversionsetname
pagestartercommand processor->command
pagestoppercommand processor->command
...=...,...inherits from \setupcounter
...=...,...inherits from \setupframed


Syntax

\setuplist[...,...,...][...,...=...,...]
[...,...,...] name
state start stop
alternative a b c ... none command
coupling on off
criterium section component local previous current all
pageboundaries list
style normal bold slanted boldslanted type cap small... command
textstyle normal bold slanted boldslanted type cap small... command
pagestyle normal bold slanted boldslanted type cap small... command
color name
numbercolor name
command threearguments
textcommand oneargument
pagecommand oneargument
interaction sectionnumber text pagenumber all
before command
after command
inbetween command
left text
right text
label yes no
prefix yes no none
pagenumber yes no
headnumber yes no
sectionnumber yes no
aligntitle yes no
margin dimension
width dimension fit
height dimension fit broad
depth dimension fit broad
distance dimension
separator text
stopper text
symbol none 1 2 3 ...
expansion yes no command
maxwidth dimension
[...,...=...,...] see \framed


Description

  • alternative: Overall layout of the list. The alternatives a, b, c, etc. are predefined. The most flexible solution to implement a custom layout is to define a new custom one which can be set as argument to alternative, see \definelistalternative.
  • interaction: what part of content line should be interactive if \setupinteraction[state=start].
  • criterium: Default criterium is local for a newly defined list. That can cause an empty \placelist. Criterium component is used to establish ToC (and other lists) via project structures.

Comment

Examples

\definelist[Reprints][criterium=all]

\starttext
  \section{Sec 1}
  \writetolist[Reprints]{1.}{List entry A}
  \subsection{Subsec 1}
  \writebetweenlist[Reprints]{\hrule}
  \writetolist[Reprints]{2.}{List entry B}
  \completelist[Reprints]
\stoptext

Left-hand Page Number

The following example positions the page number to the left of the list entry title:

\define[3]\SectionToCEntry{
  \leftaligned\bgroup
     \hbox to 2em{#3}%
     \hskip 1em
     \vtop{\hsize\dimexpr\textwidth-3em\relax#2}%
  \egroup
}

\setuplist
  [section]
  [alternative=interactive,
   command=\SectionToCEntry,
   after=\endgraf]

The alternative=interactive is required to maintain hyperlinked page numbers when links are enabled in the document. Without the after=\endgraf items would be displayed on one line.

Using tabular numbers

In a long TOC it looks awkward if proportional numbers are used. It is better to enable the font feature tabularnumbers:

\setuplist[chapter][pagestyle={\feature[+][tabularnumbers]}]

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: