uppercase section titles: no line breaking?
Hi again, I’m trying to get uppercase titles with \WORD, but they aren’t broken into lines; while \WORD works in normal text. What’s the matter? Best, Hraban %%%%% \define[2]\MyChapter{ \WORD{#2} } \setuphead[chapter][ command=\MyChapter ] \starttext \chapter{ \input tufte } \WORD{ \input knuth } \stoptext %%%%%
Henning Hraban Ramm schrieb am 11.01.2020 um 18:53:
Hi again, I’m trying to get uppercase titles with \WORD, but they aren’t broken into lines; while \WORD works in normal text. What’s the matter?
ConTeXt uses a horizontal box to place the section title which doesn't matter when you use one of the predefined layouts because they add a vertical box for the text to allow long texts. When you use the command key to create your own layout you have to add a vertical box, otherwise all text is placed in a single line. While you can use a custom layout to create an uppercase title the easier way is to use the style key. \setuphead [chapter] [number=no, %style={\setcharactercasing[WORD]}] style=WORD] \starttext \chapter{\samplefile{weisman}} \WORD{\samplefile{weisman}} \stoptext Wolfgang
Am 2020-01-11 um 19:21 schrieb Wolfgang Schuster
: Henning Hraban Ramm schrieb am 11.01.2020 um 18:53:
Hi again, I’m trying to get uppercase titles with \WORD, but they aren’t broken into lines; while \WORD works in normal text. What’s the matter?
ConTeXt uses a horizontal box to place the section title which doesn't matter when you use one of the predefined layouts because they add a vertical box for the text to allow long texts.
When you use the command key to create your own layout you have to add a vertical box, otherwise all text is placed in a single line.
While you can use a custom layout to create an uppercase title the easier way is to use the style key.
\setuphead [chapter] [number=no, %style={\setcharactercasing[WORD]}] style=WORD]
\starttext
\chapter{\samplefile{weisman}}
\WORD{\samplefile{weisman}}
\stoptext
Thank you very much! I tried a \framed to no avail. And I thought I needed my own command since I also set color and font, but style={\MyDefinedFont\WORD} actually works. In my other setup I already tried a \vbox, but the problem is different, I guess. My remaining problem in this case is irregular line spacing if there are umlauts, will open a new thread. Best, Hraban
Henning Hraban Ramm schrieb am 11.01.2020 um 19:38:
Thank you very much! I tried a \framed to no avail.
\framed needs a align setting to allow line breaks.
And I thought I needed my own command since I also set color and font, but style={\MyDefinedFont\WORD} actually works.
Use \setcharactercasing with style keys when you need multiple settings, it's faster than \WORD because no group check is needed.
In my other setup I already tried a \vbox, but the problem is different, I guess.
My remaining problem in this case is irregular line spacing if there are umlauts, will open a new thread.
Increase the value for the baseline distance, e.g. \defineinterlinespace[chapter][line=3.2ex] \setuphead[chapter][interlinespace=chapter] or \setuphead[chapter][style={\setupinterlinespace[line=3.2ex]}] Wolfgang
Am 2020-01-11 um 19:51 schrieb Wolfgang Schuster
Henning Hraban Ramm schrieb am 11.01.2020 um 19:38:
Thank you very much! I tried a \framed to no avail.
\framed needs a align setting to allow line breaks.
And I thought I needed my own command since I also set color and font, but style={\MyDefinedFont\WORD} actually works.
Use \setcharactercasing with style keys when you need multiple settings, it's faster than \WORD because no group check is needed.
Ok.
My remaining problem in this case is irregular line spacing if there are umlauts, will open a new thread.
Increase the value for the baseline distance, e.g.
\defineinterlinespace[chapter][line=3.2ex]
\setuphead[chapter][interlinespace=chapter]
or
\setuphead[chapter][style={\setupinterlinespace[line=3.2ex]}]
But I need to keep the line spacing, even if accents collide. E.g. \setupbodyfont[rm,20pt] \setupinterlinespace[8mm] \setuplayout[ width=10cm, %grid=yes, % different, but bad either way ] \showgrid \definefont[TitleFont][SansBold at 24pt][8mm] \def\Blindtext{Ein Anfänger der Gitarre habe Eifer. Mönsch ärgere düch nïcht! Über Állen Wípfeln ìst Ŕüh. O Tannenbaum, wie blau sind deine Nadeln.} \starttext \Blindtext \WORD{\Blindtext} {\TitleFont\Blindtext \WORD{\Blindtext}} \stoptext In my actual use case, my usual line spacing is good for the body text, and the slightly bigger section titles should keep it; there would be no visual(!) collision of accents on uppercase characters with the previous line, but ConTeXt increases the line spacing nevertheless. If I activate the grid, I get double line height only in the section titles with umlauts – quite ugly. Can’t I force the line height? Best, Hraban
Henning Hraban Ramm schrieb am 11.01.2020 um 19:59:
But I need to keep the line spacing, even if accents collide. E.g.
\setupbodyfont[rm,20pt] \setupinterlinespace[8mm] \setuplayout[ width=10cm, %grid=yes, % different, but bad either way grid=strut, ] \showgrid Wolfgang
Am 2020-01-11 um 20:05 schrieb Wolfgang Schuster
: Henning Hraban Ramm schrieb am 11.01.2020 um 19:59:
But I need to keep the line spacing, even if accents collide. E.g.
\setupbodyfont[rm,20pt] \setupinterlinespace[8mm] \setuplayout[ width=10cm, %grid=yes, % different, but bad either way grid=strut, ] \showgrid
That works in my simple example, but not in my actual project (see attached image). Besides, the setting moves my chapter titles into the topspace?? HR
Henning Hraban Ramm schrieb am 11.01.2020 um 20:11:
Am 2020-01-11 um 20:05 schrieb Wolfgang Schuster
mailto:wolfgang.schuster.lists@gmail.com>: Henning Hraban Ramm schrieb am 11.01.2020 um 19:59:
But I need to keep the line spacing, even if accents collide. E.g.
\setupbodyfont[rm,20pt] \setupinterlinespace[8mm] \setuplayout[ width=10cm, %grid=yes, % different, but bad either way grid=strut, ] \showgrid
That works in my simple example, but not in my actual project (see attached image). Besides, the setting moves my chapter titles into the topspace??
You have to create a minimal example. Wolfgang
Henning Hraban Ramm schrieb am 11.01.2020 um 20:11:
Am 2020-01-11 um 20:05 schrieb Wolfgang Schuster
mailto:wolfgang.schuster.lists@gmail.com>: Henning Hraban Ramm schrieb am 11.01.2020 um 19:59:
But I need to keep the line spacing, even if accents collide. E.g.
\setupbodyfont[rm,20pt] \setupinterlinespace[8mm] \setuplayout[ width=10cm, %grid=yes, % different, but bad either way grid=strut, ] \showgrid
That works in my simple example, but not in my actual project (see attached image). Besides, the setting moves my chapter titles into the topspace??
Add this before you set the fonts (page 156 in fonts-mkiv.pdf): \definefontfeature [default] [default] [dimensions=strut] Wolfgang
Am 2020-01-11 um 20:49 schrieb Wolfgang Schuster
That works in my simple example, but not in my actual project (see attached image). Besides, the setting moves my chapter titles into the topspace??
Add this before you set the fonts (page 156 in fonts-mkiv.pdf):
\definefontfeature [default] [default] [dimensions=strut]
Thanks, never saw that. Acutally, I had to add the feature to my feature set in use, but that fixed the line spacing issue. Thank you! Now I must construct a MWE for the "titling moving into the air" issue. Best, Hraban
participants (2)
-
Henning Hraban Ramm
-
Wolfgang Schuster