在投影仪幻灯片中显示边距/框架

在投影仪幻灯片中显示边距/框架

使用常规文章/报告/...类,您可以使用showframe包来绘制页面各个区域所在的轮廓。beamer但是,我无法使用 获得相同的功能。使用geometryshowframe选项同样不起作用。

我怎样才能获得此功能beamer

梅威瑟:

\documentclass{beamer}

%\usepackage[showframe]{geometry}  % Doesn't work
\usepackage{showframe}             % Doesn't work

\begin{document}

\begin{frame}{Slide Title}
\centering
Centered Text
\end{frame}

\end{document}

编辑:

有人提出了类似的问题这里要求绘制一个图表来描述页面的布局,并给出各种参数的长度。\layout当应用于 MWE 时,该包会给出以下输出:

布局

虽然此输出提供了边距信息和一般布局信息,但它并没有提供我想要的视觉输出,因为方框会覆盖在我自己的内容上。我对查看边距和其他长度的值不太感兴趣,我更感兴趣的是可视化幻灯片上我自己的内容的适合程度,以及查看方框实际上与内容的接近程度。这就是为什么我希望功能更接近该showframe软件包所提供的功能。

答案1

我申请了beamer答案在具有不同布局的文档集中显示布局标记,它提供了您寻找的一些信息。它为主文本块、边距块、页眉块和页脚块添加了阴影。

但是,投影仪框架位于底层页面尺寸之上,因此框架标题之类的内容不会被普通页面文本块捕获。此外,诸如 之类的操作\marginpar可以在 中完成beamer,但不能在 内完成frame。最后,有些页面尺寸(例如 )\textheight无法在前言中设置,否则会被立即覆盖。有趣的是,我发现当 不在 中时framebeamer会分页并将剩余文本移动到下一页(在 内不会执行此操作frame)。

\documentclass{beamer}
\usepackage{everypage}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{calc}
\usepackage{fancyhdr}
\pagestyle{fancy}
% In beamer, these changes can be made in the preamble
\addtolength{\topmargin}{1pt}
\addtolength{\headsep}{5pt}
\addtolength{\oddsidemargin}{-4pt}
\addtolength{\marginparwidth}{20pt}
\addtolength{\marginparsep}{-3pt}
\addtolength{\textwidth}{-5pt}
%
\fancyhf{}
\fancyhead[C]{This is also a header test}
\fancyfoot[C]{This is also a footer test}
\AddEverypageHook{\hbox{\color{blue!40}\smash{\hspace{\oddsidemargin}%
  \rule[-\textheight-\headsep-\headheight-\topmargin]{\textwidth}{\textheight}%
}}}
\AddEverypageHook{\hbox{\color{blue!30}\smash{\hspace{\oddsidemargin}%
  \rule[-\headheight-\topmargin]{\textwidth}{\headheight}%
}}}
\AddEverypageHook{\hbox{\color{blue!20}\smash{\hspace{\oddsidemargin}%
  \rule[-\textheight-\headsep-\headheight-\topmargin-\footskip]{\textwidth}{\headheight}%
}}}
\AddEverypageHook{\hbox{\color{blue!10}\smash{\hspace{\oddsidemargin}%
  \hspace{\textwidth}\hspace{\marginparsep}%
  \rule[-\textheight-\headsep-\headheight-\topmargin]{\marginparwidth}{\textheight}%
}}}
\begin{document}
% In beamer, these changes have no effect in preamble
\addtolength{\textheight}{-40pt}
\addtolength{\headheight}{15pt}
\addtolength{\footskip}{15pt}
%
\begin{frame}{title of the slide}
\lipsum[3]
\end{frame}
\clearpage
\lipsum[3]\marginpar{this is a margin test}

\end{document}

这是框架内的幻灯片:

在此处输入图片描述

这是下一张幻灯片,不在框架内:

在此处输入图片描述

已编辑,以考虑 2018.12.01 TeX 内核的改变\smash

相关内容