Difference between revisions of "Command/setuplabeltext"

From ConTeXt wiki
Jump to navigationJump to search
(→‎Description: brief remark on the arg parser issue)
m (→‎See also: source link)
Line 98: Line 98:
== See also ==
== See also ==
* {{cmd|labeltext}} to retrieve a label text.
* {{cmd|labeltext}} to retrieve a label text.
* [http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/lang-lab.mkiv#l42 documentation] in the source
== Help from ConTeXt-Mailinglist/Forum ==
== Help from ConTeXt-Mailinglist/Forum ==

Revision as of 11:12, 16 June 2012



[...] nl fr en uk de es cz ..
name text


In some cases ConTeXt generates text labels automatically; for example, the word Figure is generated automatically when a caption is placed under a figure. These kind of words are called label texts. Labels are set with the command \setuplabeltext, and retrieved with the command \labeltext. They follow the language set with \mainlanguage, not the local bits of different language that are set with \language.

NB The option parser for the command \setuplabeltext is known to behave somewhat differently from most setups, posing minor constraints on code formatting. For instance the trailing comma after an assignment, otherwise employed to delimit the value, will lead to an error here. The final option in the list needs thus to be terminated by the closing bracket.

\setuplabeltext [
  Omen=est,  %% <= fails!
\setuplabeltext [Nomen=nomen, Est=est, Omen=est] %% <= works


Here is an example of changing section and subsection heads.

% English labels
\setuplabeltext[en][section=My section ] % We want a space at the end of the label
\setuplabeltext[en][subsection=My subsection ]

% Dutch labels
\setuplabeltext[nl][section=Mijn hoofdstuk ] % We want a space at the end of the label
\setuplabeltext[nl][subsection=Mijn onderdeel ]

\def\setheadnumber#1#2{#1. #2}



\section{First Thoughts}
\subsection{First Subsection}

% Changing the language does not change the labels
\section{Second Thoughts}
\subsection{Second Subsection}

% To change the labels, change the main language.
\section{Third Thoughts}
\subsection{Third Subsection}

% Retrieving a label explicity:
This is the Dutch label for sections: \labeltext{section}.


results in

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: