[NTG-context] Left hanging hyphen

Tomas Hala tomas.hala at mendelu.cz
Wed Mar 4 19:28:49 CET 2020

Hi Wolfgang,

Mon, Mar 02, 2020 ve 05:38:35PM +0100 Wolfgang Schuster napsal(a):
# On Mon, 2 Mar 2020 12:22:26 +0100
# Tomas Hala <tomas.hala at mendelu.cz> wrote:
# > Hi all,
# > 
# > in composed words in Czech and Slovak languages, the hyphen must be repeated 
# > at the beginning of the new line. How can I make it hanging at the left margin?
# 1. You have to enable hanging punctuation which is missing in your example.

I used it, it was a miscopying... sorry.
# 2. You have to create your own protrusion vector because the predefined vectors set hanging for hyphens only for the right margin.

Thanks, it works for Czech language. But what has happened is that the
repeated hyphen appears also with languages which do not use it (or for
which it has not been set).

How can I assign the definition only to the selected language?
(I discovered only to put {\mainlanguage[cz]text} into a group...)

%% only a note:
I tried:
\def\mylanguage{cs} \appendtoks \ifx\mylanguage\currentlanguage \setbreakpoints[czcompound] \else \resetbreakpoints \fi \to\everylanguage


which repeats only the Czech hyphen but with a side effect -- hyphenated words are not broken anymore in other languages.
What am I doing wrong? Or is there any system solution?

Best wishes,


%%%% begin example


fonts.protrusions.classes.tomas_hala = {
    vector = 'tomas_hala',
    factor = 1,

fonts.protrusions.vectors.tomas_hala = table.merged (
        [0x002D] = { 0.4, 0.7 }, -- hyphen


\definebreakpoints [czcompound]
\definebreakpoint [czcompound] [-] [nleft=3,nright=3,type=4]

\startsetups [czech]
  \setbreakpoints [czcompound]


\definefontfeature [default] [default] [protrusion=tomas_hala]

%\def\mylanguage{cs} \appendtoks \ifx\mylanguage\currentlanguage \setbreakpoints[czcompound] \else \resetbreakpoints \fi \to\everylanguage
%\def\mylanguage{sk} \appendtoks \ifx\mylanguage\currentlanguage \setbreakpoints[czcompound] \else \resetbreakpoints \fi \to\everylanguage
%  \ORIGmainlanguage[\langpar]

\setupalign [hanging]

%\mainlanguage [cz]

\showframe [text] [text]



\mainlanguage [en]

\mainlanguage [fr]

\mainlanguage [cz]

\mainlanguage [en]

\mainlanguage [fr]

%%%% end example

More information about the ntg-context mailing list