Fonts & Character Setsbabel & inputenc errors when using Hebrew

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
hefetza
Posts: 2
Joined: Sat Dec 15, 2012 12:53 pm

babel & inputenc errors when using Hebrew

Post by hefetza »

Hello,
I'm considiring using latex instead of libreoffice writer as my main tool for writing essays (I'm a history student). I'd love to start using it but just can't get Hebrew working.
I've downloaded a Hebrew text file which works ok. The only problems I get are the babel error message (which I don't really care about since the pdf output works) and that I can't see the Hebrew fonts when they are in my text editor. I've uploaded it so you can see.

I've tried to insert my own text into the same file but I get (from TexWorks) two error messages:
Package babel Warning: No hyphenation patterns were loaded for
(babel) the language `Hebrew'
(babel) I will use the patterns loaded for \language=0 instead.
and:
! Package inputenc Error: Keyboard character used is undefined
(inputenc) in inputencoding `8859-8'.
I get the same messages when I writing my own text, such as:

Code: Select all

\documentclass {article} 
\usepackage[hebrew,english]{babel}
\begin{document} 
שלום עולם!
\end{document}
adding \usepackage[utf8]{inputenc} gives me:
! Package inputenc Error: Unicode char \u8:ש not set up for use with LaTeX.
and adding \usepackage[utf8x]{inputenc} gives me:
! LaTeX Error: File `utf8x.def' not found.
I'm using the texlive on Debian Wheezy. I have installed the texlive hebrew package as well.
I've have searched for a solution for hours and though I have found some references to these problems, none of the offered solutions seems to work.

I would really appreciate your help.
Attachments
hebrew_get_started.tex
(862 Bytes) Downloaded 661 times
Last edited by cgnieder on Sat Dec 15, 2012 4:44 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

babel & inputenc errors when using Hebrew

Post by cgnieder »

Hi and welcome to the LaTeX community!

This is only a partial answer: the babel warning shouldn't be a problem, see for reference.

Please note that the last language given as option to babel is the active one (see the manual babel for details) so you might want to use

Code: Select all

\usepackage[english,hebrew]{babel}
in your example.

Regards
site moderator & package author
hefetza
Posts: 2
Joined: Sat Dec 15, 2012 12:53 pm

Re: babel & inputenc errors when using Hebrew

Post by hefetza »

The hack worked and the babel error is gone. Thanks!
Any idea about the inputenc error?
User avatar
justdeath
Posts: 69
Joined: Mon Sep 05, 2011 10:27 am

babel & inputenc errors when using Hebrew

Post by justdeath »

Here is the solution. The missing font is jerus10.mf:
http://packages.ubuntu.com/hardy/all/ivritex/filelist

Which link to:
http://ivritex.sourceforge.net/

The required file is:
http://sourceforge.net/projects/ivritex ... z/download

Only the subfolder hebfonts is required, the rest may break the distribution (happened to me before). I am attaching the fonts, I hope it is not forbidden. The fonts must be placed in:
C:\texlive\2011\texmf-dist\fonts\source

They should reside in "hebfonts". The path may differ because of OS and distribution. The command texhash must be run, before the fonts are detected by LaTeX.

Also, utf8 does not work. You need utf8x + ucs loaded:

Code: Select all

\documentclass{article}

% babel hack
\makeatletter
\let\l@hebrew\l@nohyphenation
\makeatother

% utf8x requires ucs
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[english,hebrew]{babel}

\begin{document}
שלום עולם!
\end{document}
jd
Attachments
hebfonts.zip
(296.37 KiB) Downloaded 544 times
Post Reply