Including Hebrew text in a non-Hebrew document (Babel not working)

2,711

Pobably this is not a package conflict, but rather the lack of babel support for Hebrew. A possible solution (not tested) is to install the package IvriTeX (Hebrew package for the babel system and LaTeX2e). To install in a Debian system:

apt-get install ivritex

In other case go to http://ivritex.sourceforge.net/

Another solution is to remove hebrew from the babel options and use the cjhebrew package:

\documentclass[10pt]{article}
\usepackage[english,french]{babel}
\usepackage{aeguill}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{xspace}
\usepackage{listingsutf8}
\usepackage{color}
\usepackage{url}
\usepackage{textcomp}
\usepackage{cjhebrew}

\begin{document}
\begin{cjhebrew}
b*:re’+siyt b*ArA’ ’E:lohiym ’et ha+s*Amayim w:’et hA’ArE.s; w:hA’ArE.s
hAy:tAh tohU wAbohU w:.ho+sEk: ‘al--p*:ney t:hOm
\end{cjhebrew}

L'e'quation $E=mc^2$ a e'te' exprime'e en 1905 par Albert Einstein.
\end{document}
Share:
2,711

Related videos on Youtube

Eusebius
Author by

Eusebius

Updated on August 01, 2022

Comments

  • Eusebius
    Eusebius over 1 year

    I need to introduce one Hebrew word in a document. I have been trying to add an hebrew option in my Babel includepackage command, as in the following code, but it does not work: it triggers a clash with almost all the other packages (in the following examples, all the ones below inputenc).

    \documentclass[10pt]{article}
    \usepackage[english,hebrew,french]{babel}
    \usepackage{aeguill}
    \usepackage[utf8x]{inputenc}
    \usepackage{amsmath}
    \usepackage{graphicx}
    \usepackage{xspace}
    \usepackage{listingsutf8}
    \usepackage{color}
    \usepackage{url}
    \usepackage{textcomp}
    
    \begin{document}
    Blah
    \end{document}
    

    This is a minimal non-working example: I need all these packages for my document. How can I display Hebrew text here? I'd like to avoid including it as a picture...

    • maria
      maria about 11 years
      I'm using sometimes Arabic script, I was adviced to use XeLaTeX instead of LaTeX, and polyglossia package instead of babel. You can check my question about Arabic here: [tex.stackexchange.com/questions/12347/…
    • Eusebius
      Eusebius about 11 years
      Thanks, but I'm not going to change both my software and one of my most common packages just to display one word... Your suggestion might be helpful to other people though.
    • Ulrike Fischer
      Ulrike Fischer about 11 years
      Load inputenc before babel. One of the bad habits of hebrew.ldf is that it loads inputenc if you haven't done it already.
    • maria
      maria about 11 years
      As you want, but you don't need to install any new software. You just change the preamble. For me XeLaTeX works better for multilanguage documents.
    • Eusebius
      Eusebius about 11 years
      @maria xelatex is not the software I use, so yes, it would mean switching software.
    • Eusebius
      Eusebius about 11 years
      @UlrikeFischer If I do that, there is no more package clash but when I put Hebrew characters in the text, I get an error message Command \hebyod unavailable in encoding T1.
    • Ulrike Fischer
      Ulrike Fischer about 11 years
      You must switch the language to hebrew (or at least the encoding). But on my system (miktex 2.9) even with the correct encoding it doesn't work as I don't have the needed fonts "jerus" (the state of hebrew in latex is imho a mess). I can use for simple words \usepackage{cjhebrew} and then \cjRL{hebrew}.
    • Eusebius
      Eusebius about 11 years
      @UlrikeFischer I'm not sure I understand you properly. If I include only what you say, I get the following error: ! Undefined control sequence. \u-default-1497 #1->\hebyod l.15 Blah \cjRL{my hebrew word here}
    • Ulrike Fischer
      Ulrike Fischer about 11 years
      Don't use \hebyod with cjhebrew. And read the documentation of the package.
    • Eusebius
      Eusebius about 11 years
      @UlrikeFischer You are right, I have been sloppy here. Sorry about that. I got it now and it is what I needed (except that I just can't copy/paste UTF-8 hebrew, which is a pity but I can live with it). If you care to rephrase your proposition about \usepackage{cjhebrew} and \cjRL{hebrew} as an answer...
    • einpoklum
      einpoklum about 11 years
      @Eusebius: Please edit your question, so either you ask about your specific example (in which case @UlrikeFischer's comment is the answer) or you ask about cjhebrew.
    • Eusebius
      Eusebius about 11 years
      @EyalRozenberg Right, done.
    • einpoklum
      einpoklum about 11 years
      @Eusebius: I split off this question. Now I suggest you re-edit, not even include an MWE, just link to my question and ask what you can use to insert a bit of Hebrew text without using babel and dealing with its compatibility issues.
    • Eusebius
      Eusebius about 11 years
      @EyalRozenberg I am not concerned by your question as I have not encountered such an error. My question as presented here describes my problem and Ulrike Fischer provided a perfect solution.
    • einpoklum
      einpoklum about 11 years
      @Eusebius: I understand that, but you also need to think about other people with a similar problem. They should not have to worry about whether your problem is due to one of the multiple packages your example uses; or whether it's due to your using French as well as English; etc. Will you allow me to edit the question? Also, Ulrike hasn't posted an answer, so technically you haven't accepted it...
    • Eusebius
      Eusebius about 11 years
      Do whatever you want if you think I'm not asking the question you want me to ask. I don't care anymore.