Command/setupregister

From Wiki
Jump to navigation Jump to search

\setupregister

Syntax (autogenerated)

\setupregister[...,...][...,...][...=...,...]
[...,...]name
[...,...]number
referencemethodforward
expansionyes no xml
ownnumberyes no
xmlsetupname
alternativea b A B
methoddefault before after first last ch mm zm pm mc zc pc uc
compressyes no all packed text
checkyes no
criteriumlocal text current previous all section
pageprefixseparatorsetcommand
pageprefixconversionsetname
pageprefixstartercommand processor->command
pageprefixstoppercommand processor->command
pageprefixsetname
pageprefixsegmentsnumber number:number number:* number:all section section:section section:* section:all current
pageprefixconnectorcommand
pageprefixyes no
pageseparatorsetname
pageconversionsetname
pagestartercommand processor->command
pagestoppercommand processor->command
pagesegmentsnumber number:number number:* number:all
maxwidthdimension
indicatoryes no
beforecommand
aftercommand
commandoneargument
textcommandoneargument
deeptextcommandoneargument
pagecommandoneargument
distancedimension
interactiontext pagenumber
pagenumberyes no
symbola n none 1 2 command
languagedefault DIN␣5007-1 DIN␣5007-2 Duden de-DE de-CH de-AT ru-iso9 ocs-scn language
stylestyle command
colorcolor
textstylestyle command
textcolorcolor
pagestylestyle command
pagecolorcolor
pageleftcommand
pagerightcommand
nnumber
balanceyes no
alignsee \setupalign
numberordernumbers
pagemethodpage section


\setupregister[...][...=...,...]
[...]name name:number
referencemethodforward
expansionyes no xml
ownnumberyes no
xmlsetupname
alternativea b A B
methoddefault before after first last ch mm zm pm mc zc pc uc
compressyes no all packed text
checkyes no
criteriumlocal text current previous all section
pageprefixseparatorsetcommand
pageprefixconversionsetname
pageprefixstartercommand processor->command
pageprefixstoppercommand processor->command
pageprefixsetname
pageprefixsegmentsnumber number:number number:* number:all section section:section section:* section:all current
pageprefixconnectorcommand
pageprefixyes no
pageseparatorsetname
pageconversionsetname
pagestartercommand processor->command
pagestoppercommand processor->command
pagesegmentsnumber number:number number:* number:all
maxwidthdimension
indicatoryes no
beforecommand
aftercommand
commandoneargument
textcommandoneargument
deeptextcommandoneargument
pagecommandoneargument
distancedimension
interactiontext pagenumber
pagenumberyes no
symbola n none 1 2 command
languagedefault DIN␣5007-1 DIN␣5007-2 Duden de-DE de-CH de-AT ru-iso9 ocs-scn language
stylestyle command
colorcolor
textstylestyle command
textcolorcolor
pagestylestyle command
pagecolorcolor
pageleftcommand
pagerightcommand
nnumber
balanceyes no
alignsee \setupalign
numberordernumbers
pagemethodpage section


Syntax

\setupregister[...][...][...,...=...,...]
[...] singular
[...] name
n number
balance yes no
align yes no
style normal bold slanted boldslanted type cap small... command
pagestyle normal bold slanted boldslanted type cap small... command
textstyle normal bold slanted boldslanted type cap small... command
indicator yes no
coupling yes no
check yes no
sectionnumber yes no
criterium section local all
distance dimension
symbol 1 2 ... n a ... none
interaction pagenumber text
expansion yes no command
referencing on off
location left middle right
maxwidth dimension
unknownreference empty none
alternative a b A B
prefix both first none
pagecommand command
textcommand command
compress yes no text
language language code
method default before after first last
pageleft command
pageright command

Description

The options are as follows:

Option Description
n number of columns
balance balance columns?
align balance related (it’s difficult; try which combination suits you)
style style of the indicator letters
pagestyle style of page number
textstyle style of index word
indicator create letter sections?
coupling special feature for screen documents (no effect in MkIV?)
check set \seeindex entry as entered without verifying. Default no.
(section)number print part/... numbers?
criterium for part/chapter/section registers
distance between text and pagenumber as well as indentation of nested entries
symbol for pagenumber (a=a,b,c; n=1,2,3; 1=dots; 2=blocks)
interaction which part should be clickable?
expansion When the entry is a command, it is expanded before writing to the register
referencing create references for letter sections (like "index:a")?
textcommand custom command for index word
pagecommand custom command for page number
location ?
compress collapse page numbers (i.e. make “10–13” from “10,11,12,13”); “text” (new in April 2019) makes “10ff.”. You can configure the latter via \setuplabeltext[en][following:singular=f.,following:plural=ff.]
maxwidth Set the maximum length for the text of the index entry in the registerlist (the command uses \limitatetext to do this)
unknownreference insert a horizontal space before and after the reference in the text if you use interactive mode to move from one entry in the text to next or previous one and there is no previous or next reference.
alternative ?
language language code like in \language, influences sorting; see definitions in sort-lan.mkiv
method sets up the sorter used for \placeregister, explained at Command/keyword:method
pageleft custom command before the first page number
pageright custom command after the last page number

Some options don’t seem to have any effect, at least in MkIV.

Example

Here is an example for MkII:

\defineregister[nickname][nicknames]

\setupregister [nickname]
  [partnumber=no,alternative=A,criterium=all,n=3,balance=yes,pagestyle=normal]
\setupregister [nickname][foto][pagestyle=bold]

\starttext

Text about Mamut\nickname{Mamut}.
\placefigure[]
  {Kuba\nickname[foto::]{Kuba} on the photo.}
  {\externalfigure[kuba][width=0.2\textwidth]}

\page
And text about Kuba\nickname{Kuba}.

\completenickname
\stoptext 

yields


I found it safer to put \register command after punctuation e.g.: Mamut.\nickname{Mamut} [P.K.]

For the MkIV version of setting the pagestyle, and more, see the material on \defineprocessor that is on this page.

pageleft and pageright

They were introduced in ConTeXt MkIV version 1.02 (2018.05.12 00:07).

You can use them, for example, to move the page numbers to the right, with:

\setupregister[index][pageleft=\wordright\bgroup,pageright=\egroup]

See this thread on the mailing list.

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: