24

I’m experiencing problems using the csquotes package and microtype using protrusion (margin kerning). The problem is that using \enquote I only get margin kerning on the left margin.

\documentclass{minimal}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[tracking]{microtype}

\usepackage{csquotes}
\MakeAutoQuote{»}{«}

\begin{document}
\def\blindtext{Dies hier ist ein Blindtext zum Testen, Testen, Testen und Testen von Textausgaben und anderen Zeichen}

\noindent%
„\blindtext.“ \blindtext{} in mehreren Zeilen.\\
\enquote{\blindtext.} \blindtext{} in mehreren Zeilen.\\
»\blindtext.« \blindtext{} in mehreren Zeilen.\\
\end{document}

The first text uses manually set quotation marks which give margin kerning both left and right.

The second and third text snipped only protrude on the left margin.

Any ideas why I have this problem and how I can possibly solve it?

David Carlisle
  • 757,742
Debilski
  • 1,341

1 Answers1

19

I'd regard this as a bug in csquotes. You can solve it by putting the following code into your preamble, but I can't say if this breaks other things.

\makeatletter
\def\csq@qclose@ii#1{%
  \ifdim\lastkern=\csq@omitmarker
    #1\csq@eqgroup
  \else
    \csq@addkern@close
    \ifodd\csq@qlevel
      \csq@thequote@oclose
      \let\csq@kernchar@i\csq@thequote@oclose
    \else
      \csq@thequote@iclose
      \let\csq@kernchar@i\csq@thequote@iclose
    \fi
    %\csq@setmarker@close                 %%% Here's the change; line commented out
    \ifblank{#1}{}{\expandafter#1}%
    \expandafter\csq@eqgroup
      \expandafter\def
      \expandafter\csq@kernchar@i
      \expandafter{\csq@kernchar@i}%
    \expandafter\csq@fixkern
  \fi}
\makeatother

This works with the most recent version of csquotes. As always, when you hack into the macros of a package, there's no guarantee that the above code works with past or future versions.

Hendrik Vogt
  • 37,935
  • Thanks. But this seems to only work with the latest updates in TexLive 2010. – Debilski Mar 08 '11 at 17:16
  • 1
    @Debilski: Thanks for letting me know. I've added a word of caution to the answer. – Hendrik Vogt Mar 08 '11 at 19:26
  • 1
    However, there is a \def\csq@qclose@i in earlier versions with almost the same code (except that it takes no argument). Patching that one works as well. Bad thing is that newer versions have both \csq@qclose@ii and \csq@qclose@i (which looks rather different) so one definitely has to be careful to patch the correct one. – Debilski Mar 08 '11 at 20:13
  • @Debilski: I have no idea if you'd also have to patch the other one. I just tried to make the code from your question produce the desired result; I'm not sure if there are more "margin bugs". – Hendrik Vogt Mar 08 '11 at 20:16
  • 6
    @Debilski, it may be a good idea to drop an email to Philipp, to let him know of this issue (or post on comp.text.tex and email him). – Meho R. Mar 08 '11 at 20:25
  • Done.​​​​​​​​​​ – Debilski Mar 09 '11 at 11:18
  • 2
    Ok, so Philipp has answered and said that the marker is needed for some features and that there might not be a way to fix this in csquotes. – Debilski Mar 14 '11 at 09:53
  • 5
    @Debilski: Hmm, now I would be interested what it is needed for. What I'd recommend in the present situation: If it really happens that you've got a closing quote at the end of a line, then as a final change in the document use my code locally so that it only affects that quote. If you don't know how to do that, you could ask a new question here. – Hendrik Vogt Mar 14 '11 at 10:30
  • @HendrikVogt: Is this issue still valid in 2017? – Hotschke Mar 27 '17 at 10:00
  • 1
    @Hotschke: I just came here to ask this question in 2018! So we still have the problem. Workaround can also be condensed to \renewcommand*{\csq@setmarker@close}{}. – gnucchi Jun 29 '18 at 18:45
  • 1
    Emptying both \csq@setmarker@close and \csq@setmarker@open will also enable kerning with both quotes. I guess what we are disabling could be related to neighboring quotation marks and french auto spacing? – gnucchi Jun 29 '18 at 19:30