我有以下代码,试图用一些以来自包bbding
和的符号开头的句子包装图像utfsym
。使用和其他符号包时可能会出现问题。如果我使用来自包的任何符号或来自带有等命令的包bbding
的符号,则包无法“剪切”文本行,并且它们会覆盖图像。为什么会发生这种情况,我们如何解决?这是 MWE:utfsym
\large
\Large
wrapfig2
\documentclass[12pt]{article}
\usepackage[a4paper, total={180mm,257mm},left=15mm,top=20mm]{geometry}
\usepackage{utfsym,bbding,wrapfig2}
\begin{document}
\begin{wrapfigure}[7]{r}{0.4\textwidth}
\begin{center}
\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{2pt}%
\vspace{-6mm}
\fbox{\includegraphics[width=0.33\textwidth]{example-image}}
\end{center}
\caption{\footnotesize Example image}
\end{wrapfigure}
\usym{1F4D6} This is a test sentence \dotfill
\usym{1F4D7} This is a test sentence \dotfill
\usym{1F4E1} This is a test sentence \dotfill
{\large \usym{1F4D6}} This is a test sentence \dotfill
\PencilRightDown \dotfill
\dotfill
\end{document}
答案1
wrapfig 必须在段落开头更改段落的形状。如果开头位于组内,此代码将失败。(bbding 命令无需先离开 vmode 即可打开组)。使用 \leavevmode 开始段落:
\documentclass[12pt]{article}
\usepackage[a4paper, total={180mm,257mm},left=15mm,top=20mm]{geometry}
\usepackage{utfsym,bbding,wrapfig2}
\begin{document}
\begin{wrapfigure}[7]{r}{0.4\textwidth}
\begin{center}
\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{2pt}%
\vspace{-6mm}
\fbox{\includegraphics[width=0.33\textwidth]{example-image}}
\end{center}
\caption{\footnotesize Example image}
\end{wrapfigure}
\usym{1F4D6} This is a test sentence \dotfill
\usym{1F4D7} This is a test sentence \dotfill
\usym{1F4E1} This is a test sentence \dotfill \par
\leavevmode{\large \usym{1F4D6}} This is a test sentence \dotfill
\leavevmode\PencilRightDown \dotfill
\dotfill
\end{document}