我想在投影仪幻灯片中包含一条从徽标到幻灯片右边距的规则。
但是,当我增加规则的宽度时,规则会发送到图像下方,而不是继续向右边缘移动。当我将规则宽度从 10 厘米更改为 11.6 厘米以上的值时,下面的 MWE 中就会发生这种情况。我希望规则延伸到幻灯片的右边缘。谢谢。
梅威瑟:
\documentclass[t,aspectratio=169]{beamer}
\setbeamertemplate{navigation symbols}{}
\begin{document}
\begin{frame}
\frametitle{Title}
{\centering {\LARGE Some text}\par}
\ \par
The first line does not extend until the right margin of the slide.
How can I extend it until the right margin?
\vskip0pt plus 1filll
\includegraphics[scale=0.2]{example-image-a} \rule{11.6cm}{2.2mm}
\rule{\paperwidth}{2.2mm}
\end{frame}
\end{document}
答案1
您可以将图像和规则放入跨越整个纸张宽度而不仅仅是文本宽度的某个元素中。
例如,这样的元素可以是列环境或脚线。
带脚线的示例:
\documentclass[t,aspectratio=169]{beamer}
\setbeamertemplate{navigation symbols}{}
\begin{document}
{
\setbeamertemplate{footline}{%
\mbox{}%
\hspace{1cm}%
\includegraphics[width=2.5cm]{example-image-a}\rule{\dimexpr\paperwidth-2.5cm-1cm}{2.2mm}%
\vskip0.5cm
}
\begin{frame}
\frametitle{Title}
{\centering {\LARGE Some text\par}}
\ \par
The first line does not extend until the right margin of the slide.
How can I extend it until the right margin?
\end{frame}
}
\end{document}
带列的示例:
\documentclass[t,aspectratio=169]{beamer}
\setbeamertemplate{navigation symbols}{}
\begin{document}
\begin{frame}
\frametitle{Title}
{\centering {\LARGE Some text\par}}
\ \par
The first line does not extend until the right margin of the slide.
How can I extend it until the right margin?
\begin{columns}
\begin{column}{\paperwidth}
\mbox{}%
\hspace{1cm}%
\includegraphics[width=2.5cm]{example-image-a}\rule{\dimexpr\paperwidth-2.5cm-1cm}{2.2mm}%
\end{column}
\end{columns}
\end{frame}
\end{document}