How do I create a new Beamer environment with a verbatim environment?

狂风中的少年 提交于 2019-12-06 06:00:27

Environment definition:

\newenvironment{VerbExample}
{\example\semiverbatim}
{\endsemiverbatim\endexample}

Frame definition:

\begin{frame}[fragile]
\frametitle{Title}
\begin{VerbExample}
test test test $t$ $\\omega$
test test
\end{VerbExample}
\end{frame}

Verbatim cannot go inside \newcommand. Semiverbatim is defined by Beamer and works well with it. The three characters \ { } must be escaped as \\ \{ \}.

Source: Beamer user guide, pp. 119-120 http://www.ctan.org/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!