Beamer:在带有图像的顶部对齐列中,其中一张图片被降低,而不是顶部对齐

Beamer:在带有图像的顶部对齐列中,其中一张图片被降低,而不是顶部对齐

我遇到了 Beamer 的一个非常令人费解的行为。以下最小示例包含四列,每列都有一个图像(使用环境figure)。

\documentclass{beamer}

\graphicspath{{./Images/}}

\begin{document}

\begin{frame}

\begin{columns}[t]

\column{0.25\textwidth}
\begin{figure}
\includegraphics[height=3.2cm]{Epicurus}
\end{figure}

\column{0.25\textwidth}
\begin{figure}
\includegraphics[height=3.2cm]{Nietzsche}
\end{figure}

\column{0.25\textwidth}
\begin{figure}
\includegraphics[height=3.2cm]{Deleuze}
\end{figure}

\column{0.25\textwidth}
\begin{figure}
\includegraphics[height=3.2cm]{Badiou}
\end{figure}

\end{columns}

\end{frame}

\end{document}

我希望图像顶部对齐,因此我在环境[t]中使用了该选项columns。我得到了以下结果:

在此处输入图片描述

第 1、2 和 4 列确实是顶部对齐的,但第 3 列中的图像被降低了。

在寻找此问题的解决方案时,我在一篇文章中看到使用选项[T]而不是[t]可能会有所帮助。所以我尝试了。它确实改善了这种情况。现在第 3 列中的图像是几乎顶部对齐,但只是差不多。我不确定如果不放大是否可见,但图像 3 仍然比其他图像略低:

在此处输入图片描述

这是怎么回事?为什么 Beamer 对图像 3 的处理不同?代码与其他图像完全相同,图像也与其他图像相似(它们都是 jpg 格式)。

答案1

对于此投影仪配置,框架的宽度为 307.3 点。每列的可用宽度为 76.82pt

如果图像更宽(第一行,图像c,76.9pt!)它会向下滚动,原因我不知道。

如果所有图像都超过这个临界值(第二行的所有图像),它们看起来会对齐,但仅仅是因为它们都向下移动了。

我们可以在第三行看到,除了图像的宽度之外,它与第二行相同b,现在为 76.8pt,因此是唯一停留在正确位置的。

为什么仍是一个悬而未决的问题。

C

The package multicol behaves more predictable. 

d

\documentclass{beamer}

\usepackage{graphicx}
%\graphicspath{{./Images/}}
\usepackage{multicol}

\begin{document}
    \begin{frame}
\begin{columns}[t]          
    \column{0.25\textwidth}
    \begin{figure}
        \includegraphics[height=3cm, width=76.8pt]{example-image-b}
    \end{figure}            
    \column{0.25\textwidth}
    \begin{figure}
        \includegraphics[height=3cm, width=76.8pt]{example-image-a}
    \end{figure}            
    \column{0.25\textwidth}
    \begin{figure}
        \includegraphics[height=3cm, width=76.9pt]{example-image-c} % 76.8pt is OK
    \end{figure}            
    \column{0.25\textwidth}
    \begin{figure}
        \includegraphics[height=3cm, width=76.8pt]{example-image-a}
    \end{figure}            
\end{columns}       
76.8pt \hfill 76.8pt \hfill \textbf{76.9pt} \hfill 76.8pt
\begin{columns}[t]      
    \column{0.25\textwidth}
    \begin{figure}
        \includegraphics[height=3cm, width=77pt]{example-image-b}
    \end{figure}        
    \column{0.25\textwidth}
    \begin{figure}
        \includegraphics[height=3cm, width=77pt]{example-image-a}
    \end{figure}        
    \column{0.25\textwidth}
    \begin{figure}
        \includegraphics[height=3cm, width=76.9pt]{example-image-c}
    \end{figure}
    \column{0.25\textwidth}
    \begin{figure}
        \includegraphics[height=3cm, width=77pt]{example-image-a}
    \end{figure}        
\end{columns}
77pt \hfill 77pt \hfill 76.9pt \hfill 77pt
\end{frame}

\begin{frame}
    Frame width =\the\framewidth
    \begin{columns}[t]      
        \column{0.25\textwidth}
        \begin{figure}
            \includegraphics[height=3cm, width=76.8pt]{example-image-b}
        \end{figure}        
        \column{0.25\textwidth}
        \begin{figure}
            \includegraphics[height=3cm, width=77pt]{example-image-a}
        \end{figure}        
        \column{0.25\textwidth}
        \begin{figure}
            \includegraphics[height=3cm, width=76.9pt]{example-image-c}
        \end{figure}
        \column{0.25\textwidth}
        \begin{figure}
            \includegraphics[height=3cm, width=77pt]{example-image-a}
        \end{figure}        
    \end{columns}
    \textbf{76.8pt} \hfill 77pt \hfill 76.9pt \hfill 77pt   
    
\end{frame}

\begin{frame}
        
Using the package multicol and four columns
    
\begin{multicols}{4}    
\begin{figure}
    \includegraphics[height=3cm, width=76.8pt]{example-image-b}
\end{figure}            

\begin{figure}
    \includegraphics[height=3cm, width=77pt]{example-image-a}
\end{figure}

\begin{figure}
    \includegraphics[height=3cm, width=76.9pt]{example-image-c} % 76.8pt is OK
\end{figure}            

\begin{figure}
    \includegraphics[height=3cm, width=77pt]{example-image-a}
\end{figure}        
\end{multicols}
        
76.8pt \hfill 77pt \hfill 76.9pt \hfill 77pt

\end{frame}

\end{document}

相关内容