4

I am trying to create two columns in one slide with Beamer. I followed this link: How to split a frame (of beamer) into 2 parts (minipage) side by side?

However, none of the minipage or the columns environment works. For columns environment, my dvi file looks fine but when I convert it to pdf, the page becomes a blank page. For minipage, I would like to remove the border of each minipage. However, once I remove the \fbox, the two minipage have weird alignment.

I basically use the sample code from the link I mentioned. Here is my code:

\documentclass[]{beamer}
\mode<presentation>
\usepackage{beamerthemesplit,mathtools,pgf,PSTricks}
\setbeamertemplate{footline}[page number]
\begin{document}
\begin{frame}
\begin{columns}
\begin{column}{.48\textwidth}
\color{red}\rule{\linewidth}{4pt}
Left Part
\end{column}%
\hfill%
\begin{column}{.48\textwidth}
\color{blue}\rule{\linewidth}{4pt}
Right Part
\end{column}%
\end{columns}
\end{frame}

\begin{frame}
\fboxsep=0pt
\noindent
%\fbox{%
\begin{minipage}[t]{0.48\linewidth}
\includegraphics[height=0.5\paperheight]{impact_circles.eps}
\end{minipage}
%}%
\hfill%
%\fbox{%
\begin{minipage}[t]{0.48\linewidth}
\begin{itemize}
\item right part
\item test2
\item test3
\end{itemize}
\end{minipage}
%}
\end{frame}
\end{document}

The first slide using columns environment, and it is looks fine in dvi file, but it doesn't work after converting to pdf.

The second slide using minipage enviroment. It works but the two minipage do not align with each other.

Anyone knows how to fix this issue? Thank you.

  • Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Herr K. Dec 10 '13 at 21:00
  • Thanks for your reply. I've included the MWE. I could upload my pdf file if needed. – Yifen Dec 10 '13 at 21:17
  • So your problem is about misalignment of two columns, right? If that's the case, I would just use the columns environment with options t, T, c, and b to control the vertical alignments. No need to use minipage. – Herr K. Dec 10 '13 at 21:29
  • If I use columns environment, the pdf file doesn't display correctly. Basically, the page becomes blank. I need to covert the dvi file to pdf because some of my figures only show in pdf file. Thanks. – Yifen Dec 10 '13 at 21:41
  • What's your compilation sequence? It might have to do with the fact that the image you want to include has an .eps extension. Have you tried with images of other formats, like .png or .pdf? – Herr K. Dec 10 '13 at 21:44
1

This is more of an extended comment.

Alignment with minipage

You can use the adjustbox package to control vertical alignment of the image (load it before you load pstricks though).

Code

% compile with latex + dvipdfmx 
\documentclass[]{beamer}
\mode<presentation>
\usepackage{mwe} % provides image in this example
\usepackage{adjustbox}
\usepackage{beamerthemesplit,mathtools,pgf,pstricks}
\setbeamertemplate{footline}[page number]

\begin{document}
\begin{frame}{with \texttt{minipage}}
\noindent
\begin{minipage}[t]{0.48\linewidth}
  \adjustbox{valign=T}{\includegraphics[scale=0.4]{image.eps}}
\end{minipage}
\hfill%
\begin{minipage}[t]{0.48\linewidth}
  \begin{itemize}
    \item right part
    \item test2
    \item test3
  \end{itemize}
\end{minipage}
\end{frame}
\end{document}

Output (despite a lot warnings during dvipdfmx)

enter image description here

Including a .eps image in columns

It is by chance that I come to discover that the contents in the frame with columns got "pushed" down and to the left for some reason during the latex+dvipdfmx compilation. This is illustrated by issuing \vspace{-7cm} in the following:

\documentclass[]{beamer}
\mode<presentation>
\usepackage{mwe} % provides image in this example
\usepackage{beamerthemesplit,mathtools,pgf,pstricks}
\setbeamertemplate{footline}[page number]

\begin{document}
\begin{frame}{with \texttt{columns}}
\vspace{-7cm}

\begin{columns}[T]
  \column{.48\textwidth}
  \includegraphics[scale=0.4]{image.eps}

  \column{.48\textwidth}
  \begin{itemize}
    \item right part
    \item test2
    \item test3
  \end{itemize}  
\end{columns}
\end{frame}
\end{document}

enter image description here

I don't know why this is the case. It probably has to do with all the warnings one gets during the dvipdfmx run. Hopefully someone can answer this part of the question.

  • Interesting finding. I tried to use \vspace and \hspace to adjust it, but it seems that \hspace is not working..... – Yifen Dec 12 '13 at 17:41
  • I also found the same problem happening on block environment when converting to pdf...... – Yifen Dec 12 '13 at 17:42
  • @Yifen: Have you tried compiling using xelatex? – Herr K. Dec 12 '13 at 17:49

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.