2

As shown by the following example, a (doubled) backslash in a listing is allowed within footnotes but not within fixed footnotes:

\documentclass{article}
\usepackage{fixfoot}
\usepackage{listings}

\DeclareFixedFootnote{\foo}{\lstinline+foo+}
\newcommand{\baz}{\footnote{\lstinline+\\baz+}}
\DeclareFixedFootnote{\blah}{%
  % \lstinline+\\blah+%
}

\begin{document}
Foo\foo.

Baz\baz.

Blah\blah.
\end{document}

Indeed, if the line % \lstinline+\\blah+% is commented out, the compilation fails with the error:

! Improper alphabetic constant.
<to be read again> 
                  \protect 
l.18 Blah\blah

which is analog to the one we would get if the backslash in \lstinline+\\baz+ were not doubled.

Do you see a workaround?

0

1 Answer 1

1

This here seems to work:

\documentclass{article}
\usepackage{fixfoot}
\usepackage{listings}

\DeclareRobustCommand{\contentblah}{\lstinline+\\blah+}

\DeclareFixedFootnote{\blaha}{%
   \contentblah%
}

\DeclareFixedFootnote{\blahb}{%
   \unexpanded{\lstinline+\\blah+}
}

\begin{document}
Blah\blaha
Blah\blahb.
\end{document}

You must log in to answer this question.

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