3

As a follow up to another question I would like to ask for help with the \hyphenation command. The following MWE illustrates the problem:

\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

The result is as follows:

enter image description here

Note that the word Tatjana is hyphenated, even though I included the line \hyphenation{Tatjana}. Also note that the result is different (correct), when declaring the command like this: \hyphenation{Tatjana Cunnigham}.

So, I'm guessing the second \hyphenation command somehow re-defines the first one? Is this really what's happening? If so, what can I do to prevent that?


UPDATE: So, I noticed that the behaviour of the hyphenation algorithm is non-deterministic, as the problems (a specific word – here Tatjana – being hyphenated, even though hyphenation for this word has been turned off by \hyphenation{Tatjana}) appear and disappear, when the compilation (context ...) is called repeatedly. Can anybody offer an explanation for this? Or, even better: a solution? (Refer to my comment below.)

2
  • Okay, will rephrase...
    – Marcus C.
    Sep 11, 2022 at 13:54
  • actually I just did the obvious thing and used two \hyphenation at that point and as you say, it fails, odd... Sep 11, 2022 at 13:56

1 Answer 1

3

The example works correctly on a recent ConTeXt (ver: 2022.08.25, tested with LMTX engine).

You can try if \startexceptions works better in the older version of ConTeXt (in the recent version, both \hyphenation and \startexceptions call the same internal lua function).

\startexceptions
  Tatjana
\stopexceptions

\startexceptions
  Cunningham
\stopexceptions

gives

enter image description here

3
  • Thank you very much for your answer. I realized only now that I am still using the older LuaTeX version of ConTeXt. And due to the fact that I also used the corresponding update procedure to keep my version updated (wget http://minimals.contextgarden.net/setup/first-setup.sh), I never noticed there was a newer one. I will do some reading and will report back...
    – Marcus C.
    Sep 14, 2022 at 15:30
  • Again, thank you very much for the suggestion to use a newer version of ConTeXt. I can now confirm that the LMTX version solves the hyphenation problems I had before. This question can be considered solved. :) (On the other hand: I'm still curious, as to what caused that non-deterministic behaviour?) Unfortunately, however, the new LMTX version causes a few new error messages, one of which I just posted as a new question.
    – Marcus C.
    Sep 14, 2022 at 18:00
  • @MarcusC. wiki.contextgarden.net/Humour#Where_is_my_update.3F
    – Aditya
    Sep 14, 2022 at 19:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .