* Two issues with respect to sections in ConTeXt
@ 2020-06-05 3:28 Jairo A. del Rio
2020-06-05 15:22 ` Wolfgang Schuster
2020-06-06 16:16 ` Wolfgang Schuster
0 siblings, 2 replies; 3+ messages in thread
From: Jairo A. del Rio @ 2020-06-05 3:28 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1229 bytes --]
First:
I made the following question wrt swapping section labels and section
numbers:
https://tex.stackexchange.com/questions/547761/how-to-swap-section-labels-and-section-numbers-in-context
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.
Second:
The TeX command \S (section mark) seems to be insensitive to font size
commands. I've tried with
\setuphead[section][sectionstarter=\S]
And the sign is smaller than the surrounding letters. I thought it was a
matter of font design, but I've tried
\setuphead[section][sectionstarter=§]
And it worked. My question is: why? Is it a bug or a feature with respect
to \S? I'm using ConTeXt MKIV version 2020.05.25 23:39 with LuaTeX
Thank you in advance
Jairo :D
[-- Attachment #1.2: Type: text/html, Size: 1701 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Two issues with respect to sections in ConTeXt
2020-06-05 3:28 Two issues with respect to sections in ConTeXt Jairo A. del Rio
@ 2020-06-05 15:22 ` Wolfgang Schuster
2020-06-06 16:16 ` Wolfgang Schuster
1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2020-06-05 15:22 UTC (permalink / raw)
To: mailing list for ConTeXt users, Jairo A. del Rio
Jairo A. del Rio schrieb am 05.06.2020 um 05:28:
> First:
>
> [...]
>
> Second:
>
> The TeX command \S (section mark) seems to be insensitive to font size
> commands. I've tried with
>
> \setuphead[section][sectionstarter=\S]
>
> And the sign is smaller than the surrounding letters. I thought it was a
> matter of font design, but I've tried
>
> \setuphead[section][sectionstarter=§]
>
> And it worked. My question is: why? Is it a bug or a feature with
> respect to \S? I'm using ConTeXt MKIV version 2020.05.25 23:39 with LuaTeX
I think a side effect of backwards compatibility to plain TeX which
provides \S. The reason for the odd output is that \S is defined as math
symbol and size switches for them work only when you use them in math
mode (you can try \m{\S}).
To get a symbol in the correct size you have to use the \sectionmark
command or use §, there is no difference between both ways.
\starttext
\S \sectionmark §
\ss \S \sectionmark §
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Two issues with respect to sections in ConTeXt
2020-06-05 3:28 Two issues with respect to sections in ConTeXt Jairo A. del Rio
2020-06-05 15:22 ` Wolfgang Schuster
@ 2020-06-06 16:16 ` Wolfgang Schuster
1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2020-06-06 16:16 UTC (permalink / raw)
To: mailing list for ConTeXt users, Jairo A. del Rio
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-and-section-numbers-in-context
>
> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-06 16:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 3:28 Two issues with respect to sections in ConTeXt Jairo A. del Rio
2020-06-05 15:22 ` Wolfgang Schuster
2020-06-06 16:16 ` Wolfgang Schuster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).