ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* uppercase section titles: no line breaking?
@ 2020-01-11 17:53 Henning Hraban Ramm
  2020-01-11 18:21 ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Henning Hraban Ramm @ 2020-01-11 17:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
%%%%%

___________________________________________________________________________________
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] 10+ messages in thread

* Re: uppercase section titles: no line breaking?
  2020-01-11 17:53 uppercase section titles: no line breaking? Henning Hraban Ramm
@ 2020-01-11 18:21 ` Wolfgang Schuster
  2020-01-11 18:38   ` Henning Hraban Ramm
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2020-01-11 18:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

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

___________________________________________________________________________________
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] 10+ messages in thread

* Re: uppercase section titles: no line breaking?
  2020-01-11 18:21 ` Wolfgang Schuster
@ 2020-01-11 18:38   ` Henning Hraban Ramm
  2020-01-11 18:51     ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Henning Hraban Ramm @ 2020-01-11 18:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 2020-01-11 um 19:21 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
> 
> 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

___________________________________________________________________________________
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] 10+ messages in thread

* Re: uppercase section titles: no line breaking?
  2020-01-11 18:38   ` Henning Hraban Ramm
@ 2020-01-11 18:51     ` Wolfgang Schuster
  2020-01-11 18:59       ` force line spacing (was: uppercase section titles: no line breaking?) Henning Hraban Ramm
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2020-01-11 18:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

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

___________________________________________________________________________________
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] 10+ messages in thread

* Re: force line spacing (was: uppercase section titles: no line breaking?)
  2020-01-11 18:51     ` Wolfgang Schuster
@ 2020-01-11 18:59       ` Henning Hraban Ramm
  2020-01-11 19:05         ` force line spacing Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Henning Hraban Ramm @ 2020-01-11 18:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2020-01-11 um 19:51 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
> 
> 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

___________________________________________________________________________________
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] 10+ messages in thread

* Re: force line spacing
  2020-01-11 18:59       ` force line spacing (was: uppercase section titles: no line breaking?) Henning Hraban Ramm
@ 2020-01-11 19:05         ` Wolfgang Schuster
  2020-01-11 19:11           ` Henning Hraban Ramm
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2020-01-11 19:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

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

___________________________________________________________________________________
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] 10+ messages in thread

* Re: force line spacing
  2020-01-11 19:05         ` force line spacing Wolfgang Schuster
@ 2020-01-11 19:11           ` Henning Hraban Ramm
  2020-01-11 19:43             ` Wolfgang Schuster
  2020-01-11 19:49             ` Wolfgang Schuster
  0 siblings, 2 replies; 10+ messages in thread
From: Henning Hraban Ramm @ 2020-01-11 19:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 571 bytes --]


> Am 2020-01-11 um 20:05 schrieb Wolfgang Schuster <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??

HR



[-- Attachment #1.2.1: Type: text/html, Size: 1340 bytes --]

[-- Attachment #1.2.2: Bildschirmfoto 2020-01-11 um 20.08.05.png --]
[-- Type: image/png, Size: 20621 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] 10+ messages in thread

* Re: force line spacing
  2020-01-11 19:11           ` Henning Hraban Ramm
@ 2020-01-11 19:43             ` Wolfgang Schuster
  2020-01-11 19:49             ` Wolfgang Schuster
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfgang Schuster @ 2020-01-11 19:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm


[-- Attachment #1.1: Type: text/plain, Size: 713 bytes --]

Henning Hraban Ramm schrieb am 11.01.2020 um 20:11:
>> Am 2020-01-11 um 20:05 schrieb Wolfgang Schuster 
>> <wolfgang.schuster.lists@gmail.com 
>> <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


[-- Attachment #1.2: Type: text/html, Size: 1487 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] 10+ messages in thread

* Re: force line spacing
  2020-01-11 19:11           ` Henning Hraban Ramm
  2020-01-11 19:43             ` Wolfgang Schuster
@ 2020-01-11 19:49             ` Wolfgang Schuster
  2020-01-11 20:07               ` Henning Hraban Ramm
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2020-01-11 19:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm


[-- Attachment #1.1: Type: text/plain, Size: 798 bytes --]

Henning Hraban Ramm schrieb am 11.01.2020 um 20:11:
>> Am 2020-01-11 um 20:05 schrieb Wolfgang Schuster 
>> <wolfgang.schuster.lists@gmail.com 
>> <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


[-- Attachment #1.2: Type: text/html, Size: 1581 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] 10+ messages in thread

* Re: force line spacing
  2020-01-11 19:49             ` Wolfgang Schuster
@ 2020-01-11 20:07               ` Henning Hraban Ramm
  0 siblings, 0 replies; 10+ messages in thread
From: Henning Hraban Ramm @ 2020-01-11 20:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2020-01-11 um 20:49 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
>> 
>> 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
___________________________________________________________________________________
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] 10+ messages in thread

end of thread, other threads:[~2020-01-11 20:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-11 17:53 uppercase section titles: no line breaking? Henning Hraban Ramm
2020-01-11 18:21 ` Wolfgang Schuster
2020-01-11 18:38   ` Henning Hraban Ramm
2020-01-11 18:51     ` Wolfgang Schuster
2020-01-11 18:59       ` force line spacing (was: uppercase section titles: no line breaking?) Henning Hraban Ramm
2020-01-11 19:05         ` force line spacing Wolfgang Schuster
2020-01-11 19:11           ` Henning Hraban Ramm
2020-01-11 19:43             ` Wolfgang Schuster
2020-01-11 19:49             ` Wolfgang Schuster
2020-01-11 20:07               ` Henning Hraban Ramm

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).