5

I use the quoting package to set quoting in my master thesis. In the following MWE a found a strange bug.

\documentclass[12pt,a4paper]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{quoting}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{quoting}[font={small}]
\blindtext
\end{quoting}
\blindtext

\chapter{Test}
\blindtext
\begin{quoting}[font={small}]
\blindtext
\end{quoting}
\blindtext
\end{document}

The code produces the error

\do undefined. \begin{quoting}[font={small}]

When the font={small} is set as a package option, the error doesn't occur.

How can i fix it?

The MWE in writelatex.com

1 Answer 1

5

\do is a “scratch” control sequence, that's used in many places in the internal macros of LaTeX.

Usually it has a definition, which nobody should rely on, at the beginning of a document, but this doesn't happen when the class is scrreprt; the problem is that typearea.sty says, at line 206, \let\do\relax.

Unfortunately, quoting does \renewcommand*{\do}{...} and, with the setting left by typearea, this is illegal.

The only way to get around this is to redefine a couple of keys in quoting:

\documentclass[12pt,a4paper]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{quoting}
\makeatletter
\define@key{quo}{font}{%
  \def\quotingfont{}%
  \def\do##1{\appto{\quotingfont}{\csname ##1\endcsname}}%
  \docsvlist{#1}%
}
\define@key{quo}{font+}{%
  \def\do##1{\appto{\quotingfont}{\csname ##1\endcsname}}%
  \docsvlist{#1}%
}
\makeatother


\usepackage{blindtext}

\begin{document}
\blindtext
\begin{quoting}[font={small}]
\blindtext
\end{quoting}
\blindtext

\chapter{Test}
\blindtext
\begin{quoting}[font={small}]
\blindtext
\end{quoting}
\blindtext
\end{document}

so that whether \do is defined or not becomes unimportant. Instead of using \def one could use

\define@key{quo}{font}{%
  \def\quotingfont{}%
  \providecommand{\do}{}%
  \renewcommand*{\do}[1]{\appto{\quotingfont}{\csname ##1\endcsname}}%
  \docsvlist{#1}%
}

but, since \do is going to be redefined anyway, using \def is easier.

Please, make a bug report to Thomas Tietze (aka as Lockstep).

1
  • Many thanks -- I included your fix in the upcoming version 0.1c.
    – lockstep
    Jan 28, 2014 at 12:49

You must log in to answer this question.

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