为什么一行会超出右边距?

为什么一行会超出右边距?

我只是想为课堂排版一份 10 分钟的文档,但我的连字符决定它不受边距规则的约束。我该如何解决这个问题?

有趣的是,最小工作示例恰好是整个文档:

\documentclass[]{article}

%opening
\title{Slider Crank}
\author{mcmuffin6o}

\begin{document}

\maketitle

The slider crank is a simple mechanism that converts rotational motion into reciprocating translational motion or vice versa. It can be found most ubiquitously in internal combustion engines in the form of the piston-rod-crankshaft assembly. There are two singularities to note here: one at top dead center, and one at bottom dead center. In both cases, a finite torque at the rotational end will overcome any force at the translational end. Additionally, the rotational end can rotate either direction to escape the singularity, which means that additional constraints or inputs are required for predictable operation. In the case of the aforementioned internal combustion engine, the angular momentum of the piston-rod-crankshaft assembly reliably carries the mechanism through the singularity.

\end{document}

编辑:抱歉,没有提供关键信息或截图。见下文。

TeX 发行版:MiKTeX 22.8.28

编译命令:pdflatex -synctex=1 -interaction=nonstopmode "slider_crank".tex

截屏: 在此处输入图片描述

日志:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.8.28) (preloaded format=pdflatex 2022.9.7)  25 SEP 2022 21:06
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**./slider_crank.tex
(slider_crank.tex
LaTeX2e <2022-06-01> patch level 5
L3 programming layer <2022-08-23>
(/home/matt/.miktex/texmfs/install/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/home/matt/.miktex/texmfs/install/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
(/home/matt/.miktex/texmfs/install/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2022-08-23 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count193
\l__pdf_internal_box=\box51
)
(slider_crank.aux)
\openout1 = `slider_crank.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <12> on input line 10.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <8> on input line 10.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <6> on input line 10.

Overfull \hbox (12.88962pt too wide) in paragraph at lines 12--13
\OT1/cmr/m/n/10 ubiquitously in internal combustion engines in the form of the 
piston-rod-crankshaft
 []

[1

{/home/matt/.miktex/texmfs/data/fonts/map/pdftex/pdftex.map}]
(slider_crank.aux) ) 
Here is how much of TeX's memory you used:
 446 strings out of 479778
 8631 string characters out of 2875405
 305230 words of memory out of 3000000
 19203 multiletter control sequences out of 15000+600000
 472294 words of font info for 38 fonts, out of 8000000 for 9000
 0 hyphenation exceptions out of 8191
 34i,6n,38p,836b,192s stack positions out of 10000i,1000n,20000p,200000b,80000s
</home/matt/.miktex/texmfs/install/fonts/type1/public/amsfo
nts/cm/cmr10.pfb></home/matt/.miktex/texmfs/install/fonts/type1/public/amsfonts
/cm/cmr12.pfb></home/matt/.miktex/texmfs/install/fonts/type1/public/amsfonts/cm
/cmr17.pfb>
Output written on slider_crank.pdf (1 page, 41081 bytes).
PDF statistics:
 21 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

答案1

一般来说,如果 TeX 无法找到一种好的方法将段落分成几行,同时又不超出拉伸空白的限制,它可能会像您展示的那样产生一个过满的框,文本会粘在边距中。它总是在日志中警告这种情况。

如果发生这种情况,您可以使用\sloppy(这会增加空间可以伸展的量,并增加对稍微过度伸展空间的容忍度)或仅设置\emergcystretch(这比更不草率\sloppy)或使用microtype允许 pdftex 除了伸展空白之外还可以对字符宽度进行细微的调整。

但所示示例不应造成盒子过满:

在此处输入图片描述

请注意,要找到一个好的断字符,它会使用连字符ubiquitouslyadditional。但是您的系统没有做到这一点。您可以通过选择一种未定义连字符的新语言来强制不使用连字符。

\newlanguage\qqq\language=\qqq例如添加。

然后标准 LaTeX 就会生成您所显示的输出。

我猜是您在 miktex 更新时出错,tex 在构建格式时无法找到默认的美式英语连字模式。由于连字模式只能以该格式加载,因此您需要强制 miktex 重建所有格式才能解决此问题。

您可以通过添加\showhyphens{ubiquitously}并检查日志来检查这个猜测,它应该显示

[] \OT1/cmr/m/n/10 ubiq-ui-tously

并不是

[] \OT1/cmr/m/n/10 ubiquitously

缺少连字符会影响所有文档,而不仅仅是所显示的段落。

答案2

哎呀,这个问题重复了。使用\emergencystretch 3em来自这个问题工作完美。

(谢谢@frabjous!)

相关内容