LaTeX 有时会在句号后放置太多或太少的空间
LaTeX 尝试猜测句号是否结束一个句子,在这种情况下,它会在句号后面添加额外的空格。 下面是两个猜测错误的例子:(
I watched Superman III. Then I went home.
“Superman III”之后的空格太少。)
After brushing teeth etc. I went to bed.
(“etc.”之后的空格太多。)
请注意,自 LaTeX 以来,在 LaTeX 源代码中使用多少空格并不重要。忽略这一点。
LaTeX tries to guess whether a period ends a sentence, in which case it puts extra space after it.
Here are two examples where it guesses wrong:
I watched Superman III. Then I went home.
(Too little space after "Superman III.".)
After brushing teeth etc. I went to bed.
(Too much space after "etc.".)
Note that it doesn't matter how much whitespace you use in the LaTeX source since LaTeX ignores that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在这里找到了答案:http://john.regehr.org/latex/。摘录:
当非句尾句号后跟空格时,空格必须是明确的空格。
因此,第二个示例应该是:
当输入中的大写字母位于句尾句点之前时,会发生此问题的相反情况,如第一个示例所示。
在这种情况下,LaTeX 假定句点终止一个缩写,并在其后面跟随词间空格而不是句子间空格。
解决方法是将“
\@
”放在句号之前。所以第一个例子应该是
找到这个错误的一个方便的方法是:
I found the answer here: http://john.regehr.org/latex/. Excerpt:
When a non-sentence-ending period is to be followed by a space, the space must be an explicit blank.
So the second example should be:
The converse of this problem happens when a capital letter precedes a sentence-ending period in the input, as in the first example.
In this case LaTeX assumes that the period terminates an abbreviation and follows it with inter-word space rather than inter-sentence space.
The fix is to put "
\@
" before the period.So the first example should be
A handy way to find this error is:
如果您喜欢在句子末尾添加单个空格,则可以回避间距问题:将
\frenchspacing
打开(对于旧版本的 Latex,这是一个脆弱的命令)。高德纳遵循传统的命名方式,将其称为法式间距,尽管在句子后称双倍间距法式间距已在出版业中占据主导地位。Dirk Margulis 写了一篇很好的文章,总结了单间距盛行的一些原因: 句子之间有空格。
You can sidestep the spacing issue if you prefer single spaces at the end of sentences: put
\frenchspacing
on (for older versions of Latex this was a fragile command). Knuth was following the traditional naming in calling it French spacing, although calling double spacing after sentences French spacing has become dominant in publishing.Dirk Margulis wrote a nice post summarising some of the reasons for the prevalance of single spacing: Space between sentences.
我也喜欢 drreves 的答案和他建议的便捷搜索。我没有 Stackoverflow “rep” 点来评论,但是...
由于原始 *.tex 中的行往往很长,因此 grep 的输出可能会很庞大(即整个段落);我建议采用一种变体,仅显示以“[AZ]”结尾的单词。 (后跟一个或多个空格,后跟一个新的大写单词)。这是,
I like the answer from dreeves and the handy search he suggests too. I don't have the Stackoverflow "rep" points to comment, but...
Since lines in raw *.tex tend to be very long, the output from grep can be overwhelming (i.e., entire paragraphs); I suggest a variation to only display the words ending in '[A-Z].' (followed by one or more space, followed by a new capitalized word). It is,