Document ClassesThe [hebrew] Babel, and conflicts.

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
ggran
Posts: 13
Joined: Fri May 09, 2008 9:16 pm

The [hebrew] Babel, and conflicts.

Post by ggran »

Hey All,
I came to believe the babel package, (along with the "hebrew" option)
is one of the most complicated one.

my current problem is that it conflicts with the amsthm package.
it is a known problem (I found 3-4 posts over then net) but found no solution.

here is an example: try
\documentclass[11pt,a4paper,twoside]{report}
\usepackage{amsmath,amssymb}
\usepackage{amsthm}
\usepackage[hebrew,english]{babel}
\newtheorem{lem}{Lemma}
\begin{document}
\begin{lem}
Hebrew (and maybe other Left-to-Right languages) simply collide with amsthm !
\end{lem}
\begin{proof}
\[ 1+1 = 2 \]
\end{proof}
\end{document}
While if you remove the bable package, or change language,
it suddenly works:
\documentclass[11pt,a4paper,twoside]{report}
\usepackage{amsmath,amssymb}
\usepackage{amsthm}
\usepackage[greek,english]{babel}
\newtheorem{lem}{Lemma}
\begin{document}
\begin{lem}
Many languages works...
\end{lem}
\begin{proof}
\[ 1+1 = 2 \]
\end{proof}
\end{document}
(The above verified also with online latex compilers).

till now I just avoid using the amsthm package, and define thm/lem/proofs/etc myself. Yet this has its own problems (for instance, I don't know how to define the \qedhere command myself, etc.). Does anyone have an idea?

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

The [hebrew] Babel, and conflicts.

Post by localghost »

I've found a hint by searching the net which suggests to change the sequence of loading the packages [1]. The descriptions have been made by a LyX user, but should also work for others. So the babel package has to be loaded before the amsmath package.

Code: Select all

\documentclass[11pt,a4paper,twoside]{report}
\usepackage[hebrew,english]{babel}
\usepackage{amsmath}
\usepackage{amsthm,amssymb}

\newtheorem{lem}{Lemma}

\begin{document}
  \begin{lem}
    Many languages works \ldots
  \end{lem}
  \begin{proof}
    \[
      1+1 = 2
    \]
  \end{proof}
\end{document}
To avoid this kind of problem in the future you should get used to loading the babel package as one of the very first packages.

[1] Notes About Using amsmath split Enviroment In Hebrew Documents >> Guy Rutenberg


Best regards
Thorsten
ggran
Posts: 13
Joined: Fri May 09, 2008 9:16 pm

The [hebrew] Babel, and conflicts.

Post by ggran »

Sorry,
This doesn't work. Nor on my machine, nor on
http://nirvana.informatik.uni-halle.de/ ... fruf=21839
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

The [hebrew] Babel, and conflicts.

Post by localghost »

The difficulties are definitely caused by the new defined lem environment. Setting the corresponding lines as comment fixes the problem and the code is compiled without any error. Hence the amsthm package could be the source of trouble. I tested the code with the ntheorem and the theorem package, but both conflict with the amsthm.

Compiling your code, I noticed a warning given by the babel package.

Code: Select all

Package babel Warning: No hyphenation patterns were loaded for
(babel)                the language `Hebrew'
(babel)                I will use the patterns loaded for \language=0 instead.
Check your log file for this warning and create the corresponding format files if necessary. Perhaps the documentation of babel contains useful hints regarding the hebrew option in combination with other packages.
LeDoyen68
Posts: 1
Joined: Wed Feb 09, 2011 8:51 pm

Re: The [hebrew] Babel, and conflicts.

Post by LeDoyen68 »

I've created a multilingual (Greek, Cyrillic, Arabic, Hebrew, extended European) template and was having great difficulty with using Hebrew in Babel.

I'm using:
MikTeX 2.9 (full install)
OS = Windows 7

Solution for the multilingual portion:
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{cjhebrew}
\usepackage{arabtex}
\usepackage{lmodern}
\usepackage[T2A]{fontenc}
\usepackage{txfonts}

Since the template is designed for English, other languages would only be used for snippets of text. CJHebrew and ArabTeX use Latin-based transliterations to render the text in the appropriate script. It's not perhaps the most elegant way to show text, but it does work.

e.g.
\cjRL{/slwm} = שלום
\RL{al-salAm} = السلام
Post Reply