From d92622ba3cae5ced69a256472d367a53fc5878a1 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 16 May 2021 21:33:32 +0200 Subject: LaTeX template: define commands for zero width non-joiner character Closes: #6639 The zero-width non-joiner character is used to avoid ligatures (e.g. in German). --- data/templates/default.latex | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'data') diff --git a/data/templates/default.latex b/data/templates/default.latex index 142fe3e55..04784b971 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -156,6 +156,25 @@ $if(CJKmainfont)$ \fi $endif$ \fi +$if(zero-width-non-joiner)$ +%% Support for zero-width non-joiner characters. +\makeatletter +\def\zerowidthnonjoiner{% + % Prevent ligatures and adjust kerning, but still support hyphenating. + \texorpdfstring{% + \textormath{\nobreak\discretionary{-}{}{\kern.03em}% + \ifvmode\else\nobreak\hskip\z@skip\fi}{}% + }{}% +} +\makeatother +\ifPDFTeX + \DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner} +\else + \catcode`^^^^200c=\active + \protected\def ^^^^200c{\zerowidthnonjoiner} +\fi +%% End of ZWNJ support +$endif$ $if(beamer)$ $if(theme)$ \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} -- cgit v1.2.3