0

I am writing a code in beamer. And I want my slide to look like this:Expected. The code that I have written is this:

\documentclass{beamer}
\usepackage{lipsum}
\begin{document}
    \begin{frame}
    \begin{minipage}{.25\columnwidth}
        \fbox{\lipsum[1]}
    \end{minipage}%
    \begin{minipage}{.5\columnwidth}
        \includegraphics[scale=0.3]{example-image-a}
    \end{minipage}%
    \begin{minipage}{0.25\columnwidth}
        \fbox{\lipsum[1]}
    \end{minipage}
    \end{frame}

    \begin{frame}
    \begin{minipage}{.5\columnwidth}
        \includegraphics[scale=0.3]{example-image-a}
    \end{minipage}%
    \begin{minipage}{0.5\columnwidth}
        \fbox{\lipsum[1]}
    \end{minipage}
    \begin{minipage}{0.5\columnwidth}
    \fbox{\lipsum[1]}
    \end{minipage}
    \end{frame}
\end{document}

But what I am getting is this: Outcome

What am I doing wrong? How can I fix it? Thanks in advance.

1

I suggest to use beamers column mechanism to create the desired layout:

\documentclass{beamer}
\usepackage{lipsum}
\begin{document}
  \begin{frame}
    \begin{columns}[T,onlytextwidth]
        \begin{column}{.23\textwidth}
            \fbox{\begin{minipage}{.97\textwidth}
                \lipsum[2]
            \end{minipage}}%
        \end{column}
        \begin{column}{.48\textwidth}
                \includegraphics[scale=0.3]{example-image-a}
        \end{column}
            \begin{column}{.23\textwidth}
                \fbox{\begin{minipage}{.97\textwidth}
                    \lipsum[2]
                \end{minipage}}%
            \end{column}
      \end{columns}
  \end{frame}

  \begin{frame}
    \begin{columns}[T,onlytextwidth]
        \begin{column}{.48\textwidth}
                \includegraphics[scale=0.3]{example-image-a}
        \end{column}    
        \begin{column}{.48\textwidth}
            \fbox{\begin{minipage}{.97\textwidth}
                \lipsum[2]
            \end{minipage}}%

                \fbox{\begin{minipage}{.97\textwidth}
                    \lipsum[2]
                \end{minipage}}%
            \end{column}
      \end{columns}
  \end{frame}
\end{document}

enter image description here

  • thanks again. May be one could put \centering in before \includegraphics. – sreeraj t Apr 1 at 14:35
  • 1
    @sreerajt Sure, if you want the image top be centred, just add \centering or put it in a figure environment, they are centred by default in beamer – user36296 Apr 1 at 15:30

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.