報價超過保證金一半

報價超過保證金一半

我想在我的文件中新增引號,如下面的範本所示。理想情況下,這將是一個可以輕鬆多次使用的新環境。引文應該在頁邊距的一半處,以更大的粗體字體突出顯示文本中的關鍵事實。

知道我該如何實現這一目標嗎?

引用一邊

答案1

您可以使用wrapfigure環境(來自wrapfig包裹)。此環境會建立一個框,使主要文字環繞在其周圍。您可以指定此框的寬度及其位置(left 或right,以及雙面文件的inside 或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}

相關內容