1

Kindly consider this MWE:

%!TeX program  = lualatex
\documentclass{article}

\usepackage[shorthands=off,main=ngerman,english]{babel}
\usepackage{cochineal}

\usepackage[german = guillemets]{csquotes}  
    \MakeOuterQuote{"}

% Show positive (green) and negative (red) kerning. Requires LuaLaTeX.
\usepackage{showkerning}    
\usepackage{spacekern}

\usepackage{newunicodechar}
    \newunicodechar{»}{»\kern .5pt}
    \newunicodechar{«}{\kern .5pt«}

\begin{document}
How to say “Hello, world!” in German:\medskip

"Hallo, Welt!" (\texttt{csquotes})

»Hallo, Welt!« (\texttt{manual})

\end{document}

I have a text that is in English and German. Quotation marks are handled automatically by csquotes. This works well, but unlike manually added guillemets, for which I can easily define additional kerning via newunicodechar, this does not work when they are added automatically by csquotes.

How can I add kerning to csquotes' guillemets?

enter image description here

1 Answer 1

2

An approach if you can use fontspec is changing the kerning for guillemets at font level (see How to adjust font features in LuaTeX? for details)


%!TeX program  = lualatex
\documentclass{article}

\usepackage[shorthands=off,main=ngerman,english]{babel}

\usepackage[german = guillemets]{csquotes}  
    \MakeOuterQuote{"}

\directlua{
    fonts.handlers.otf.addfeature
    {
    name = "gui", 
    type = "single", 
    data = {
      ["»"] = {0, 0, 20, 0}, % kerning after, expressed in thousandths of an em
      ["«"] = {20, 0, 0, 0}, % kerning before, expressed in thousandths of an em
    },
}
}

\usepackage{fontspec}
\setmainfont[RawFeature=+gui]{EB Garamond}

\begin{document}
How to say “Hello, world!” in German:\medskip

"Hallo, Welt!" (\texttt{csquotes})

»Hallo, Welt!« (\texttt{manual})

\end{document}
1
  • That looks promising, thanks, going to check it out. I normally use fontspec anyway …
    – Ingmar
    Jun 26, 2022 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .