使用 wrapfig 使文本对齐

使用 wrapfig 使文本对齐

这是我的文档: 在此处输入图片描述

我的文本对齐了,但留下了很大的空白 - 我该如何消除它。这是我的代码:

\documentclass{article}
\begin{document}
\begin{wrapfigure}{h!}{0.4\textwidth}
    \includegraphics[width=0.4\textwidth]{epsilon-delta.jpg}
    \label{fig:example_graph}
    \caption{this graph shows possible values of  $\delta$ for various choices of $\varepsilon>0$  for a given function $f(x$), a number $a$, and a limit $L$ at $a$. Note: $\delta \pm a$ does not need to map onto $L \pm \varepsilon$ through $f$.}
\end{wrapfigure} %figure wrapping problem

which means the limit of the function  $f$, as  $x$  approaches  $c$, is $L$ iff for all distances away from $L$, $\varepsilon$, there exist a distance from $c$, $\delta$, such that if $x$ is within $\delta$ of $c$ (but not at $c$) $f(x)$ is within $\varepsilon$ of $L$.\\

It also states that  for all $x \in (c-\delta,c+\delta) \cap  \text{dom}_{f} $ there exist a $y \in (L-\varepsilon,L+\varepsilon)$ such that $y=f(x)$. %evaluate usefulness

Remember:\\
$0 < |x-c| < \delta$ is equivalent to $ c - \delta < x < c + \delta \text{, } x \neq c$ and $|f(x) - L| < \varepsilon$ is equivalent to $L - \varepsilon < f(x) < L + \varepsilon$\\
\end{document}

答案1

您的文本被拉长完全是由于您以 结尾的段落\\。不要这样做。如果您想在段落之间留出空行,请这样做

\setlength\parskip\baselineskip

或者使用 parskip 包(在某些地方抑制大型 parskip)。

详细解释一下,\\在段落末尾放置 会创建一个强制换行符,换行符后的行上没有任何内容,因此空行会非常长。LaTeX 会对此发出警告 ( Underfull \hbox (badness 10000) in paragraph)。诀窍在于 TeX 会尝试保持段落的行“均匀”,因此它会使段落中的其他行非常长以匹配!

答案2

你试过吗\raggedright?它似乎可以满足你的需求。如果你只希望它部分应用,你应该这样做:

{\raggedright
which means the limit of....

}

为了获得更多控制,您可能需要尝试自己设置 \rightskip,例如:

\rightskip=0pt plus 10em

这将在右侧留出最多 10em(大约是字体高度的 10 倍)的空间(可能太多了)。

相关内容