[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hyphenating non-english characters
From: |
Walter Alejandro Iglesias |
Subject: |
Re: hyphenating non-english characters |
Date: |
Thu, 26 Sep 2024 18:48:09 +0200 |
On Sat, Jul 27, 2024 at 08:51:32AM +0200, Gáspár Gergő wrote:
> Hi,
>
> I'm trying to make justified text look nicer, so I turned to hyphenation.
> Hungarian is not supported out of the box by groff, but I found a tex patterns
> file which seems quite good, that is what I tried to use, to not much success.
> Hyphenation happens, but not as often as I'd hope. After some more reading,
> I think the problem might be with the accented Hungarian characters not
> having
> hyphenation codes assigned to them, since hyphenation seemingly only happens
> near non-accented vowels.
>
> These are the requests that I used for hyphenation originally:
> .hla hu
> .hpf /home/gergo/projekt/jella/huhyphn.tex
> .hy 1
>
> The manual told me that
> > A hyphenation code must be an ordinary character (not a special character
> > escape sequence) other than a digit or a space.
> So I tried following the example, with these requests:
> .hcode á á Á á
> .hcode é é É é
> .hcode í í Í í
> .hcode ó ó Ó ó
> .hcode ö ö Ö ö
> .hcode ő ő Ő ő
> .hcode ú ú Ú ú
> .hcode ü ü Ü ü
> .hcode ű ű Ű ű
>
> However, groff throws errors saying "error: hyphenation code must be ordinary
> character". I tried with and without preconv to no avail. The example supplied
> in the manual, with German characters, didn't work either.
>
> What could be the problem here?
I'll tell you what works for me with Spanish language. The followinng
is the file I source:
.\" Groff Spanish hyphenation
.hla es
.hpf hyphen.es
.hy 1
.hcode á a
.hcode Á a
.hcode é e
.hcode É e
.hcode í i
.hcode Í i
.hcode ó o
.hcode Ó o
.hcode ú u
.hcode Ú u
.hcode ñ p
.hcode Ñ p
Note that the second character of each pair is always ascii. The way I
understand this works is, given for example the first entry:
.hcode á a
This is telling groff it should treat the first character from the pair
(in this case 'á') as it treats the second (in this case 'a'). So groff
will hyphenate, for example, "cuá-les" and "cua-les" in the same way.
Some may find it strange that I have associated the 'ñ' with the 'p' and
not with the 'n'. Well, in Spanish there are cases in which the 'ñ' is
not treated as an 'n', while some syllables can end in 'n' (e.g.
pan-ta-lón), no syllable ends in 'ñ'. I explain this to you so that you
understand that you must study and deduce for yourself what you have to
do based on the rules of your language.
>
> Best regards,
> Gergő Gáspár
>
>
--
Walter
- Re: hyphenating non-english characters,
Walter Alejandro Iglesias <=