minipage
我在演示文稿的一张幻灯片中使用了环境beamer
。基本上,我希望得到以下内容:
幻灯片顶部:左侧是一张图片,右侧是一些说明。右侧的文字应使用比通常更小的字体。
幻灯片底部:添加附加信息(使用常规字体大小)。
我写了以下内容:
\newcommand\Fat{\fontsize{7}{7.2}\selectfont}
\section{Extras}
\subsection{Personal Profiles}
\begin{frame}{The minipage environment}
\frametitle{Extras}
\framesubtitle{Personal Profiles}
\begin{minipage}{0.25\textwidth}
\includegraphics[width=2.5cm,height=3cm]{images/PN}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\Fat
Adam Smith (B.Sc. London, M.Sc. and Ph.D. New York, M.Sc. by Research Los Angeles) Full
Professor of Physics (Hong Kong) and Visiting Professor of Physics (Milan). He was a Fulbright Research Fellow at Carnegie
Mellon University.
\end{minipage}\bigskip\\
Adam Smith is currently working on three project
\end{frame}
一切正常。唯一的问题是,我希望环境右侧的文本minipage
分布得更好(即,我希望文本的行数更少、行数更长)。我该怎么做?
答案1
\documentclass{beamer}
\usepackage{wrapfig,ragged2e}
\begin{document}
\section{Extras}
\subsection{Personal Profiles}
\begin{frame}{The minipage environment}{Extras}{Personal Profiles}
\begin{wrapfigure}[8]{l}{2.5cm}
\includegraphics[width=\linewidth]{example-image}
\end{wrapfigure}
{\RaggedRight\small% Your font (size) choice
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sagittis
a metus nec pulvinar.
Quisque sed rhoncus dui. Proin eget nisi mi. Quisque tempor mauris
vestibulum, efficitur
risus quis, auctor est. Aliquam erat volutpat. Praesent consectetur
mattis libero ac
pellentesque. Suspendisse varius est eros, sed porttitor velit
tincidunt vel. Vestibulum
sodales quam sem, sit amet fermentum tellus luctus a.\par}
\bigskip
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sagittis
a metus nec pulvinar.
Quisque sed rhoncus dui. Proin eget nisi mi. Quisque tempor mauris
vestibulum, efficitur
risus quis, auctor est. Aliquam erat volutpat.
\end{frame}
\end{document}
答案2
这里有一个选项,您可以在其中设置图像和随附的文本tabularx
。“图像列”使用 进行设置l
,因此会随图像宽度拉伸 - 您已经指定了宽度。“文本列”使用 进行设置,X
它使用 的剩余部分\linewidth
。
\documentclass{beamer}
\usepackage{tabularx}
\begin{document}
\section{Extras}
\subsection{Personal Profiles}
\begin{frame}{The minipage environment}
\frametitle{Extras}
\framesubtitle{Personal Profiles}
\begin{tabularx}{\linewidth}{@{}lX@{}}
\raisebox{\dimexpr-\height+.7\normalbaselineskip}{\includegraphics[width=2.5cm,height=3cm]{example-image}} &
\raggedright\small% Your font (size) choice
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sagittis a metus nec pulvinar.
Quisque sed rhoncus dui. Proin eget nisi mi. Quisque tempor mauris vestibulum, efficitur
risus quis, auctor est. Aliquam erat volutpat. Praesent consectetur mattis libero ac
pellentesque. Suspendisse varius est eros, sed porttitor velit tincidunt vel. Vestibulum
sodales quam sem, sit amet fermentum tellus luctus a.
\end{tabularx}
\bigskip
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sagittis a metus nec pulvinar.
Quisque sed rhoncus dui. Proin eget nisi mi. Quisque tempor mauris vestibulum, efficitur
risus quis, auctor est. Aliquam erat volutpat.
\end{frame}
\end{document}
图像的默认对齐方式是在其基线处。降低它(使用负片\raisebox{<len>}
)会将其对齐到“文本列”的顶部。
您可以摆弄上面的字体或对齐方式选择。