![Wrapfig 中的预定义设置](https://linux22.com/image/273968/Wrapfig%20%E4%B8%AD%E7%9A%84%E9%A2%84%E5%AE%9A%E4%B9%89%E8%AE%BE%E7%BD%AE.png)
我想使用:
\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}