乳胶和换行符:为什么它不使用连字符?

乳胶和换行符:为什么它不使用连字符?
\documentclass[12pt, a4paper]{article}
\usepackage[margin=1in]{geometry}

\begin{document}

This text should not be indented.

This tex should be indented.

This text is veeeeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr yyyyyyyyyyyyyyyyyyyyyyYyQyyyyyyyyyyyyQ long, but should not be broken `tween `'y'' and `'long''.
This is not going too well.\  How do I know where the linebreak on the page should go?\ Is there a magic index that I cannot see?\ What is the issue, and where does it appear?\
\centerline{This is the center.}
\end{document}

首先,您好,敬礼。其次,我不明白为什么上面的输入没有用连字符连接我故意输入的超长 goulash。(是的,我知道引号是错误的,但我不认为这是问题所在。)

大写字母 Y 和 Q 在文本中仅用于辅助计算字符,并且不会出现在文档中。

我刚接触 LaTex 三天了,我也查阅过相关书籍和文章,但没有答案。

所以为什么?

PS 我把 放在\句子里是有原因的。但同样,它们不可能是错误。

答案1

TeX 无法将乱码用连字符连接起来,除非它偶然在伪词中找到一个或多个预加载的模式。

你可以用这个包检查一下 TeX 的连字符处理方法testhyphen。如果没有找到好的点,你必须通过添加\-适当的位置或定义连字符例外来帮助 TeX。

\documentclass[12pt, a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage{testhyphens}

\begin{document}

\section{Check hyphens}

\begin{checkhyphens}
veeeeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
yyyyyyyyyyyyyyyyyyyyyyYyQyyyyyyyyyyyyQ
\end{checkhyphens}

\section{Text}

This text should not be indented.

This tex should be indented.

This text is veeeeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr 
yyyyyyyyyyyyyyyyyyyyyyYyQyyyyyyyyyyyyQ long, but should not be broken 'tween 
``y'' and ``long''. This is not going too well.  How do I know where the 
linebreak on the page should go? Is there a magic index that I cannot see? 
What is the issue, and where does it appear?
\begin{center}
This is the center.
\end{center}

\end{document}

在此处输入图片描述

例子:

\documentclass[12pt, a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage{testhyphens}

\hyphenation{
  veeeeeeee-eeeeeeeeeeeeerrrrrr-rrrrrr-rrrrrr-rrrrrrrrr-rrrrrrrrrrrrrr
  yyyyyyyyy-yyyyyyy-yyyyyy-YyQyy-yyyyyyyyyyQ
}

\begin{document}

\section{Check hyphens}

\begin{checkhyphens}
veeeeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
yyyyyyyyyyyyyyyyyyyyyyYyQyyyyyyyyyyyyQ
\end{checkhyphens}

\section{Text}

This text should not be indented.

This tex should be indented.

This text is veeeeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr 
yyyyyyyyyyyyyyyyyyyyyyYyQyyyyyyyyyyyyQ long, but should not be broken 'tween 
``y'' and ``long''. This is not going too well.  How do I know where the 
linebreak on the page should go? Is there a magic index that I cannot see? 
What is the issue, and where does it appear?
\begin{center}
This is the center.
\end{center}

\end{document}

在此处输入图片描述

还有几点。

  1. 第一段在章节标题之后没有缩进。
  2. 开引号用 输入``,而不是用`'
  3. 之前的撇号twen应该是'
  4. \centerline不是 LaTeX 命令。
  5. 如果不想在标点符号后留出扩展空格,请\frenchspacing在序言中声明。

答案2

由于没有提到:您可以为不常见的单词声明连字符模式。例如,这是我自定义的开始hyphenation.tex,我将其\input放入我的所有文档中:

\hyphenation{
acet-a-mi-no-phen
ace-tyl-cho-lin-ester-ase
ace-tyl-cho-line
ace-tyl-glu-cos-amine
ade-no-syl-me-thi-o-nine
...
}

列出的每个单词中的每个破折号都可能成为连字符的潜在断点。效果非常好。

相关内容