![使用表格环境对齐 Beamer 讲义中的作者姓名](https://linux22.com/image/303693/%E4%BD%BF%E7%94%A8%E8%A1%A8%E6%A0%BC%E7%8E%AF%E5%A2%83%E5%AF%B9%E9%BD%90%20Beamer%20%E8%AE%B2%E4%B9%89%E4%B8%AD%E7%9A%84%E4%BD%9C%E8%80%85%E5%A7%93%E5%90%8D.png)
考虑以下框架:
\documentclass[9pt,handout]{beamer}
\title[]{Title}
\author[]{
Author 1: "name of author 1"\\
Author 2: "name of author 2"}
\institute[]{}
\date[]{}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
问题是我想对齐作者姓名,使得两个冒号位于同一行。我尝试过这个:
\author{%
\begin{tabular}{rl}
Author 1:& "name of author 1" \tabularnewline
Author 2:& "name of author 2"
\end{tabular}}
我通过在这里问另一个问题知道了这一点,它在 Article 文档类中完全按照我的要求工作。然而,它在 Beamer 的 Handout 中不起作用。
答案1
只需将其放在里面document
而不是序言中就可以了。
梅威瑟:
\documentclass[9pt,handout]{beamer}
\begin{document}
\title[]{Title}
\author{%
\begin{tabular}{rl}
Author 1:& "name of author 1" \tabularnewline
Author 2:& "name of author 2"
\end{tabular}}
\institute[]{}
\date[]{}
\begin{frame}
\titlepage
\end{frame}
\end{document}
输出:
如果你想将该代码保留在序言中,你可以\AtBeginDocument
这样使用
\documentclass[9pt,handout]{beamer}
\AtBeginDocument{%
\title[]{Title}
\author{%
\begin{tabular}{rl}
Author 1:& "name of author 1" \tabularnewline
Author 2:& "name of author 2"
\end{tabular}}
\institute[]{}
\date[]{}
}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}