3

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...

lockstep
  • 250,273
Eusebius
  • 381
  • 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: [http://tex.stackexchange.com/questions/12347/typesetting-a-document-using-arabic-script] – maria Sep 25 '12 at 14:12
  • 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. – Eusebius Sep 25 '12 at 14:15
  • Load inputenc before babel. One of the bad habits of hebrew.ldf is that it loads inputenc if you haven't done it already. – Ulrike Fischer Sep 25 '12 at 14:15
  • 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. – maria Sep 25 '12 at 14:18
  • @maria xelatex is not the software I use, so yes, it would mean switching software. – Eusebius Sep 25 '12 at 14:21
  • @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. – Eusebius Sep 25 '12 at 14:24
  • 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}. – Ulrike Fischer Sep 25 '12 at 14:41
  • @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} – Eusebius Sep 25 '12 at 14:50
  • Don't use \hebyod with cjhebrew. And read the documentation of the package. – Ulrike Fischer Sep 25 '12 at 21:27
  • @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... – Eusebius Sep 26 '12 at 07:47
  • @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. – einpoklum Sep 26 '12 at 07:58
  • @EyalRozenberg Right, done. – Eusebius Sep 26 '12 at 08:05
  • @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. – einpoklum Sep 26 '12 at 08:40
  • @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. – Eusebius Sep 26 '12 at 14:40
  • @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... – einpoklum Sep 27 '12 at 18:07
  • Do whatever you want if you think I'm not asking the question you want me to ask. I don't care anymore. – Eusebius Sep 28 '12 at 05:20

1 Answers1

8

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}
Fran
  • 80,769