Beamer 中的图形

Beamer 中的图形

我想使用 制作幻灯片beamer。是否可以将图形放在左上角,将引文放在图形的右上角?是否有任何特殊的引文环境?

\begin{frame}[t]{Factorization Methods}
\begin{figure}[htb]
\includegraphics[width=0.15\textwidth]{gauss.jpeg}
\end{figure}

\textbf{``The problem of distinguishing prime numbers from composites, and of resolving composite numbers into their prime factors, is one of the most important and useful in all of arithmetic."}- Carl Friedrich Gauss



\vspace*{10pt}

\begin{itemize}
\item Pollard's $p-1$ algorithm (1974)
\vspace*{10pt}
\item Dixon's Random Squares Algorithm (1981)
\vspace*{10pt}
\item Quadratic Sieve (QS): Pomerance (1981)
\vspace*{10pt}
\item Williams' $p+1$ method (1982)
\end{itemize}
\end{frame}

答案1

您不需要figure环境即可使用\includegraphics。要将图像放在左侧并将引文放在右侧,您可以使用例如beamerscolumns或普通tabular。两者均如下所示。

默认情况下,列中的文本是对齐的。通过在单元格开头p添加,文本将仅设置为左对齐。\raggedright\arraybackslash

如果您想将图像的顶部与图像的顶部对齐,您可以使用包adjustbox及其\adjincludegraphics[valign=t]{image}将图像的“锚点”设置在顶部,并将其用作环境[t]的可选参数columns

\documentclass{beamer}
\usepackage{array} % needed for \arraybackslash
\usepackage{graphicx}
\usepackage{adjustbox} % for \adjincludegraphics
\begin{document}
\begin{frame}{Factorization Methods}

\begin{columns}[t]
\begin{column}{.3\textwidth}
\adjincludegraphics[width=.8\linewidth,valign=t]{example-image}
\end{column}
\begin{column}{.7\textwidth}
\textbf{``The problem of distinguishing prime numbers from composites, and of resolving composite numbers into their prime factors, is one of the most important and useful in all of arithmetic."}

\hfill-- Carl Friedrich Gauss
\end{column}
\end{columns}


\vspace*{10pt}

\begin{itemize}
\item Pollard's $p-1$ algorithm (1974)
\vspace*{10pt}
\item Dixon's Random Squares Algorithm (1981)
\vspace*{10pt}
\item Quadratic Sieve (QS): Pomerance (1981)
\vspace*{10pt}
\item Williams' $p+1$ method (1982)
\end{itemize}
\end{frame}

\begin{frame}{Factorization Methods}

\begin{tabular}{p{.3\textwidth} p{.7\textwidth}}
\adjincludegraphics[width=.8\linewidth,valign=t]{example-image}
&
\raggedright\arraybackslash\textbf{``The problem of distinguishing prime numbers from composites, and of resolving composite numbers into their prime factors, is one of the most important and useful in all of arithmetic."}

\hfill-- Carl Friedrich Gauss
\end{tabular}



\vspace*{10pt}

\begin{itemize}
\item Pollard's $p-1$ algorithm (1974)
\vspace*{10pt}
\item Dixon's Random Squares Algorithm (1981)
\vspace*{10pt}
\item Quadratic Sieve (QS): Pomerance (1981)
\vspace*{10pt}
\item Williams' $p+1$ method (1982)
\end{itemize}
\end{frame}
\end{document}

在此处输入图片描述

相关内容