Commits

Joseph Wright committed 6db5df0

Sanitize first token of frame when reading verbatim (fixes #93)

  • Participants
  • Parent commits f39336a

Comments (0)

Files changed (2)

File base/beamerbaseframe.sty

   \immediate\openout\beamer@verbatimfileout=\beamer@verbfilename%
   \expandafter\beamer@checktitleverbatim\@gobble}
 \def\beamer@checktitleverbatim{\@ifnextchar\bgroup{\beamer@verbatim@frametitle}{\beamer@verbatimreadframe}}
-\def\beamer@verbatim@frametitle#1{\@ifnextchar\bgroup{\beamer@verbatim@framesubtitle{#1}}{\beamer@verbatimreadframe\frametitle{#1}}}
+\def\beamer@verbatim@frametitle#1{%
+  \@ifnextchar\bgroup{\beamer@verbatim@framesubtitle{#1}}
+  {%
+    \@temptokena{#1}%
+    \edef\@tempa{\string\frametitle\string{\the\@temptokena\string}}%
+    \@temptokena\expandafter{\@tempa}%
+    \immediate\write\beamer@verbatimfileout{\the\@temptokena}%
+    \beamer@verbatimreadframe
+  }%
+}
 \def\beamer@verbatim@framesubtitle#1#2{\beamer@verbatimreadframe\frametitle{#1}\framesubtitle{#2}}
 % will return to following command with frame contents written to \beamer@verbfilename
 \def\beamer@afterexternalframe{%

File base/beamerbaseverbatim.sty

 }
 
 {\catcode`\^^M=12\endlinechar=-1%
-  \long\gdef\beamer@processframefirstline#1^^M{%
-    \def\beamer@test{#1}%
+  \long\gdef\beamer@processframefirstline#1#2^^M{%
+    \def\beamer@test{#1#2}%
     \ifx\beamer@test\beamer@stopframefirst%
       \let\next=\beamer@framewritten%
     \else
-      \@temptokena={#1}%
-      \immediate\write\beamer@verbatimfileout{\the\@temptokena}%
-      \let\next=\beamer@processframeline%
+      \def\beamer@test{#1}%
+      \@onelevel@sanitize\beamer@test
+      \edef\beamer@test{\beamer@test\space}%
+      \edef\beamer@test{\expandafter\zap@space\beamer@test\@empty}%
+      \@temptokena{#2}%
+      \immediate\write\beamer@verbatimfileout{\beamer@test\the\@temptokena}%
+       \let\next=\beamer@processframeline%
     \fi%
     \next%
   }