Jairo A. del Rio schrieb am 05.06.2020 um 05:28:
First:
I made the following question wrt swapping section labels and section numbers:
https://tex.stackexchange.com/questions/547761/how-to-swap-section-labels-an...
What I tried to do is the following section structure
1. Chapter (Name of chapter) 1. 2 Section (Name of section)
Wolfgang Schuster offered the following solution for chapters in Spanish, thanks :)
\setuplabeltext[es][chapter={, capítulo}]
However, I asked if there is a way to use predefined section labels according to chapters, sections, parts, etc. e.g. Chapter (EN) or Capítulo (ES) without manually writing a \setuplabeltext for every language, so he suggested that I move my question here and there we are.
Making the labels accessible is the simple part but not as part of the labeltext class. The harder part is to move the text to the right side of the number because by default most labels appear only on the left side. Below are a few examples of the current state of labeltexts. 1. Position When you set a label the text for a label you have to specify on which side of the content it should appear. In the following example I set a label which has text for the left and right side, both texts are separated by a comma. To get the text for a cetain side you use either the \left... or \right... command or but you can also use the \...texts command which adds both to the content in the second argument. What isn't possible is to set a single text and apply it to the right side of the text. \starttext \setuplabeltext[example={Left , Right}] \labeltext{example}1 \leftlabeltext{example}2\rightlabeltext{example} \labeltexts{example}{3} \stoptext 2. Languages Labels are only applied to the main language of a document which is set with the \mainlanguage command. Local changes of a language (which is used to apply local hyphenation patterns) don't change the label. \starttext \setuplabeltext [en] [language=English] \setuplabeltext [nl] [language=Dutch] \labeltext{language} \language[nl] \labeltext{language} \mainlanguage[nl] \labeltext{language} \stoptext To use language dependent texts you can use the \translate command but you to set the texts in the argument of the command. \starttext \translate [en=English,nl=Dutch] \language[nl] \translate [en=English,nl=Dutch] \stoptext 3. Sections Thee reason why you can't provide existing label texts for all sections labels is that a few of the main levels (part, chapter, section) have default values for the bodypartlabel key. When ConTeXt typesets the content of the section it applies the label which is set with this key to the section number, this means each chapter will now have "Chapter " as prefix for the number which changes all documents. % \setuphead % [section] % [bodypartlabel=] % default: bodypartlabel=section \starttext \section{A section without label} \setuplabeltext [en] [section={Section }] \section{A section with label} \stoptext Wolfgang