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

Ingmar
  • 6,690
  • 5
  • 26
  • 47

1 Answers1

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}