为什么 Latex 会产生这种奇怪的输出?

为什么 Latex 会产生这种奇怪的输出?

这是我的代码。

\documentclass{article}

\begin{document}
    The substance used in this experiment is 1,1-diphenyl-2-picryl-hydrazyl (DPPH). This organic compound is a relatively stable free radical which has an unpaired valence electron at one atom of the nitrogen bridge which is the source of the paramagnetism of this compound. In a free nitrogen atom, 6 electrons pair off and contribute no orbital or spin angular momentum. Nor do these electrons as a whole have a net magnetic moment.
\end{document}

这是输出。

输出

为什么它没有得到适当的证实?

如果它是标准乳胶行为,那么我可以做哪些改变来使其正确对齐(合理)?

答案1

没有太多选择:

  • (DPPH)第一行没有位置。

  • 如果(DPPH)放在第二行,单词之间的间距就太大,无法得到令人满意的结果。

在这种情况下,软件包microtype(pdfTeX) 会有所帮助,因为它通过允许字母稍微缩小或拉伸来增加更多灵活性。这有助于减少第一行中的较大单词间空格:

\documentclass{article}
\usepackage{microtype}

\begin{document}
    The substance used in this experiment is 1,1-diphenyl-2-picryl-hydrazyl
(DPPH). This organic compound is a relatively stable free radical which has
an unpaired valence electron at one atom of the nitrogen bridge which is the
source of the paramagnetism of this compound. In a free nitrogen atom, 6
electrons pair off and contribute no orbital or spin angular momentum. Nor
do these electrons as a whole have a net magnetic moment.
\end{document}

结果

答案2

Latex 没有足够的地方可以调整字间距。在这些情况下,如果你的边距大小不是由别人决定的,我会重写或更改文本宽度。我一直在使用简单边距包装很久了。

更改 \textwidth:

\documentclass{article}

\usepackage{simplemargins}
\setleftmargin{1.75in}
\setrightmargin{1.75in}

\begin{document}
The substance used in this experiment is 1,1-diphenyl-2-picryl-hydrazyl (DPPH). This organic compound is a relatively stable free radical which has an unpaired valence electron at one atom of the nitrogen bridge which is the source of the paramagnetism of this compound. In a free nitrogen atom, 6 electrons pair off and contribute no orbital or spin angular momentum. Nor do these electrons as a whole have a net magnetic moment.

\end{document}

在此处输入图片描述

以下是重写版本:

\documentclass{article}

\begin{document}
In this experiment we used 1,1-diphenyl-2-picryl-hydrazyl (DPPH). This
organic compound is a relatively stable free radical which has an
unpaired valence electron at one atom of the nitrogen bridge which is
the source of the paramagnetism of this compound. In a free nitrogen
atom, 6 electrons pair off and contribute no orbital or spin angular
momentum. Nor do these electrons as a whole have a net magnetic
moment.
\end{document}

在此处输入图片描述

答案3

如果您不想重写文本,请使用sloppypar环境放宽段落的间距规则。

\documentclass{article}

\begin{document}
\begin{sloppypar}
    The substance used in this experiment is 1,1-diphenyl-2-picryl-hydrazyl (DPPH). This organic compound is a relatively stable free radical which has an unpaired valence electron at one atom of the nitrogen bridge which is the source of the paramagnetism of this compound. In a free nitrogen atom, 6 electrons pair off and contribute no orbital or spin angular momentum. Nor do these electrons as a whole have a net magnetic moment.
\end{sloppypar}
\end{document}

答案4

我认为问题的正确答案Overfull \hbox ...microtype,但仅供参考,特别是如果你使用xelatex(Heiko Oberdiek 的 MWE 不起作用),只需使用\emergencystretch1em(或者\setlength{\emergencystretch}{1em}对于纯粹主义者来说):

平均能量损失

\documentclass{article}
\emergencystretch1em
\begin{document}
The substance used in this experiment is 1,1-diphenyl-2-picryl-hydrazyl 
(DPPH). This organic compound is a relatively stable free radical which has an
unpaired valence electron at one atom of the nitrogen bridge which is the source
of the paramagnetism of this compound. In a free nitrogen atom, 6 electrons 
pair off and contribute no orbital or spin angular momentum. Nor do these
electrons as a whole have a net magnetic moment.
\end{document}

编辑

还有一些评论似乎对在第一行保留首字母缩略词感兴趣,除了文本或布局的变化,正如 Delia Ruby 所提议的那样,一个一般 包裹忍术解决方案可以microtype 通过合理设置选项来shrink

mwe2

\documentclass{article}
\usepackage[shrink=46]{microtype}
\begin{document}
The substance used in this experiment is 1,1-diphenyl-2-picryl-hydrazyl 
(DPPH). This organic compound is a relatively stable free radical which has an
unpaired valence electron at one atom of the nitrogen bridge which is the source
of the paramagnetism of this compound. In a free nitrogen atom, 6 electrons 
pair off and contribute no orbital or spin angular momentum. Nor do these
electrons as a whole have a net magnetic moment.
\end{document}

然而,最小值在这种情况下必须至少为 46,这似乎有点过分,所以这是否仅对这个 MWE 来说是个好主意......我持开放态度。

无论如何,值得注意的是,强烈的收缩可能仅限于有问题的段落:

\documentclass{article}
\usepackage{microtype}
\SetExpansion[context=bigformula,shrink=60]{encoding=OT1}{}
\begin{document}

Normal text that not need strong shrinking.

{\microtypecontext{expansion=bigformula} The substance used ... }

More text that not need strong shrinking.

\end{document}

相关内容