
我正在嘗試使用創建海報beamerposter
。執行此操作時,整個文件由一個框架和多個列組成。我想避免這樣做:
\begin{document}
\begin{frame}
\begin{columns}[t]
\begin{column}{0.325\paperwidth}
...
\end{column}
...
\end{columns}
\end{frame}
\end{document}
並想在序言/樣式文件中進行設置,以便我可以執行以下操作:
\begin{document}
\begin{column}{0.325\paperwidth}
...
\end{column}
...
\end{document}
我已經能夠使用以下程式碼將整個文件包裝在框架環境中這裡,但是嘗試新增列環境會導致錯誤File ended while scanning use of \frame.
這是不起作用的,這似乎是上面連結中程式碼邏輯的最小擴展:
\documentclass{beamer}
\usepackage{etoolbox}
\AfterEndPreamble{\begin{frame}\begin{columns}[t]}
\let\myenddocument\enddocument
\def\enddocument{\end{columns}\end{frame}\myenddocument}
\begin{document}
\begin{column}{0.5\textwidth}
test
\end{column}
\end{document}
從序言中刪除columns
內容並將其添加到文件中是可行的:
\documentclass{beamer}
\usepackage{etoolbox}
\AfterEndPreamble{\begin{frame}}
\let\myenddocument\enddocument
\def\enddocument{\end{frame}\myenddocument}
\begin{document}
\begin{columns}[t]
\begin{column}{0.5\textwidth}
test
\end{column}
\end{columns}
\end{document}