4

I am trying to float an image to the right of some text in a beamer slide. There is a partial example of this already available on this site, here. I seem to be struggling to get it right. The text seems to push down so its not aligned with the picture. here is the document:

\documentclass{beamer}

\usepackage[style=british]{csquotes}
\usepackage[]{graphicx}

\setbeameroption{show notes}

\mode<presentation>
{
    \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
    \usecolortheme{default} % or try albatross, beaver, crane, ...
    \usefonttheme{default}  % or try serif, structurebold, ...
    \setbeamertemplate{navigation symbols}{}
    \setbeamertemplate{caption}[numbered]
} 

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}

\title[Title]{Title}
\author{Name}
\institute{College}
\date{March 1, 2017}

\begin{document}

\begin{frame}
      \titlepage
\end{frame}

\begin{frame}{Purpose for writing}

    \textbf{\large Labour Government introduces life saving cancer drug} \\
    \noindent
    \parbox[t]{6cm}{
    The labour government this week has made available a new treatment for a
    rare form of cancer. The usage of Medifix\textsuperscript{\textregistered}
    in Public hospitals. The new drug is expected to save as many as 20 lives
    per year.
    }
    \includegraphics[width = 30mm]{BIB201_Genres_of_NT_Family.png}

\end{frame}
\end{document}

Here is what I get, I am trying pdflatex:

picture of the output

PS: Can I draw a box around this (Im trying to create a fictional newspaper article)

9

The beamer way uses columns and block environments. You can change the appearance of the block using \setbeamerfont and \setbeamercolor applied to block title and block body.

\documentclass{beamer}

\usepackage[style=british]{csquotes}
\usepackage[]{graphicx}

\setbeameroption{show notes}

\mode<presentation>
{
    \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
    \usecolortheme{default} % or try albatross, beaver, crane, ...
    \usefonttheme{default}  % or try serif, structurebold, ...
    \setbeamertemplate{navigation symbols}{}
    \setbeamertemplate{caption}[numbered]
} 

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}

\title[Title]{Title}
\author{Name}
\institute{College}
\date{March 1, 2017}

\begin{document}

\begin{frame}
      \titlepage
\end{frame}

\begin{frame}{Purpose for writing}

  \begin{block}{Labour Government introduces life saving cancer drug}

    \begin{columns}[onlytextwidth,T]
      \column{\dimexpr\linewidth-30mm-5mm}

      The labour government this week has made available a new treatment
      for a rare form of cancer. The usage of
      Medifix\textsuperscript{\textregistered} in Public hospitals. The
      new drug is expected to save as many as 20 lives per year.

      \column{30mm}
      \includegraphics[width=30mm]{example-image}

    \end{columns}
  \end{block}

\end{frame}

\begin{frame}{Purpose for writing}

  \setbeamerfont{block title}{series=\bfseries}
  \setbeamercolor{block title}{bg=green!50!black,fg=white}
  \setbeamercolor{block body}{bg=lime!30}
  \begin{block}{Labour Government introduces life saving cancer drug}

    \begin{columns}[onlytextwidth,T]
      \column{\dimexpr\linewidth-30mm-5mm}

      The labour government this week has made available a new treatment
      for a rare form of cancer. The usage of
      Medifix\textsuperscript{\textregistered} in Public hospitals. The
      new drug is expected to save as many as 20 lives per year.

      \column{30mm}
      \includegraphics[width=30mm]{example-image}

    \end{columns}
  \end{block}

\end{frame}
\end{document}

enter image description here

enter image description here

3

Put your parbox and your image in a tabular (of course, you can adjust the horizontal and vertical alignments as you like):

\documentclass{beamer}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage[style=british]{csquotes}
\usepackage[]{graphicx}
\usepackage{array}

\setbeameroption{show notes}

\mode<presentation>
{
    \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
    \usecolortheme{default} % or try albatross, beaver, crane, ...
    \usefonttheme{default}  % or try serif, structurebold, ...
    \setbeamertemplate{navigation symbols}{}
    \setbeamertemplate{caption}[numbered]
} 

\title[Title]{Title}
\author{Name}
\institute{College}
\date{March 1, 2017}

\begin{document}


    \begin{frame}
        \titlepage
    \end{frame}

    \begin{frame}{Purpose for writing}
        \textbf{\large Labour Government introduces life saving cancer drug}
        \begin{table}%
            \flushleft
            \begin{tabular}{@{}m{6cm}m{30mm}@{}}% Of course, you can adjust the width as you like
                \parbox[t]{6cm}{%
                    The labour government this week has made available a new treatment for a
                    rare form of cancer. The usage of Medifix\textsuperscript{\textregistered}
                    in Public hospitals. The new drug is expected to save as many as 20 lives
                    per year. 
                } &
                \includegraphics[width = 30mm]{example-image-a} \\
            \end{tabular}
        \end{table}
    \end{frame}
\end{document}

enter image description here

2

I'll just provide you with a starter (at least for the box). The issue of the picture is your use of [t] and \includegraphics outside of a \parbox.

Concerning the box I added tcolorbox as package. It's very powerful and has a bunch of options you can try.

beamer and tcolorbox

\documentclass[draft]{beamer}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage[style=british]{csquotes}
\usepackage{graphicx}

\usepackage{tcolorbox}
\tcbuselibrary{most}

\setbeameroption{show notes}

\mode<presentation>
{
    \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
    \usecolortheme{default} % or try albatross, beaver, crane, ...
    \usefonttheme{default}  % or try serif, structurebold, ...
    \setbeamertemplate{navigation symbols}{}
    \setbeamertemplate{caption}[numbered]
} 

\title[Title]{Title}
\author{Name}
\institute{College}
\date{March 1, 2017}

\begin{document}
    \begin{frame}
          \titlepage
    \end{frame}

    \begin{frame}{Purpose for writing}
        \tcolorbox
        \textbf{\large Labour Government introduces life saving cancer drug}\tcblower
        \parbox{.55\textwidth}{
        The labour government this week has made available a new treatment for a
        rare form of cancer. The usage of Medifix\textsuperscript{\textregistered}
        in Public hospitals. The new drug is expected to save as many as 20 lives
        per year.
        }\hfill\parbox{.4\textwidth}{
            \includegraphics[width = 30mm]{BIB201_Genres_of_NT_Family.png}
        }
        \endtcolorbox
    \end{frame}
\end{document}

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.