Wrapfig 中的预定义设置

Wrapfig 中的预定义设置

我想使用:

\begin{wrapfigure}{r}[Xcm]{Ycm}
\itshape
\SomeSymbolHere\\
\fontsize{16}{16}
\textbf{bla bla bla.}
\end{wrapfigure}

在我的文档中多次,最好写一些类似 \mywrap{bla bla bla.} 的内容。我想我\renewcommand也必须以某种方式调用。根据文档1第 3 页,我们应该能够实现其中的一些:

\setlength{\wrapoverhang}{\marginparwidth}
\addtolength{\wrapoverhang}{\marginparsep}

但这对我来说不起作用。但是我该如何添加上述所有设置呢?

答案1

您可以将其全部放入一个新命令中,并为文本添加一个参数:

示例输出

\documentclass{article}

\usepackage{wrapfig}

\newcommand{\mywrap}[1]{\begin{wrapfigure}{r}[1cm]{3cm}
\itshape
\rule{1cm}{1cm}\par
\fontsize{16}{18}\selectfont
\textbf{#1.}
\end{wrapfigure}}

\begin{document}

\mywrap{Blurb} Some text.  Some text.  Some text.  Some text.  Some
text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.  Some text.  Some text.  Some text.  Some text.
Some text.  Some text.

\end{document}

相关内容