Latex:文本应自动填充 Beamer 幻灯片中的框架

发布于 2024-09-09 02:04:39 字数 182 浏览 3 评论 0原文

在投影仪框架中,我希望内容均匀地分布在框架上。

使用选项 \documentclass[slidestop]{beamer} 我可以轻松地将内容指定为顶部/中心对齐,但是当我幻灯片上只有几个项目符号时,它们会聚集在顶部,我希望投影仪自动决定它们之间的间距使它们均匀分布。

如果不通过反复试验放置vspace,这可能吗?

In beamer frames I want the contents to be spread out evenly across the frame.

Using option \documentclass[slidestop]{beamer} I can easily specify the contents to be top/center aligned but when I have only few bullets on a slide they get clustered together at the top, I want beamer to decide the spacing between them automatically to spread them evenly.

Is this possible without putting vspace by trial and error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

网名女生简单气质 2024-09-16 02:04:39

我认为使用 \vfill 会减少试错部分。每个项目符号之间的一个 \vfill 应保证间距均匀。尝试在项目符号之前和/或之后使用 \vfill 来与前面的文本或页面底部分开。我不使用也不了解 Beamer,但我怀疑有一种方法可以将 \vfill 命令放入 Beamer 模板中。

\documentclass{article}
\begin{document}
\begin{itemize}
\vfill\item This is text of first item
\vfill\item This is text of second item
\vfill\item This is text of third item
\end{itemize}
\end{document}

根据您的评论,您可以将 vfill 定义为在主列表项中自动使用,但在子项中没有 vfill 的一种方法。这种方式允许您使用相同的 \item 命令,无论您是在主列表中还是在嵌套列表中,但需要您定义或重新定义环境,并注意何时添加主(即 vfilled)列表当您添加非填充(即嵌套)列表时:

\documentclass{article}

\newenvironment{novfillenum}{\begin{enumerate}\let\item\olditem}%
{\end{enumerate}}
\newenvironment{vfilleditems}{\begin{itemize} \let\olditem\item \renewcommand\item{\vfill\olditem}}%
{\end{itemize}}

\begin{document}
\begin{vfilleditems}
\item Item One 
   \begin{novfillenum}
        \item subitem1
        \item s2
        \item s3
    \end{novfillenum}
\item Item Two 
   \begin{novfillenum}
        \item subitem1
        \item s2
        \item s3
    \end{novfillenum}
\item item three
   \begin{novfillenum}
        \item subitem1
        \item s2
        \item s3
    \end{novfillenum}
\end{vfilleditems}

\end{document}

I think using \vfill would reduce the trial and error part. One \vfill between each bullet should guarantee even spacing. Try \vfill before and/or after bullets to get separation from preceding text or from bottom of page. I don't use or know Beamer, but I suspect there's a way to put the \vfill commands into the Beamer template.

\documentclass{article}
\begin{document}
\begin{itemize}
\vfill\item This is text of first item
\vfill\item This is text of second item
\vfill\item This is text of third item
\end{itemize}
\end{document}

Per your comment, here's one way you could define vfill to be automatically used in main list items but have no vfill in subitems. THis way lets you use same \item command regardless of whether you're in main list or in nested list, but requires you to define or redefine environments, and to be aware of when you're adding a main (i.e, vfilled) list and when you're adding a non-vfilled (i.e, nested) list:

\documentclass{article}

\newenvironment{novfillenum}{\begin{enumerate}\let\item\olditem}%
{\end{enumerate}}
\newenvironment{vfilleditems}{\begin{itemize} \let\olditem\item \renewcommand\item{\vfill\olditem}}%
{\end{itemize}}

\begin{document}
\begin{vfilleditems}
\item Item One 
   \begin{novfillenum}
        \item subitem1
        \item s2
        \item s3
    \end{novfillenum}
\item Item Two 
   \begin{novfillenum}
        \item subitem1
        \item s2
        \item s3
    \end{novfillenum}
\item item three
   \begin{novfillenum}
        \item subitem1
        \item s2
        \item s3
    \end{novfillenum}
\end{vfilleditems}

\end{document}
_蜘蛛 2024-09-16 02:04:39

此处添加另一个示例,因为第一个答案变得太拥挤。测试了更改标签命令,你知道吗,它似乎有效。不过,它会给出错误,我确信这与将 \vfill 作为标签构造的一部分有关。我很惊讶它似乎确实创建了所需的输出,但该方法需要一些调整才能使其正常工作:

\begin{document}

\let\oldlabelitemi\labelitemi
\renewcommand{\labelitemi}{\vfill\oldlabelitemi{\hspace{1ex}}}

\begin{itemize}

\item Item One 
    \begin{itemize}
    \item subone
    \item subtwo
    \item subthree
    \end{itemize}
\item Item Two 
   \begin{itemize}
        \item subitem1
        \item s2
        \item s3
    \end{itemize}
\item item three
   \begin{itemize}
        \item subitem1
        \item s2
        \item s3
    \end{itemize}
\end{itemize}

\end{document}

Adding another sample here because first answer getting too crowded. Tested altering the label commands and, what do you know, it seems to work, sort of. It gives errors, though, which I'm sure are related to having the \vfill as part of the label construct. I'm surprised it does seem to create the desired output, but the method would need some tweaking to get it to work without errors:

\begin{document}

\let\oldlabelitemi\labelitemi
\renewcommand{\labelitemi}{\vfill\oldlabelitemi{\hspace{1ex}}}

\begin{itemize}

\item Item One 
    \begin{itemize}
    \item subone
    \item subtwo
    \item subthree
    \end{itemize}
\item Item Two 
   \begin{itemize}
        \item subitem1
        \item s2
        \item s3
    \end{itemize}
\item item three
   \begin{itemize}
        \item subitem1
        \item s2
        \item s3
    \end{itemize}
\end{itemize}

\end{document}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文