如何使用 ConTeXt 中的 `\hyphenation` 命令添加进一步的定义?

如何使用 ConTeXt 中的 `\hyphenation` 命令添加进一步的定义?

作为后续行动另一个问题我想请求有关\hyphenation命令的帮助。以下 MWE 说明了该问题:

\defineframedtext[secondary][
  frame=off,
  leftframe=on,
  framecolor=lightgray,
  rulethickness=6pt,
  offset=none,   % 0pt,
  loffset=6pt,
  indenting=no,
  align=flushleft,
  style=\em,
]

% ----------

\hyphenation{Tatjana}
\hyphenation{Cunningham}

% ----------

\starttext

\section{Testing hyphenation}

\startsecondary

I consider myself fortunate to be in friendship with Tatjana Cunningham. We met in 2018
at the renovated farm in Yorkshire, where the painter has been living with his wife for
the last 30 years. I consider myself very fortunate to be in close friendship with
Tatjana Cunningham. We met in 2018 at the renovated farm in Yorkshire, where the painter
has been living with his wife for the last 30 years.

\stopsecondary

I consider myself very fortunate to be in close friendship with Tatjana Cunningham.
We met in 2018 at the renovated farm in Yorkshire, where the painter has been living with
his wife for the last 30 years. I consider myself very fortunate to be in close friendship
with Tatjana Cunningham. We met in 2018 at the renovated farm in Yorkshire, where the
painter has been living with his wife for the last 30 years.

\stoptext

结果如下:

在此处输入图片描述

请注意,尽管我添加了这一行,但 Tatjana 一词还是带连字符的\hyphenation{Tatjana}。还请注意,当像这样声明命令时,结果是不同的(正确的)\hyphenation{Tatjana Cunnigham}

因此,我猜第二个\hyphenation命令以某种方式重新定义了第一个命令?这真的是正在发生的事情吗?如果是这样,我该怎么做才能防止这种情况发生?


更新:因此,我注意到连字算法的行为是非确定性的,作为问题(一个特定的词——这里塔季扬娜– 被连字符连接,即使该单词的连字符连接已被关闭\hyphenation{Tatjana}) 出现并消失,当编译 ( context ...) 被重复调用时。有人能解释一下吗?或者更好的是:解决方案?(请参阅我的评论以下。)

答案1

该示例在最新的 ConTeXt(版本:2022.08.25,使用 LMTX 引擎测试)上正常运行。

你可以尝试\startexceptions在旧版本的 ConTeXt 中运行得更好(在最新版本中,\hyphenation\startexceptions都调用相同的内部 lua 函数)。

\startexceptions
  Tatjana
\stopexceptions

\startexceptions
  Cunningham
\stopexceptions

给出

在此处输入图片描述

相关内容