【问题标题】:citation, tables and equation exceed page width in beamer引文、表格和方程式超出投影仪中的页面宽度
【发布时间】:2020-11-04 14:55:01
【问题描述】:

我是第一次使用 Latex,我正在使用“投影仪”准备幻灯片。发生的事情是我的一些引文、表格和长方程超出了文本宽度,尽管当文档类是“文章”时这不是问题。我的表并不长,因为其中一张只有 3 行 6 列。

乳胶代码是

    \documentclass[9pt]{beamer}
\mode<presentation> {
\usefonttheme{serif}
\usetheme{Madrid}
\definecolor{BlueGreen}{cmyk}{0.85,0,0.33,0}
\colorlet{beamer@blendedblue}{BlueGreen!120}}

\usepackage{booktabs} 

\usepackage{caption}


\hypersetup{pdfnewwindow}
\setbeamertemplate{caption}[numbered]
\setbeamerfont{frametitle}{size=\footnotesize}
\setbeamertemplate{navigation symbols}{}
\setbeamercolor{postit}{bg=violet!110}
\usepackage{ragged2e}   %new code

\addtobeamertemplate{block begin}{}{\justifying} 



\usepackage{textpos}


\begin{document}

\begin{frame} \frametitle{\textbf{{\Large Objective}}}
    \begin{itemize}
        \justifying
            \item This package gives you easy access to the Lorem Ipsum dummy text; an option is available to separate the paragraphs of the dummy text. This text \cite{kumar2015method}.
        
        \item The long equation is: 
        \begin{equation} 
        A(\theta,\alpha) = \dfrac{ A*{-(\alpha*A)}\beta*{(\delta-1)} \left(A* \hspace{1mm}\hspace{1mm}C^{-A Z_{H}} \hspace{1mm}C^{-C^{-A *Z_{H}}} \prod_{i=1}^{m-1} \left( \dfrac{ A \hspace{1mm}C^{-A* Z_{u(i)}} C^{-C^{-A* Z_{u(i)}}}}{1- \frac{1}{C-1} (C^{1-C^{-A  Z_{u(i)}}}-1)}\right) \right) }{ \int_{0}^{\infty} C^{-(\alpha *A)}(A^{(\beta-1)} \left( A* \hspace{1mm}\hspace{1mm}C^{-A Z_{H}} \hspace{1mm}C^{-C^{-A Z_{H}}} \prod_{i=1}^{B-1} \left(\dfrac{ A \hspace{1mm}C^{-A Z_{u(i)}} C^{-C^{-A* Z_{u(i)}}}}{1- \frac{1}{C-1} (C^{1-C^{-A* Z_{u(i)}}}-1)}\right) \right) A}  .
        \end{equation}                          
    \end{itemize}
\end{frame}

\bibliography{ref}
\bibliographystyle{plainnat}

\end{document} 

而.bib文件的内容是:

@article{kumar2015method,
    title={This is the title of the article},
    author={Kumar, Dinesh and others},
    journal={This is Journal},
    volume={2},
    number={3},
    pages={150-180},
    year={2015}
}

【问题讨论】:

  • 表格问题已修复。感谢tex.stackexchange.com/questions/38177/…
  • 你能用minimal reproducible example解决你剩下的问题吗?
  • 而且不要使用您链接到的线程中的\resizebox 解决方案,这是一个糟糕的主意
  • 我已经在问题中添加了代码。可能不需要太多命令,但由于 Latex 对我来说是新的,我保留了这些命令。请建议替代 \resizebox。
  • 如何最好地将表格挤入幻灯片将取决于表格。

标签: latex beamer


【解决方案1】:
  • 如果您使用plainnat bib 样式,您还应该加载natbib 包。这将自动允许换行

  • 你不需要 caption 包,beamer 提供了它自己的机制来自定义字幕

  • 您必须将bibliography 放在框架内

  • 对于非常大的等式,我建议将分数替换为(...) \times (...)^{-1},这样您可以将其拆分为多行。此外,您可能希望使用较小的字体,并可能删除所有手动空格。


\documentclass[9pt]{beamer}
\mode<presentation> {
\usefonttheme{serif}
\usetheme{Madrid}
\definecolor{BlueGreen}{cmyk}{0.85,0,0.33,0}
\makeatletter
\colorlet{beamer@blendedblue}{BlueGreen!120}
\makeatother
}

\usepackage{booktabs} 
%\usepackage{caption}


\hypersetup{pdfnewwindow}
\setbeamertemplate{caption}[numbered]
\setbeamerfont{frametitle}{size=\footnotesize}
\setbeamertemplate{navigation symbols}{}
\setbeamercolor{postit}{bg=violet!110}
\usepackage{ragged2e}   %new code

\addtobeamertemplate{block begin}{}{\justifying} 


\usepackage{natbib}

\usepackage{textpos}

\begin{document}

\begin{frame} \frametitle{\textbf{{\Large Objective}}}
    \begin{itemize}
        \justifying
            \item This package gives you easy access to the Lorem Ipsum dummy text; an option is available to separate the paragraphs of the dummy text. This text \cite{kumar2015method}.
        
        \item The long equation is:                        
    \end{itemize}
\end{frame}

\begin{frame}
\bibliography{ref}
\bibliographystyle{plainnat}
\end{frame}

\end{document}

【讨论】:

  • 当我在原始演示文稿中复制这些命令时(很长),我收到一个错误“未定义的控制序列。 \end{frame}' 和 \captionof{figure}{PDF of the distribution} 突出显示的行。我使用 \minipage 将图像并排放置。
  • @rgt 如果你想使用\captionof,你需要caption包。但是,您可以简单地使用投影柱将两个图形环境并排放置。
  • 感谢@samcarter_is_at_topanswers.xyz,使用\usepackage{caption}后我得到了输出。
猜你喜欢
  • 2013-01-30
  • 1970-01-01
  • 1970-01-01
  • 2015-12-19
  • 1970-01-01
  • 1970-01-01
  • 2012-02-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多