
어떤 이유로 내beamer
\newcommand
프레젠테이션이 환경 내에 배치 되면 컴파일되지 않습니다 frame
. 다음은 최소한의 작업 예입니다.
\documentclass{beamer}
\begin{document}
\begin{frame}{First slide}
\newcommand{\asdf}[1]{What is the #1 problem?}
\end{frame}
\end{document}
다음 오류가 발생합니다.
\test 정의에 잘못된 매개변수 번호가 있습니다.
매크로 \asdf
는 정의된 후에도 사용되지 않습니다. 이상하게도 정의를 환경 외부에 배치하면 frame
모든 것이 잘 작동합니다. 이 이상한 행동의 이유는 무엇입니까?
답변1
추가하면 fragile
문제가 해결됩니다.
\documentclass{beamer}
\begin{document}
\begin{frame}[fragile]{First slide}
\newcommand{\asdf}[1]{What is the #1 problem?}
\end{frame}
\end{document}