[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Hyphenation in German
From: |
Ulf Bro |
Subject: |
Re: [Groff] Hyphenation in German |
Date: |
Mon, 5 Jul 2004 20:19:16 +0200 |
User-agent: |
KMail/1.6.2 |
Am Sonntag, 4. Juli 2004 16:02 schrieben Sie:
> > It is 33 kB big. I have attached it. Sorry if this causes
> > inconvenience to anybody.
>
> It is much shorter (and easier to read) if you say
>
> grep 'open(' troff.log | less
>
> I need to see the source file you are trying to process. In the log
> output you've sent, groff doesn't try to open `hyphen.den' at all!
> Instead, it tries to open a file called `...'.
>
Yes, of course. I now know what I did wrong. How silly of me...
First of all, we are trying to make hyphenation in German work with Groff. I
write a text file with some groff commands in it. Let the text file look like
this:
.ll 4cm
Umzubrechen ist bärmöhrgrützsülzmärlössüßhämplöhnrüswähltröfür.
Then save this text as "dings.groff"
Then process this text with:
groff -m de dings.groff > dings.ps
And look at it with
gs dings.ps
====
Result: Now, all of a sudden it works, I don't know why. I didn't really do
anything (well, I must have done at least something, I just don't know what).
In SuSE Linux 9.1 everything that comes out of vim is unicode (yes, you can
set the output code) so this means I will have to use a file like this:
#!/bin/bash
#Skript für deutsche Groff-Texte, deren Name in .groff enden
cat $1 | recode ..l1 | groff -m de ${1%groff}ps
The problem is solved and everything works! Thank you!
====
Now, since you once asked me, how could one improve the groff manual, I think
I want to comment on that one (I hope I have actually understood the profound
meaning of the .hcode request):
This is your change to the groff manual:
To make hyphenation work, hyphenation codes must be set up. At
start-up, groff only assigns hyphenation codes to the letters
`a'-`z' (mapped to themselves) and to the letters `A'-`Z' (mapped
to `a'-`z'); all other hyphenation codes are set to zero.
Normally, hyphenation patterns contain only lowercase letters
which should be applied regardless of case. With other words, the
words `FOO' and `Foo' should be hyphenated exactly the same way as
the word `foo' is hyphenated, and this is what `hcode' is good
for. Words which contain other letters won't be hyphenated
properly if the corresponding hyphenation patterns actually do
contain them. For example, the following `hcode' requests are
necessary to assign hyphenation codes to the letters `ÄäÖöÜüß'
(this is needed for German):
One could of course use an even simpler language to make things even more
understandable like this:
Request: .hcode c1 code1 c2 code2...
As its default behaviour groff will only hyphenate words consisting of the
letters a-z and A-Z. If you write groff documents a language in which
additional letters are used, you will also need a hyphenation patterns file
with these additional letters. In this case you must present groff with these
letters using the .hcode request, since otherwise hyphenation patterns
containing these letters will be ignored. The .hcode syntax always takes as
its first argument the letter that groff meets when it parses the input file,
and it takes as its second argument the letter that groff should use when it
looks up the word in the hyphenation patterns file. Since the hyphenation
patterns file in most languages contains patterns written in lower case, you
will probably want to use the following syntax to present groff with
additional lower case letters, meaning, when the following lower case letter
is encountered in the input document, look for that same lower case letter in
the hyphenation patterns file:
.hcode ä ä
To enable groff to hyphenate a word written partly or completely in upper case
letters, you will tell groff to use the lower case patterns when it processes
its upper case counterpart (this also is the default behaviour when the
letters A-Z are processed):
.hcode Ä ä
In non-european languages, other ways of handling hyphenation may be possible.
Ulf