Finally I got my Hebrew working on LaTeX.

Everything's working great except for two issues - numbers and parentheses. Numbers are written the other way around (one hundred would be written 001), and parentheses are reversed too )like this(. Is there a solution for the problem?


המספר (מאה) בספרות הוא 100
  • 1
    Please add a minimal working example (MWE) that illustrates your problem. This should provide context within which you use Hebrew numbers and parentheses for others to work with. – Werner Dec 15 '11 at 19:55
  • I cannot test your MWE due to missing fonts issues, but have you tried using the \foreignlanguage command from babel for short text in a different language? Something like \foreignlanguage{english}{100} – Gonzalo Medina Dec 15 '11 at 20:29
  • 1
    Better yet, according to hebrew.dtx you can use the switch \unsethebrew to switch from the Hebrew font encoding to the current font encoding, and from the right-to-left mode to left-to-right mode. The command \sethebrew switches back. – Gonzalo Medina Dec 15 '11 at 20:39
  • Wouldn't that mean, then, that I have to use these commands every time I use numbers or parenthesis? I thought there was something I could write at the beginning or something, and afterwards I would be able to type normally? – David Dec 16 '11 at 13:16
  • 4
    As someone who started with LaTeX and Babel a few weeks ago, let me save you some headaches: use XeTeX and polyglossia instead. Things like this work there out of the box, and other little quirks that Babel has are working fine there. – daniel.jackson Dec 16 '11 at 13:45

You can use Artyom Beilis' BiDiTex, which pre-processes a (La)TeX file to reverse parentheses and enclose numbers in appropriate macros.

The documentation lists the problem you mention exactly, in section 1... that's the motivation for writing that utility.

Using the question's MWE:

המספר (מאה) בספרות הוא 100

And running

cat mwe.tex | biditex.exe -o mwe_out.tex

you get:

המספר )מאה( בספרות הוא \Lnum{100}

Which results when LaTeXing in the output you'd expect:


Of course, you would want to scriptify all of this.

By the way, BiDiTeX seems to require UTF-8 input.


I agree daniel.jackson, Polyglossia and XeTeX are the way to go. Here's my working example, though minimal it is not:


%polyglossia packages - polyglossia must be first

%XeTeX packages

%settings for packages
\setmainfont{Linux Libertine O}


Here is a whole phrase or section in left-to-right direction:

 הנשיא האמריקאי ברק אובמה נאם הערב (שישי) בוועידת הקהילות היהודיות שנערכה בוושינגטון.

Or, for when a few words will do:

\RL{\ldots נאם הערב (שישי) בוועידת\ldots}

And it works fine with numbers as well:

\RL{\ldots נאם 100 + 30 = 130 הערב (שישי) בוועידת\ldots}

Even nested environments work just fine:

\RL{\ldots נאם \LR{with English in the middle} הערב (שישי) בוועידת\ldots}


enter image description here

  • 1
    bidi, fontspec, xltxtra and xunicode are all unnecessary. And in fact it's necessary to load polyglossia last more often than not. – daniel.jackson Dec 16 '11 at 23:20
  • I agree that xltxtra, and xunicode are unnecessary (though they are in my template so I rarely remove them) but the commands I issued \RL{}, \setRL, etc. are command for the bidi package and the command \setmainfont{Linux Libertine O) is for the fontspec package. I was under the impression that the standard font did not have many non-latin glyphs. – AdamRedwine Dec 17 '11 at 13:59
  • 3
    Right, but both of those are included by polyglossia, so there's no need to explicitly load them. – daniel.jackson Dec 17 '11 at 16:59
  • Huh... I did not know that. Thanks for the info. – AdamRedwine Dec 18 '11 at 2:55
  • @daniel.jackson It's not polyglossia that has to be last. It's the line \setotherlanguage{hebrew} that has to go after any other package loading, because that line loads bidi. – Ari Brodsky Dec 23 '12 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.