奇怪的垂直空白

奇怪的垂直空白

排版:

\documentclass[a4paper]{report}
\usepackage{amsmath,mathptmx,hyperref}
\usepackage[top=3cm, bottom=3.5cm, outer=4cm, inner=4cm, marginparsep=0.7cm, marginparwidth=1.5cm]{geometry}
\newtheorem{teor}{Teorema}

\begin{document}

\noindent Proseguendo su queste cose, parliamo di Decomposizione in Parte Libera e Parte di Torsione.
\begin{teor}
\end{teor}
\end{document}

产量:

使用 hyperref

而没有hyperref我得到:

无超链接

定理和顶行之间的垂直空间明显较小。如果我用另一行替换定理,例如\par s,我不会得到很大的垂直空间。为什么会发生这种情况?

更新:

按照 egreg 的回答,我尝试加载amsthm,得到了一个奇怪的错误。确切地说,排版:

\documentclass[a4paper]{report}
\usepackage{thmtools,amsthm,hyperref}
\newtheorem{defi}{Definizione}

\begin{document}


\renewcommand\listtheoremname{Definizioni, Teoremi, Proposizioni, ecc.}
\listoftheorems[ignoreall,show={defi}]
\end{document}

产量:

This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013)
 restricted \write18 enabled.
entering extended mode
(./gungugungu4.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 78 languages loaded.
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/report.cls
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thmtools.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-patch.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/parseargs.sty))
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-kv.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-autoref.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/aliasctr.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/carlisle/remreset.sty)))
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-listof.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-restate.sty))
(/usr/local/texlive/2013/texmf-dist/tex/latex/amscls/amsthm.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(/usr/local/texlive/2013/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/auxhook.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/kvoptions.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/local/texlive/2013/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
(/usr/local/texlive/2013/texmf-dist/tex/latex/url/url.sty))

Package hyperref Message: Driver (autodetected): hxetex.

(/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/hxetex.def
(/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/puenc.def)
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/stringenc.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))
(./gungugungu4.aux)

Package thmtools Warning: amsthm loaded after thmtools .


Package thmtools Warning: ntheorem loaded after thmtools .

(/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(./gungugungu4.out) (./gungugungu4.out)

Package hyperref Warning: Rerun to get /PageLabels entry.

./gungugungu4.tex:9: Extra \else.
\@forloop ...lse #5\def #4{#2}\ifx #4\@nnil \else 
                                                  #5\@iforloop #3\@@ #4{#5}\...
l.9 \listoftheorems[ignoreall,show={defi}]

加载中thmtools amsthm解决所有问题,并消除hyperref收益:

This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013)
 restricted \write18 enabled.
entering extended mode
(./gungugungu4.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 78 languages loaded.
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/report.cls
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thmtools.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-patch.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/parseargs.sty))
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-kv.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-autoref.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/aliasctr.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/carlisle/remreset.sty)))
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-listof.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/thmtools/thm-restate.sty))
(/usr/local/texlive/2013/texmf-dist/tex/latex/amscls/amsthm.sty)
(./gungugungu4.aux)

Package thmtools Warning: amsthm loaded after thmtools .


Package thmtools Warning: ntheorem loaded after thmtools .

./gungugungu4.tex:9: Missing \endcsname inserted.
<to be read again> 
                   \relax 
l.9 \listoftheorems[ignoreall,show={defi}]

为什么会发生这种情况?

答案1

你运气不好。由于\newtheorem内核中的实现,在某些情况下那是什么由 生成的hyperref是在无法删除段落末尾空格的地方发出的(由 后的行尾生成Torsione.)。

以下是一组示例。

\documentclass[a4paper]{report}
\usepackage{amsmath,mathptmx,hyperref}
\usepackage[top=3cm, bottom=3.5cm, outer=4cm, inner=4cm, marginparsep=0.7cm, marginparwidth=1.5cm]{geometry}
\newtheorem{teor}{Teorema}

\begin{document}

\noindent Proseguendo su queste cose, parliamo di Decomposizione in Parte Libera e Parte di Torsione.
\begin{teor}
\end{teor}

\noindent Proseguendo su questo, parliamo di Decomposizione in Parte Libera e Parte di Torsione.
\begin{teor}
\end{teor}

\noindent Proseguendo su queste cose, parliamo di Decomposizione in Parte Libera e Parte di Torsione.

\begin{teor}
\end{teor}

\end{document}

在此处输入图片描述

因此,您会发现问题是由于行结束得太靠近右边距而导致的,因为在第二种情况下不会发生这种情况。

解决方法:在 之前总是留一个空行\begin{teor},这也更有利于打字稿的可读性。

替代解决方案:同时加载amsthm

\documentclass[a4paper]{report}
\usepackage{amsmath,amsthm,mathptmx,hyperref}
\usepackage[top=3cm, bottom=3.5cm, outer=4cm, inner=4cm, marginparsep=0.7cm, marginparwidth=1.5cm]{geometry}
\newtheorem{teor}{Teorema}

\begin{document}

\noindent Proseguendo su queste cose, parliamo di Decomposizione in Parte Libera e Parte di Torsione.
\begin{teor}
\end{teor}

\noindent Proseguendo su questo, parliamo di Decomposizione in Parte Libera e Parte di Torsione.
\begin{teor}
\end{teor}

\noindent Proseguendo su queste cose, parliamo di Decomposizione in Parte Libera e Parte di Torsione.

\begin{teor}
\end{teor}

\end{document}

在此处输入图片描述

但我仍然建议使用第三种方式输入代码。

相关内容