段落之间随机出现不需要的空格

段落之间随机出现不需要的空格

我使用 pdflatex(版本 3.1415926-1.40.10 (Web2C 2009))和回忆录从 XML 生成 LaTeX 代码,用于我正在编写的一本书。很少情况下,两个段落之间似乎有一个额外的空白行。我无法在这些事件中发现任何规律。

所有试图在小示例中隔离问题的尝试都会导致问题消失(这可能是一个线索,尽管我还没有弄清楚)。另一个线索是,不需要的空间似乎出现在全部发生这种情况时,页面上的段落会消失(但这种情况很少发生,这可能是一个意外)。我想 LaTeX/memoir 甚至可能故意增加垂直空间,尽管我看不出这样做对当前页面或下一页有什么好处。

由于缺乏 MWE,我举了一个例子没有显示问题,但在完整文档的上下文中确实如此(主要是希望其中有一些奇怪的事情,我已经做过但就是找不到)。它包括附加了不需要的垂直空间的段落之前和之后的段落。奇怪的约定是由于机器从 XML 生成的。问题似乎发生在书中数百页中的 2% 左右。请注意,在这个上下文示例中,如果 LaTeX 在页面上多挤了几行,就不会有孤儿的危险——还有 9 行段落被推到了下一页。

对于如何找到这个问题,我深表感谢。

\documentclass{memoir}% http://ctan.org/pkg/memoir
\usepackage[strict=true]{csquotes}
\usepackage{refcount}
\begin{document}
\par{This problem permeates the U.S. today, now aided and abetted by all
    the wonderful inventions of computer programmers.
    In the past, your doctor was the gatekeeper for information on medical research;
    now, you can read a nearly hourly spew of breaking medical research results,
    which so often contains contradictions that many people throw up their
    hands and conclude that everything known to man is unhealthy.
    In the past, peer-reviewed journals were the gatekeeper for information
    on a science as specialized as climatology;
    now, oil companies can
    (\label{id155638}in a modernization of the techniques tobacco companies used
    to refute the connection of cancer to cigarettes\setcounter{pagenote}{0}\pagenote[\pageref{id155638}]{{\itshape in a modernization of the techniques tobacco companies used
    to refute the connection of cancer to cigarettes}: \citep[]{b:ClimateCoverUp}})
    fund and publicize anyone with the slightest scientific credentials
    who happens to support the view that preserves their profits.
    The ever-increasing specialization of science and technology
    long ago overwhelmed the ability of television/radio/print
    journalism to act as information gatekeepers,
    so it's even possible by financing alone to successfully
    project the view that there is little or no consensus on
    anything in climatology!
    Whether you would like to believe that men have never walked on the moon,
    that aliens are routinely abducting us for humiliating probes,
    or that the government's High Frequency Active Auroral Research Program
    (HAARP) is actually controlling both the weather and people's minds,\footnote{\label{FN:id153808}Google reports 288,000 results for the search phrase \enquote{foil hat,} a popular device for defeating mind controlling radiation
        allegedly broadcast by both aliens and the government.
        Featured was \label{FN:id153819}the provocative MIT study showing that foil hats may actually \textit{amplify} RF signals
        in specific frequency ranges controlled by the government and multi-national corporations.
        Google quite fairly also features \label{FN:id153830}the author of a book on tin foil hat construction who disputes the MIT finding.
        Thus, Google does act as a kind of gatekeeper for information,
        but only in a narrow technical sense;
        coherence and meaning-making are not part of their business model,
        and would likely only produce sub-optimal profits anyway.}
    you are just a few mouse clicks away from vast amounts of information
    (and forums of like-minded believers) supporting your inclinations. \setcounterref{pagenote}{FN:id153808}\pagenote[\pageref{FN:id153819}]{{\itshape the provocative MIT study showing that foil hats}: \citep[]{w:EffectivenessFoilHelmets}}\setcounterref{pagenote}{FN:id153808}\pagenote[\pageref{FN:id153830}]{{\itshape the author of a book on tin foil hat construction}: \citep[]{w:AFDBEffectiveness}} More disturbing,
    you can now find on the Internet social support for your
    darkest impulses; for example, \label{id153840}your teenager can learn that anorexia
    is not a psychological disorder, but a healthy lifestyle choice.\setcounter{pagenote}{0}\pagenote[\pageref{id153840}]{{\itshape your teenager can learn that anorexia
    is not a psychological disorder, but a healthy lifestyle choice.}: \citep[pp. 199-201]{b:VirtuallyYou}}}%
\par{But the picture of less-educated masses being flummoxed by
    too much uncontrolled information from on high is patronizing and incomplete.
    The information tsunami disorients all levels of education and expertise.
    For example, \label{id153853}the oncogene theory
    (that particular cancers are caused by mutations in particular genes)
    is a theory in crisis\setcounter{pagenote}{0}\pagenote[\pageref{id153853}]{{\itshape the oncogene theory
    (that particular cancers are caused by mutations in particular genes)
    is a theory in crisis}: \citep[pp. 45-104]{b:WhatIsLifePertinence}}, being overwhelmed by a flood of new
    molecular information.
    Alleged oncogenes are now found everywhere, and vary not just
    from one cancer type to another, but from one patient to another
    (which helps explain why the genetic revolution has been a dismal
    failure at reducing cancer mortality).
    There is a growing sense, amidst the relentless stream of new information,
    that researchers have lost sight of the forest for the trees.
    Many modern problems, like cancer,
    likely involve complex networks that contain feedback systems,
    and information floods make us prone to a neverending
    twitchy response to each individual reductionist
    piece of the problem as it is uncovered,
    unable to stop and see how it all fits together
    (partly because it fits together into a complex, messy,
    difficult-to-control system.)}%
\par{\label{id153868}Physicist Robert Laughlin
    points out that the economics of information is changing,\setcounter{pagenote}{0}\pagenote[\pageref{id153868}]{{\itshape Physicist Robert Laughlin
    points out that the economics of information is changing,}: \citep[]{b:CrimeOfReason}} a crescendo that has become much more audible in the years since Postman's death.
    When information, once acquired, can be transferred so easily
    (often without paying the creator of that information)
    then there is more incentive to create less valuable, disposable information.
    If the profits from my hard-won, published deep thoughts about programming
    decay more quickly due to file sharing,
    then the sensible thing to do is publish much
    more easily obtained shallow knowledge much more often,
    a learned response clearly visible at any local bookstore,
    and amplified in the electronic book arena,
    where prices are often driven down to the logical extreme of \$0.00.
    Evidence of disposable information from the more than
    one million titles in Amazon's \enquote{Kindle Store} includes e-books about murderers whose trials are still ongoing.
    Software, of course, is also a form of knowledge,
    and economics is also driving increasingly disposable information there.
    Why spend years trying to create software that could aid
    medical research when you can spend a few weeks creating a game
    for an \enquote{app store} that might turn out to be the next \enquote{Angry Birds}?
    Although some developers chafe at the degree of information control
    Apple exerts on their \enquote{app store} (a game that used the built-in accelerometer to let you play \enquote{How High Can I Throw My iPhone?} was rejected),
    the fact that Apple approved 14 iPhone fart applications
    (with more than one being named \enquote{Pull My Finger})
    in a single day reveals the real state of affairs.}%
\end{document}

不需要的 vspace

答案1

natbib我运行了你的代码。(顺便说一句,除非和包也加载,否则你的不太简单的示例无法编译pagenote。)至少在你提供的例子中,确实存在“段落间粘合过度”的问题,证实了@Marco的猜测。我能想到三种解决这个问题的方法:

  • 您可以在文档的序言中发出以下命令:

    \raggedbottom

    这将使文本块的高度因页面而异。如果您的文档要采用双面排版(又称书本式)且页面对开,从排版角度来看,结果可能看起来不太好。

  • 一个更优雅的解决方案(从印刷角度来看)包括插入命令

    \usepackage[bottom]{footmisc}

    (也在序言中)。这样做会在正文和脚注规则之间插入额外的空白,而不是过度拉伸段落间粘连。当然,如果给定的页面没有任何脚注并且只有一个段落分隔符,这种方法就没用了。

  • 第三个解决方案,至少在我看来,更好的解决方案是将文本分成更多但更短的段落这样做可以提高文本的可理解性减少您所描述的问题发生的风险。

    您提供的示例代码有一整页,仅包含两个非常长的段落和一个相当长的脚注。如果您将这两个长段落分成两个(最好是三个)较短的段落,LaTeX 在构建页面时将拥有更大的自由度,从而大大降低了 LaTeX 不得不过度拉伸段落间粘合的可能性。

答案2

我也遇到这个问题。我确实有脚注,但没有使用\par

尝试过\usepackage[bottom]{footmisc}- 但没有任何效果

然后尝试了不优雅的方法\raggedbottom - 有效

顺便说一句,就我而言,只有最后一页出现了问题……

答案3

我时不时会遇到同样的问题,并且遇到了这个问题。 \raggedbottom 提供了一个解决方案,但并非总是如此。我确实发现了一些奇怪的行为,如果一个段落以索引引用结尾,即:

This is the last sentence of the paragraph.\index{Paragraph}<CR><CR>
This is a new paragraph.

两段之间会有一个空行。第二段以正常缩进开始。

如果我移动索引引用,使其不立即放置在双回车符之前,幻影线就会消失。我不知道幻影线是否是由于段落末尾出现其他 LaTex 代码而产生的。

答案4

另一个选项是使用 \phantom{x} 在页面底部创建一个带间隙的虚拟段落。如果在正确的位置使用,这种方法可以很好地发挥作用。

相关内容