5

This problem was fixed in beamer v3.37, if you still experience this problem try to update to a recent version of beamer

Suddenly I am no longer able to indent \end{frame} for slides with the fragile option, e.g.

\documentclass{beamer}

\begin{document}

    \begin{frame}[fragile]
        test
    \end{frame}

\end{document}

does not work but gives the error File ended while scanning use of \next.


Comparing the logfiles to previous presentations showed different versions of the beamer package and taking a look at recent changes made I think I was able to pinpoint the responsible commit to 2e946022 where

\beamer@makeinnocent\^^I % Allow tab chars

was added to the package.

As I understand this allows the usage of tabs in listings. While this might be helpful for people who actually use tabs inside listings it breaks backwards compatibility with many of my presentations and, to be honest, I like the ability to indent code, because it make it easier to read for me.


Question:

Long story short: Can I somehow revert this locally? Preferably without hacking my local LaTeX distribution so that the fix will survive further updates?

  • 1
    Don't indent \begin{frame} and \end{frame}. That's all. By the way, I see no purpose in indenting the whole document. – egreg Mar 24 '15 at 10:45
  • @egreg: Thanks for your quick reply. I am aware that not indenting would solve the issue, but I hope someone will come up with another solution, so that I do not have to change all my old presentations – user36296 Mar 24 '15 at 10:50
  • is your actual document indented with tabs (the code above indents with space) – David Carlisle Mar 24 '15 at 11:03
  • @DavidCarlisle: I use tabs, but I have the same problem if using spaces – user36296 Mar 24 '15 at 11:05
6

It looks like you pinpointed exactly what caused the change, this works (using tab for indent)

\documentclass{beamer}
\makeatletter
\def\beamer@verbatimreadframe{%
  \begingroup%
  \let\do\beamer@makeinnocent\dospecials%
  \count@=127%
  \@whilenum\count@<255 \do{%
    \advance\count@ by 1%
    \catcode\count@=11%
  }%
  \beamer@makeinnocent\^^L% and whatever other special cases
% \beamer@makeinnocent\^^I % Allow tab chars
  \endlinechar`\^^M \catcode`\^^M=12%
  \@ifnextchar\bgroup{\afterassignment\beamer@specialprocessframefirstline\let\beamer@temp=}{\beamer@processframefirstline}}%


\begin{document}

    \begin{frame}[fragile]
        test
    \end{frame}

\end{document}

You probably don't want to put that into your old presentations but if you put a copy of beamerbaseverbatim.sty into the same directory as your presentation and comment out the line you highlighted, indenting with tabs will work (although it's probably not a good idea going forward)

  • Thanks for your answer! Both your suggestions work fine and especially simply putting a modified beamerbaseverbatim.sty in the old folders works great! – user36296 Mar 24 '15 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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