
答案1
您可以使用wrapfigure
環境(來自wrapfig
包裹)。此環境會建立一個框,使主要文字環繞在其周圍。您可以指定此框的寬度及其位置(l
eft 或r
ight,以及雙面文件的i
nside 或utside)。o
此外,該封裝本身就包含懸垂寬度的規格。
\begin{wrapfigure}{<position: l, r, i, or o>}[<overhang width>]{<total width of the wrapfigure>}
<content of the wraping figure>
\end{wrapfigure}
\documentclass{article}
\usepackage{lipsum}
\usepackage{wrapfig}
\usepackage{xcolor}
\begin{document}
\lipsum[1]
\begin{wrapfigure}{r}[.1\textwidth]{.4\textwidth}%
\textbf{\sffamily\Large\textcolor{blue!50!black}{``Good things might come to those who wait\dots''}}%
\end{wrapfigure}
\lipsum[2-3]
\end{document}
原答案
此解決方案使用
parbox
內部wrapfigure
, 而不是 的本機懸垂選項wrapfig
。因此,它比上面編輯中建議的體積更大。
該解決方案使用環境wrapfigure
(來自wrapfig
包裹)。該包定義了一個文字環繞的浮動框。您可以指定此框的寬度及其位置(左側或右側):
\begin{wrapfigure}{<position: R or L>}{<width of the wrapfigure>}
<content of the wraping figure>
\end{wrapfigure}
我們用我們的報價填寫此框。為了使文字跨過邊距,我們將此文字放入另一個框內,一個parbox
,具有更寬的寬度與環境定義的相比wrapfigure
:
\parbox{<width of the box>}{<content of the box>}
\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{xcolor}
\begin{document}
\lipsum[1]
\begin{wrapfigure}{R}{.2\textwidth}%
\parbox{.4\textwidth}{%
\textbf{\sffamily\Large\textcolor{blue!50!black}{``Good things might come to those who wait\dots''}}%
}%
\end{wrapfigure}
\lipsum[2-3]
\end{document}
具有明確框的 MWE:
\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{showframe}
\begin{document}
\lipsum[1]
\begin{wrapfigure}{R}{.2\textwidth}%
\fbox{\parbox{.3\textwidth}{\textbf{\Large Good things might come to those who wait\dots}}}%
\end{wrapfigure}
\lipsum[2-3]
\end{document}