3

I am trying to top-aligned the right figure with the left text. But when I used option 'T', I found top room get much bigger in the right figure.

Here is my tex code:

\documentclass{beamer}
\usepackage[UTF8, 10pt]{ctex}
\usepackage{subcaption}

\begin{document}

\begin{frame}[t]\frametitle{Motivation}

\begin{columns}

    \column{.5\textwidth}

    卷积产生了三个重要的影响,
    \begin{itemize}
        \item a
        \item b
        \item c
    \end{itemize}

    稀疏交互的含义是:

    \textcolor{red}{传统的全连接网络}每层的$m$个input和$n$个output之间都有连接,

    \textcolor{red}{卷积网络}的input和output之间是稀疏连接,

    \column{.5\textwidth}

    \begin{figure}[t]

        \centering
        \begin{subfigure}{.5\textwidth}
            \centering
            \includegraphics[width=\linewidth]{example-image}
            \caption{view from below}
        \end{subfigure}
        \begin{subfigure}{.5\textwidth}
            \centering
            \includegraphics[width=\linewidth]{example-image}
            \caption{view from above}
        \end{subfigure}
        \caption{Caption here}
        \label{fig:figure1}
    \end{figure}

\end{columns}

\end{frame}
\end{document}

enter image description here

According to Problem with top alignment in beamer columns, after I have added the option 'T'

\documentclass{beamer}
\usepackage[UTF8, 10pt]{ctex}
\usepackage{subcaption}

\begin{document}

\begin{frame}[t]\frametitle{Motivation}

\begin{columns}[T] % new option

    \column{.5\textwidth}

    卷积产生了三个重要的影响,
    \begin{itemize}
        \item a
        \item b
        \item c
    \end{itemize}

    稀疏交互的含义是:

    \textcolor{red}{传统的全连接网络}每层的$m$个input和$n$个output之间都有连接,

    \textcolor{red}{卷积网络}的input和output之间是稀疏连接,

    \column{.5\textwidth}

    \begin{figure}[t]

        \centering
        \begin{subfigure}{.5\textwidth}
            \centering
            \includegraphics[width=\linewidth]{example-image}
            \caption{view from below}
        \end{subfigure}
        \begin{subfigure}{.5\textwidth}
            \centering
            \includegraphics[width=\linewidth]{example-image}
            \caption{view from above}
        \end{subfigure}
        \caption{Caption here}
        \label{fig:figure1}
    \end{figure}

\end{columns}

\end{frame}
\end{document}

enter image description here

The text seems top-aligned, but the figure ...

So any ideas that can align the figure with the text? And why the top room becomes bigger?

  • 2
    Welcome to TeX.SX! Please add a minimal working example (MWE) , starting with \documentclass and ending with \end{document}. – Bobyandbob Apr 5 '17 at 8:36
  • are you sure that your code snippet can be compiled? as i can see, the use of columns is wrong (i didn't find \end{column}). – Zarko Apr 5 '17 at 10:01
  • @Zarko There are two syntax for column, one with \begin{column}, one with \column, the latter does not need \end{column} – user36296 Apr 5 '17 at 13:33
  • well, i was not aware for this possibilities. however, to my opinion, it is not smart to use this syntax. better is stick with "classic" one: \begin{...} ... \end{...}. – Zarko Apr 5 '17 at 13:40
  • @Zarko Exactly what I usually do, but the other syntax is neither wrong nor the source of the problem here. – user36296 Apr 5 '17 at 13:46
4

The additional space comes from the figure environment. As a quick hack:

\documentclass{beamer}

\usepackage{subcaption}

\begin{document}

\begin{frame}[t]
  \frametitle{Motivation}
  \begin{columns}[T] % new option
    \begin{column}{.5\textwidth}
      text text text
      \begin{itemize}
        \item text text text(sparse interaction)
        \item text text text(parameter sharing)
        \item text text text(equivariant representation)
      \end{itemize}
      text text text:

      \textcolor{red}{text text text}text text text$m$text text text$n$text text text,text text text$m \times n $text text text,text text text。

      \textcolor{red}{text text text}text text text,text text text,text text text,text text text$k \times n, k \ll m$,text text text,text text text。
    \end{column}
    \begin{column}{.5\textwidth}
      \vspace{-.9\baselineskip}
      \begin{figure}
        \begin{subfigure}[t]{.5\textwidth}
          \includegraphics[width=\linewidth]{example-image}
          \caption{view from below}
        \end{subfigure}
        \begin{subfigure}{.5\textwidth}
          \includegraphics[width=\linewidth]{example-image}
          \caption{view from above}
        \end{subfigure}
        \caption{Caption here}
        \label{fig:figure1}
      \end{figure}
    \end{column}
  \end{columns}
\end{frame}


\end{document}

enter image description here

  • Just a hint. I usually put a \vspace{\heightof{X}} in here and are just happy with it. The result shall be comparable. – Jürgen Apr 5 '17 at 14:01

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.