我想将页脚中的某个元素与框架内容左对齐。我尝试过\Gm@lmargin
各种方法,但总是出现“未定义控制序列”错误。下面是我尝试过的方法的一个例子。
\documentclass{beamer}
\title{Sample Presentation}
\defbeamertemplate*{footline}{custom}[1][]
{
\begin{beamercolorbox}{footline}
\hspace{\Gm@lmargin} % Gives me "undefined control sequence"
This text should be left aligned with the frame contents
THIS WILL BE A GRAPHIC THAT SPANS THE WIDTH OF THE WHOLE PAGE
\end{beamercolorbox}
}
\begin{document}
\begin{frame}{My frame title}
Lorem ipsum dolor sit amet, and so on and so forth.
\end{frame}
\end{document}
我尝试查看一些模板如何使用这个变量,但我发现的例子很难理解。
答案1
\gm@lmargin
包含一个@
符号,这意味着您需要将模板的定义括在里面\makeatletter ... \makeatother
,请参阅问题最顶部的链接问题以了解原因(并且在 之后有一个空格太多\hspace
):
\documentclass{beamer}
\title{Sample Presentation}
\makeatletter
\defbeamertemplate*{footline}{custom}[1][]
{
\begin{beamercolorbox}{footline}
\hspace{\Gm@lmargin}% Gives me "undefined control sequence"
This text should be left aligned with the frame contents
THIS WILL BE A GRAPHIC THAT SPANS THE WIDTH OF THE WHOLE PAGE
\end{beamercolorbox}
}
\makeatother
\begin{document}
\begin{frame}{My frame title}
Lorem ipsum dolor sit amet, and so on and so forth.
\end{frame}
\end{document}