hebrew utf8 tex examples

hebrew utf8 tex examples

Oleg Goldshmidt pub at goldshmidt.org
Thu Jul 14 20:19:31 IDT 2011


On Thu, Jul 14, 2011 at 3:41 PM, Avraham Rosenberg
<for.avraham at gmail.com> wrote:

>   Thanks a lot for both answers. After including the "\usepackage{ucs}"
> command, the renewcommand did work for the Hebrew text as well.

Actually, it works for me even without \usepackage{ucs}. I included it
on a hunch, without experimenting. It didn't work for me without
\usepackage{culmus} though - did you have it in before?

> Still I'd love to find example of tex files: for someone like me, who did not learn
> latex systematically, but stopped reading the moment I was able to accomplish
> the job at hand, this is the easiest way to find out blunders and correct
> them...

Without some systematic learning that will lead to understanding of
how things work you are likely to fall into a tar pit once in a while.
If you stop reading as soon as you can reach the next incremental goal
you will hit a wall on the next step or will not recognize a situation
that should already be familiar. For tools you use regularly (at
least!) developing deeper understanding usually pays off very well.
For LaTeX there are excellent books and web documentation, including a
lot of examples and tutorials.

As a case in point, you certainly used \rmdefault correctly. From what
you wrote I will venture to assume that it was from examples. I
suppose what was missing is the understanding that you needed to tell
LaTeX what Hebrew font family to use as the default "roman". LaTeX
does not know since it's default encoding is (still, I think) 7 bit.
So you need to declare the encoding, and specify what the roman font
is. The ucs and utf8x are not really relevant here - they enable you
to *input* UTF-8 characters - I needed them to write the word
"shalom". The task is, however, accomplished by culmus.sty.

To illustrate, the following 3 lines from culmus.sty are sufficient
(for my example that does not use sf, tt, it, bf, or anything else):

\DeclareFontEncoding{HE8}{}{}
\DeclareFontFamily{HE8}{cmr}{}
\DeclareFontShape{HE8}{cmr}{m}{n} {<-> frank}{}

Even without knowing much more you can guess that Computer Modern
Roman (cmr, the default LaTeX roman font that you redefine with
\rmdefault) will use the specified culmus family.

The gory details about Computer Modern Roman should be in one of the
docs I linked to earlier, probably the documentation of fontspec. [My
original wild guess to specify T1 encoding (rather than the default 7
bit OT1) was probably a big overkill.]

-- 
Oleg Goldshmidt | pub at goldshmidt.org



More information about the Linux-il mailing list