在投影仪中将图像浮动到右侧

在投影仪中将图像浮动到右侧

我正在尝试将图像浮动到投影仪幻灯片中的一些文本的右侧。这方面已经有部分示例可从此处网站获取。我似乎很难把它弄好。文本似乎向下推,所以它与图片不对齐。以下是文档:

\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}

这是我得到的,我正在尝试pdflatex

输出图片

附言:我可以在这周围画一个框吗(我正在尝试创建一篇虚构的报纸文章)

答案1

beamer 方式使用columns和环境。您可以使用和应用于和来block更改块的外观。\setbeamerfont\setbeamercolorblock titleblock 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}

在此处输入图片描述

在此处输入图片描述

答案2

我只是为您提供了一个启动器(至少是盒子的启动器)。图片的问题在于您对 的使用[t]以及\includegraphics之外的使用\parbox

关于我作为包裹添加的盒子tcolorbox。它非常强大,有很多你可以尝试的选项。

beamer 和 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}

答案3

将您parbox和您的图像放入tabular(当然,您可以根据需要调整水平和垂直对齐):

\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}

在此处输入图片描述

相关内容