From: "Tomáš Hála" <mendelu@thala.cz>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: italian words with apostrophe - hyphenation and discretionary
Date: Tue, 22 Oct 2024 15:33:21 +0200 [thread overview]
Message-ID: <20241022133321.GC4178@thala.cz> (raw)
In-Reply-To: <c9e2996d-2960-4934-9f01-15d8e6e99182@fastwebnet.it>
Hi Massi,
I do not know if there is the completely automated solution but I guess
that the following code might help you, the #3 way with \definetextmodediscretionary
seems the best to me.
Tomáš
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% APOSTROPHE, HYPHENATED
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For number 3 you need:
\definetextmodediscretionary l' {\discretionary{-}{l'}{l'}}
%\definetextmodediscretionary l’ {\discretionary{-}{l’}{l’}}
\def\mycmd{\par\thinrule
\par 1.~\discretionary{nel-}{l'opera}{nell'opera}
\par 2.~nel\discretionary{-}{l'}{l'}opera
\par 3.~nel|l'|opera
}
\starttext
\hsize10cc \par \mycmd
\hsize1dd \par \mycmd
\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FULL WORDS, NO HYPHENATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For number 3 you need:
\definetextmodediscretionary ' {\discretionary{a}{}{'}}
%\definetextmodediscretionary ’ {\discretionary{a}{}{’}}
\def\mycmd{\par\thinrule
\par 1.~\discretionary{nella}{opera}{nell'opera}
\par 2.~nell\discretionary{a}{}{'}opera
\par 3.~nell|'|opera
}
\starttext
\hsize10cc \par \mycmd
\hsize1dd \par \mycmd
\stoptext
On Tue, Oct 22, 2024 at 01:59:10PM +0200, mf wrote:
> Hello list,
>
> I'd like to know how to specify the following rules of the Italian language.
>
> Feminine words starting with a vowel change the preceding indefinite
> article ending with a vowel: the article loses the ending vowel,
> that is replaced by an apostrophe. Example:
>
> una opera => un'opera ("a work", but also "an opera")
> una opera => un’opera (with the unicode curly single quote)
>
> In case of definite articles, that is true also for masculine words
> starting with a vowel.
>
> la opera => l'opera ("the work", also "the opera", feminine)
>
> lo operaio => l'operaio ("the worker", masculine)
>
> This extends to articulate prepositions (preposition+article), like
>
> nella opera => nell'opera ("in the work", "in the opera")
>
> dello operaio => dell'operaio ("of the worker")
>
> HYPHENATION
>
> In Italian you can't hyphenate after an apostrophe:
>
> un'opera => un'o-pe-ra
> nell'opera => nel-l'o-pe-ra
>
> so these are the allowed hyphenations:
>
> un'o-
> pera typographically rather ugly
>
> un'ope-
> ra better
>
> nel-
> l'opera typographically the best (preposition-article split)
>
> nell'o- ugly
> pera
>
> nell'ope-
> ra
>
> but, though it's not used much anymore, you can go back to the
> version without apostrophe, as long as the uncut article or
> preposition is the last word in a line:
>
> una
> opera
>
> nella
> opera
>
> These are seldom used, but they would be a good solution, especially
> when the line break occurs across pages.
> Sometimes it's also the finest typographical solution when you have
> narrow columns.
>
> The reason it is seldom used is because there's no automatic
> solution in typesetting software.
> You can do it manually, but when a change in the text modifies the
> line breaking, the article/preposition could move away from the end
> of the line, and you'd get "una opera" or "nella opera" in the
> middle of a line, which is grammatically correct but definitely not
> something you would expect in a printed text, considered almost an
> error.
>
> THE QUESTION
>
> Is there a way to encode such rules with \hyphenation and \discretionary?
>
> I tried
>
> \hyphenation{nel{-l'o}{la}{o}-pe-ra}
>
> but it does not seem to work.
>
> Massi
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2024-10-22 13:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 11:59 [NTG-context] " mf
2024-10-22 13:33 ` Tomáš Hála [this message]
2024-10-22 14:06 ` [NTG-context] " mf
2024-10-22 15:36 ` Hans Hagen
2024-10-22 16:32 ` Tomáš Hála
2024-10-22 17:22 ` Tomáš Hála
2024-10-22 19:22 ` Hans Hagen via ntg-context
2024-10-22 23:46 ` mf
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=20241022133321.GC4178@thala.cz \
--to=mendelu@thala.cz \
--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).