目前,(甚至在当前Beamer 用户指南,第 19 章)中,框架内注释的排序方式是,使用“[item]”选项的注释都会聚集在主题注释页的末尾。
有没有一种相对轻松的方法来改变这种情况,以便您可以在注释页面的中间列出所述“[item]”注释?
下面是一个 MWE,用于展示我正在寻找的内容:
\documentclass{beamer}
\setbeameroption{show notes}
\begin{document}
\begin{frame}
This is boring.
\note{I want this to be line 1\par}
\note[item]{I want this to be line 2}
\note{I want this to be line 3}
\end{frame}
\end{document}
该代码的输出(注释页)是:
最终对我有用的是:
请参阅下面所选答案以及附加的评论,以了解以下代码背后的解释。另请注意,缩进问题(根据所选答案下方的 ted_kingdom 的评论)仍然存在。
\documentclass{beamer}
\setbeameroption{show notes}
\begin{document}
\makeatletter
\def\myrenewcommand{\@ifnextchar<{\beamer@myrenewcom}{\beamer@origrenewcommand}}
\def\beamer@myrenewcom<>{\@star@or@long\beamer@myrenew@command}
\def\beamer@myrenew@command#1{%
\expandafter\def\expandafter\beamer@name\expandafter{\csname @orig\string#1\endcsname}%
\expandafter\let\beamer@name=#1\relax%
\@ifnextchar[{\beamer@@myrenewcom{#1}}{\beamer@myrenewcomnoopt
{#1}{0}}}
\def\beamer@@myrenewcom#1[#2]{\@ifnextchar[{\beamer@myrenewcomopt{#1}{#2}}{\beamer@myrenewcomnoopt{#1}{#2}}}
\long\def\beamer@myrenewcomnoopt#1#2#3{%
\ifnum#2=0\relax%
\expandafter\def\expandafter#1\expandafter{\expandafter\beamer@sortzero\expandafter{\csname beamerx@\string#1\endcsname}}%
\else
\expandafter\def\expandafter#1\expandafter{\expandafter\beamer@sort\expandafter{\csname beamerx@\string#1\endcsname}{#2}}%
\fi%
\beamer@argscount=#2\relax%
\advance\beamer@argscount by 1\relax%
\expandafter\renewcommand\csname beamerx@\string#1\endcsname[\beamer@argscount]{#3}%
}
\long\def\beamer@myrenewcomopt#1#2[#3]#4{%
\expandafter\def\expandafter#1\expandafter{\expandafter\beamer@presort\expandafter{\csname beamerx@\string#1\endcsname}{#2}{#3}}%
\beamer@argscount=#2\relax%
\advance\beamer@argscount by 1\relax%
\expandafter\renewcommand\csname beamerx@\string#1\endcsname[\beamer@argscount]{#4}%
}
\makeatletter
\myrenewcommand<>{\beamer@inframenote}[2][]{%
\ifbeamer@inlecture%
\only#3{%
\def\beamer@temp{#1}%
\ifx\beamer@temp\beamer@itemtext%
\expandafter\gdef\expandafter\beamer@notes%
\expandafter{\beamer@notes\par\hskip30pt$\bullet$\hskip10pt#2\par}%
\else
\expandafter\gdef\expandafter\beamer@notes%
\expandafter{\beamer@notes#2\par}
\fi%
}%
\fi%
}
\begin{frame}
This is boring.
\note{I want this to be line 1}
\note[item]{I want this to be line 2}
\note[item]{I want this to be line 3}
\note{I want this to be line 4}
\note{I want this to be line 5}
\note[item]{I want this to be line 6}
\note[item]{I want this to be line 7}
\note{I want this to be line 8}
\note{I want this to be line 9}
\note[item]{I want this to be line 10}
\end{frame}
\end{document}
答案1
一个最小的工作示例
\documentclass{beamer}
\setbeameroption{show notes}
\begin{document}
\makeatletter
\renewcommand<>{\beamer@inframenote}[2][]{%
\ifbeamer@inlecture%
\only#3{%
\def\beamer@temp{#1}%
\ifx\beamer@temp\beamer@itemtext%
\expandafter\gdef\expandafter\beamer@notes%
\expandafter{\beamer@notes\par\hskip30pt$\bullet$\hskip10pt#2\par}%
\else
\expandafter\gdef\expandafter\beamer@notes%
\expandafter{\beamer@notes#2}%
\fi%
}%
\fi%
}
\begin{frame}
This is boring.
\note{I want this to be line 1}
\note[item]{I want this to be line 2}
\note[item]{I want this to be line 3}
\note{I want this to be line 4}
\note{I want this to be line 5}
\note[item]{I want this to be line 6}
\note[item]{I want this to be line 7}
\note{I want this to be line 8}
\note{I want this to be line 9}
\note[item]{I want this to be line 10}
\end{frame}
\end{document}