ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Arthur Reutenauer <arthur.reutenauer@normalesup.org>
To: Mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: optional hyphenation patterns in ancient Greek
Date: Mon, 25 Mar 2019 15:09:52 +0100	[thread overview]
Message-ID: <20190325140952.hp7yqojl72fiua3h@phare.normalesup.org> (raw)
In-Reply-To: <427e465c-200d-786e-a0a8-13208b1c5662@gmx.es>

[-- Attachment #1: Type: text/plain, Size: 2488 bytes --]

	Dear Pablo,

  Five months ago I sent you a private email with detailed explanations
of how you can achieve that in ConTeXt.  I suggest you go through that
first before we start talking about a new pattern set.  Here is the
email, with a few updates (the paragraph quoted at the top is by
myself).

----
Date: Thu, 25 Oct 2018 15:05:17 +0200
From: Arthur Reutenauer <arthur.reutenauer@normalesup.org>

>   In LuaTeX it’s now possible to inject patterns on the fly, at
> typesetting time. I admit to not knowing if ConTeXt has a special way to
> take advantage of that; it’s a simple command in pure LuaTeX.  It would
> also be necessary to change a few patterns in the current set, because
> they would interact badly with 2γ1μ.  More on that tomorrow.

  OK, so here goes.

  It is not possible to just use \patterns in the middle of a Mark IV
run, because Hans deactivates it (in lang-ini.mkiv) -- clearly a remnant
from Mark II, as in pdfTeX and XeTeX it would have resulted in an error;
in ConTeXt it just becomes a no-op, which thus shadows LuaTeX’s
behaviour that could actually have been useful.

  The situation in Mark IV is documented in languages-mkiv.pdf which is
part of the distribution: Hans rewrote the whole hyphenation routine in
Lua in 2014, and users can switch to it with

	\setuphyphenation[method=traditional]

  The idea behind the name is apparently that the Lua code mimics the
“traditional” way implemented in the TeX engine, and Hans envisages that
other methods can be written in the future (but this hasn’t happened
yet).  The non-Lua method is on by default and can be chosen explicitly
with \setuphyphenation[method=default] but it is not possible to inject
new patterns that way because of the above.

  With the Lua method activated, it becomes possible to add patterns on
the fly with

	\registerhyphenationpattern[agr][2γ1μ]

  Some care should be taken when adding patterns to an existing set, since
they can -- and in this case do -- interact with other patterns in the set.
Here, I’ve found that this row of patterns (l. 516 of the master file,
https://github.com/hyphenation/tex-hyphen/blob/82e5651/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-grc.tex#L516):

	4γμ' 4γμ’ 4γμʼ 4γμ᾽ 4γμ᾿

needs to be overridden with patterns such as

	γ2μ' γ2μ’ γ2μʼ γ2μ᾽ γ2μ᾿

otherwise the new pattern would allow breaks before the mu.

  The attached file puts everything together.
----

	Best,

		Arthur

[-- Attachment #2: add-patterns-on-the-fly.tex --]
[-- Type: text/x-tex, Size: 377 bytes --]

\mainlanguage[agr]
\definefont[linuxlibertine][name:linlibertineo]
\starttext

\hsize=1pt

\linuxlibertine
πρᾶγμα πράγματος

\setuphyphenation[method=traditional]
\registerhyphenationpattern[agr][2γ1μ γ2μ’]

πρᾶγμα πράγματος

πραγμ’ ἄτος % Without the second pattern above, we get the incorrect break πραγ-μ’

\stoptext

[-- Attachment #3: add-patterns-on-the-fly.pdf --]
[-- Type: application/pdf, Size: 7885 bytes --]

[-- Attachment #4: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2019-03-25 14:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-24 16:38 Pablo Rodriguez
2019-03-25 14:09 ` Arthur Reutenauer [this message]
2019-03-25 19:57   ` Pablo Rodriguez
2019-03-26  8:42     ` Arthur Reutenauer
2019-03-30 14:40       ` Pablo Rodriguez
2019-03-31 20:18         ` Wolfgang Schuster
2019-03-31 20:55           ` Pablo Rodriguez
2019-04-03 14:14             ` Arthur Reutenauer
2019-04-22  8:29               ` Pablo Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190325140952.hp7yqojl72fiua3h@phare.normalesup.org \
    --to=arthur.reutenauer@normalesup.org \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).