环境enumerate
和其星号对应的环境enumerate*
在 下的行为略有不同\hypertarget
。后者enumerate*
会增加不必要的水平间距。
以下描述性 MWE
\documentclass[12pt]{book}
\usepackage[shortlabels, inline]{enumitem}
\usepackage[hypertexnames=false]{hyperref}
\begin{document}
Compare and contrast
\begin{enumerate}
\item \hypertarget{spacing-nostar-correct-1}{} No extra space here.
\item \hypertarget{spacing-nostar-correct-2}{} Nor any extra space here.
\end{enumerate}
with the following:
\begin{enumerate*}
\item \hypertarget{spacing-star-incorrect-1}{} An extra space here. %% <<- Notice the space after hypertarget in code.
\item \hypertarget{spacing-star-incorrect-2}{} And an extra space here.
\end{enumerate*} %% <<- Notice the space after hypertarget in code.
and with:
\begin{enumerate*}
\item \hypertarget{spacing-star-correct-1}{}No extra space here.
\item \hypertarget{spacing-star-correct-2}{}Nor any extra space here.
\end{enumerate*}
\end{document}
预期间距用绿色矩形标记,非预期间距用红色菱形标记。当空格出现\hypertarget
在 中enumerate*
但未出现在 中时,会添加一些额外间距enumerate
。
有什么比手动删除代码中的间距更好的解决方案吗?