I am working in LaTeX, and I am trying to get babel and amsthm to play nice together.
I produced a minimal example (which gives a different error than the full project, but getting this to work could be the stepping stone I need for success in that)
\documentclass[hebrew,english]{memoir}
\usepackage[utf8x]{inputenc}
\usepackage{babel}
\selectlanguage{english}
\usepackage{amsmath}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[chapter]
\begin{document}
\chapter{Hello}
This is some text.\newline
\begin{theorem}
This is a theorem.
\end{theorem}
\begin{otherlanguage}{hebrew}
שלום
\end{otherlanguage}
\hfill\newline
English again!
\end{document}
This does not compile. It would compile if:
- I comment out the
\begin{theorem}...\end{theorem}part, - I remove the use of babel completely, or
- I simply remove the Hebrew from loading (and comment out the relevant part).
The error message is:
! Missing { inserted.
<to be read again>
T
l.14 T
his is a theorem.
A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
(If you're confused by all this, try typing `I}' now.)
This error is pointed at the \begin{theorem} part and there is another which seems to be related to the \end{theorem} line, it's slightly different:
)
Runaway text?
This is a theorem. \end {theorem} \begin {otherlanguage}{hebrew} \\ש\ETC.
! File ended while scanning text of \dth@everypar.
<inserted text>
}
<*> babeltest.tex
I suspect you have forgotten a \`}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type \`E' or \`X' now and fix your file.
! Emergency stop.
For the purpose of the project I don't need any theorems to be stated in Hebrew. I just need some text and minor mathematical symbols, these will be appended to the end of the document, too.
Is there a way to make babel ignore amsthm each other, so that I can have one big project for everything, or do I need to create a separate project for the Hebrew part?
Edit:
It seems that the main problem with my big project is the fact that I define a long list of \newtheorem and counters (using aliascnt) and I think that babel is just getting confused by all those new counters and theorem styles.
Any information on what and how to correct this would be mighty useful as well!
Edit II:
I just noticed that when only removing the \begin{theorem} and \end{theorem} lines it compiles without errors, but the "Chapter 1" is gone. I am also adding the [memoir] tag because I think it might be an internal clash between babel and memoir.
P.S.
It doesn't work if I change the class from memoir to something else. I just use memoir in my main project so I figured it would be best to keep it here as well.
aliascntis not the problem: aliascnt + babel + Hebrew work fine (sort of) withntheoreminstead of amsthm. – einpoklum Aug 09 '12 at 22:44