LaTeX 分解了太多单词

发布于 2024-08-08 20:18:36 字数 108 浏览 5 评论 0原文

我用 LaTeX 编写了一个文档,使用两列格式、11pt、times 字体。我的许多单词都带有连字符,对于每个描述列表项,我都会收到 badbox 警告(尽管输出中没有可见问题)。我该如何解决这个问题?

I've written a document in LaTeX, using two-column format, 11pt, times font. Many of my words appear hyphenated, and for every description list item, I get a badbox warning (no problems visible in the output though). How can I fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

失退 2024-08-15 20:18:36

是的,虽然您可以让 TeX 不那么挑剔,甚至可以选择不合适的选项,但最好通过 microtype 包来解决这个问题。只需加载它就可以解决问题:

\usepackage{microtype}

它提供了两个功能来改进段落的排版:

  • 页边距字距调整:字符,尤其是标点符号,会将一小部分突出到页边距中。实际上,这会稍微增加线路长度,并且(IMO)视觉上看起来非常漂亮。
  • 字体扩展:除了拉伸/收缩单词之间的空间以创建齐平的段落之外,字符本身也会拉伸/收缩非常小的量(小于百分之一)。这在字符级别上在视觉上难以察觉,但令人惊讶的是,在段落级别上却产生了巨大的差异。

While, yes, you could make TeX less picky or even go the ragged option, this is best fixed by the microtype package. Just loading it should do the trick:

\usepackage{microtype}

It provides two features to improve the typesetting of paragraphs:

  • Margin kerning: characters, especially punctuation, will protrude a small fraction into the margin. Practically, this has the effect of very slightly increasing the line length and (IMO) visually looks very nice.
  • Font expansion: as well as stretching/shrinking the space between words to create a flush paragraph, the characters themselves are stretched/shrunk by very small amounts (less than one percent). This is visually imperceptible at the character level but, surprisingly, makes a huge difference at the paragraph level.
静水深流 2024-08-15 20:18:36

您应该在序言中的某处设置连字符惩罚:

\hyphenpenalty=750

750 的值适合我对 12 pt 字体的信纸(8.5x11 英寸)上的两列布局的需求。调整该值以满足您的需要。数字越大,连字符越少。您可能还想看看hyphenat包,它提供的不仅仅是连字符惩罚。

you should set a hyphenation penalty somewhere in your preamble:

\hyphenpenalty=750

The value of 750 suited my needs for a two column layout on letter paper (8.5x11 in) with a 12 pt font. Adjust the value to suit your needs. The higher the number, the less hyphenation will occur. You may also want to have a look at the hyphenatpackage, it provides a bit more than just hyphenation penalty.

朦胧时间 2024-08-15 20:18:36

我一直只是使用 \raggedright 来实现此目的,但我从未在整篇论文中这样做过。 此常见问题解答(这是我的首选 LaTeX 之一) resources)推荐使用 ragged2e 包。

哦,还有一个旁注:我从不注意坏盒子,除非我可以在输出中看到它们。这可能很愚蠢,但 LaTeX 比我挑剔得多。

I've always just used \raggedright for this, but I've never done that for an entire paper. This FAQ (which is one of my go-to LaTeX resources) recommends the ragged2e package.

Oh, and a side note: I never pay attention to bad boxes unless I can see them in the output. This is probably dumb, but LaTeX is much pickier than I am.

紫瑟鸿黎 2024-08-15 20:18:36

根据另一篇文章的答案,我发现了这些设置完美以完全防止连字符而不难看:

\tolerance=9999
\emergencystretch=10pt
\hyphenpenalty=10000
\exhyphenpenalty=100

\tolerance=9999 允许尽可能多的空白。

\emerencystretch=10pt 每行允许一些额外的空格。

\hyphenpenalty=10000 完全禁用连字符。

\exhyphenpenalty=100 允许使用已经存在的连字符。

Based on the answers from another post, I found these settings to be perfect to prevent hyphenation altogether without being ugly:

\tolerance=9999
\emergencystretch=10pt
\hyphenpenalty=10000
\exhyphenpenalty=100

\tolerance=9999 allows as much whitespace as possible.

\emerencystretch=10pt allows some extra whitespace per line.

\hyphenpenalty=10000 disables hyphens completly.

\exhyphenpenalty=100 allows using hyphens which were already present.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文