Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm rigging up some code so that I get the references cited on a slide displayed directly in the footline of my beamer presentation, and I've run into an error that mystifies me. The code I have (which works) is this:

\def\framerefs{}
\def\interframerefs{}
\def\clearframerefs{\gdef\framerefs{}\gdef\interframerefs{}}

\def\cite#1{\xdef\framerefs{\framerefs\interframerefs#1}\gdef\interframerefs{~}}
\defbeamertemplate{footline}{footline refs}{
    \hbox{\begin{beamercolorbox}[wd=\paperwidth,dp=1ex]{refs in foot}%
        \framerefs
    \end{beamercolorbox}}%
    \clearframerefs
}
\setbeamerfont{footline}{size=\normalsize}
\setbeamertemplate{footline}[footline refs]

But if I want each reference on a separate line, and change \cite to be:

\def\cite#1{\xdef\framerefs{\framerefs\interframerefs#1}\gdef\interframerefs{\\}}

The compilation fails with a capacity exceeded error:

! TeX capacity exceeded, sorry [main memory size=3000000].
<argument> ...le }\framesubtitle }\framesubtitle }
                                                  \framesubtitle }\framesubt...

I find it a bit odd that having a space be the separator works fine but newlines explode (same thing happens with \newline). Does someone know what's wrong (or a better way to do the newline-separated list thing I want to do?

share|improve this question

1 Answer 1

up vote 2 down vote accepted
\xdef\framerefs{\framerefs\interframerefs#1}

is an accident waiting to happen.

Try

 \protected@xdef\framerefs{\framerefs\interframerefs#1}

or safer

 \g@addto@macro\framerefs{\interframerefs#1}

(Untested as no runnable example supplied)

share|improve this answer
    
\protected@xdef did the trick. \def\cite#1{\g@addto@macro\framerefs{\interframerefs#1}\gdef\interframerefs{\\}}‌​ seems to have different semantics, as with that I get a \newline before the first cite (which LaTeX complains about: "There's no line here to end."). Thanks for the help! –  arnsholt Oct 15 '12 at 16:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.