2

I like using the the features of the csquotes package in the following manner:

\documentclass{scrbook}
\usepackage{polyglossia}
    \setdefaultlanguage[spelling=new, babelshorthands=true]{german}

\usepackage[german=guillemets]{csquotes} 
\MakeAutoQuote{>}{<}

\usepackage{libertine}
\usepackage{graphicx}

\begin{document}

>OuterQuote >InnerQuote< OuterQuote<

\end{document}

By tinkering I found that it doesn't work together with the graphicx package compiling under LuaLaTeX. I receive the following error multiple times:

c:\texlive\2016\texmf-dist\tex\context\base\mkii\supp-pdf.mkii:136: Missing = inserted for \ifnum. [... \csname newcount\endcsname \scratchcounter]

However, when I use different autoquotes, such as \MakeAutoQuote{»}{«}, or use the above code slightly altered under PDFLaTeX, it works finely again. Can somebody explain to me what the error means and why it is specifically evoked by using \MakeAutoQuote{>}{<}?

Stefan Pinnow
  • 29,535
Kubo
  • 368
  • 4
    \MakeAutoQuote makes its argument active and gives them definitions. It is very dangerous to use ascii chars like < and >. There are use in various places, and you will run in lots of problem -- also with pdflatex. Try e.g. tikz and \tikz\draw[<->] (0,0)--(1,0);. – Ulrike Fischer May 24 '17 at 15:04

1 Answers1

4

There's a simple solution to your problem. Just change the order of your package loading. Loading graphicx before csquotes helps.

quote

\documentclass{scrbook}
\usepackage{polyglossia}
    \setdefaultlanguage[spelling=new, babelshorthands=true]{german}

\usepackage{graphicx}
\usepackage[german=guillemets]{csquotes} 
\MakeAutoQuote{>}{<}

\usepackage{libertine}

\begin{document}

>OuterQuote >InnerQuote< OuterQuote<

\end{document}

Update: To address your query here's an explanation: As Ulrike Fischer already mentioned, it is always dangerous to use < and > as active characters. Try for instance

\ifnum 8<10\relax Quack\fi

This should only compare two numbers, but what it does instead is opening a quote.

The same thing happens where your error points to (you'll probably see the mistake there):

\def\@@mptopdf@@newabove\csname#1\endcsname#2% \dimen \name
      {\csname#1\endcsname#2%
       \ifnum\expandafter\@@mptopdf@@stripnewabove\meaning#2>20\else
         \@@mptopdf@@newabove\csname#1\endcsname#2%
       \fi}

\@@mptopdf@@newabove \csname newcount\endcsname \scratchcounter
TeXnician
  • 33,589