4

I have a beamer frame consisting of two columns (top aligned) using the [T] option. The second column contains a align equation block. Even though I am using the [T] option the column containing the equation will not align with the text in the left column. When a put a line of text just before the equation the alignment works fine. So what am I missing ?

Here is a MWE

\documentclass{beamer}
\DeclareMathOperator{\IM}{Im}
\begin{document}
\newcommand{\highlight}[1]{\colorbox{yellow}{$\displaystyle #1$}}
\begin{frame}
    \begin{columns}[T]
        \column{0.4\textwidth}
        Transverse MO Kerr effect
        {\tiny [Zvezdin, Modern Magnetooptics, IOP 1999]}
        \column{0.6\textwidth}
        %\centering test
        \begin{align*}
        r_p(M) &= r^0_p\left(1+i\rho_p(M)\right)\\
        \rho_p(M) &=\frac{-ir_p^0\epsilon_g(M)/\epsilon_z\sin\varphi}{2(\eta^2-\sin^2\varphi)^{1/2}}\\
            [r_s(M) &= r^0_s\quad\eta =n/n_\mathrm{inc}]\\
            \delta_p &= \frac{I(M)-I_0}{I_0} = \highlight{2\IM(\rho_p)} %\quad \textcolor{red}{\textbf{\only on lossy MO materials}}
        \end{align*}\par
        \centering$\color{red}\Rightarrow$ \textcolor{red}{\textbf{only on lossy MO materials}}
    \end{columns}

\end{frame}

\begin{frame}
    \begin{columns}[T]
        \column{0.4\textwidth}
        Transverse MO Kerr effect
        {\tiny [Zvezdin, Modern Magnetooptics, IOP 1999]}
        \column{0.6\textwidth}
        \centering test
        \begin{align*}
        r_p(M) &= r^0_p\left(1+i\rho_p(M)\right)\\
        \rho_p(M) &=\frac{-ir_p^0\epsilon_g(M)/\epsilon_z\sin\varphi}{2(\eta^2-\sin^2\varphi)^{1/2}}\\
            [r_s(M) &= r^0_s\quad\eta =n/n_\mathrm{inc}]\\
            \delta_p &= \frac{I(M)-I_0}{I_0} = \highlight{2\IM(\rho_p)} %\quad \textcolor{red}{\textbf{\only on lossy MO materials}}
        \end{align*}\par
        \centering$\color{red}\Rightarrow$ \textcolor{red}{\textbf{only on lossy MO materials}}
    \end{columns}

\end{frame}

\end{document}
  • Because there is \abovedisplayskip. make it zero or even negative only there. – user11232 Jan 28 '15 at 16:37
5

align will have \abovedisplayskip above the its top. You have to get rid of it. Plus since making it zero will bring the equation in the next line (display equation!) making

\setlength{\abovedisplayskip}{-\baselineskip}

will do the job. Further, you need to add a `\par in

{\tiny [Zvezdin, Modern Magnetooptics, IOP 1999]\par}

Code:

\documentclass{beamer}
\DeclareMathOperator{\IM}{Im}
\begin{document}
\newcommand{\highlight}[1]{\colorbox{yellow}{$\displaystyle #1$}}
\begin{frame}
    \begin{columns}
        \column[t]{0.4\textwidth}
        Transverse MO Kerr effect
        {\tiny [Zvezdin, Modern Magnetooptics, IOP 1999]\par}   %% you need a \par here
        \column[t]{0.6\textwidth}
        \setlength{\abovedisplayskip}{-\baselineskip}
        %\centering test
        \begin{align*}
        r_p(M) &= r^0_p\left(1+i\rho_p(M)\right)\\
        \rho_p(M) &=\frac{-ir_p^0\epsilon_g(M)/\epsilon_z\sin\varphi}{2(\eta^2-\sin^2\varphi)^{1/2}}\\
            [r_s(M) &= r^0_s\quad\eta =n/n_\mathrm{inc}]\\
            \delta_p &= \frac{I(M)-I_0}{I_0} = \highlight{2\IM(\rho_p)} %\quad \textcolor{red}{\textbf{\only on lossy MO materials}}
        \end{align*}\par
        \centering$\color{red}\Rightarrow$ \textcolor{red}{\textbf{only on lossy MO materials}}
    \end{columns}

\end{frame}
\end{document}

enter image description here

  • OK, thanks for your answer. However I didn't get why setting \setlength{\abovedisplayskip}{0pt} doesn't quite work? Also why exactly do I need a \par in the first column? – Mathias Vanwolleghem Jan 28 '15 at 17:12
  • 2
    @MathiasVanwolleghem \par before closing the group, as in {\tiny <text>\par} is to guarantee that the correct \baselineskip will be applied for <text>. You won't notice any effect in your example code, since the text doesn't span more than one line. – Gonzalo Medina Jan 28 '15 at 17:39
  • I have another question. Even though the columns align on the top, they don't get placed at the top of the frame ? – Mathias Vanwolleghem Jan 28 '15 at 19:10
  • @MathiasVanwolleghem For that you have to use \begin{frame}[t]. – user11232 Jan 28 '15 at 23:22
  • @MathiasVanwolleghem With \setlength{\abovedisplayskip}{0pt} the equation comes to the next line. To remove the empty line at the top, you need \baselineskip. – user11232 Jan 28 '15 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.