GeneralError due to babel and :

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
argtjs
Posts: 3
Joined: Tue Aug 04, 2009 5:52 pm

Error due to babel and :

Post by argtjs »

Hi,

I am getting an error when trying to compile the following code:

Code: Select all

\documentclass{book}

\usepackage[frenchb,english]{babel}

\begin{document}

\section{The proof of Theorem \protect \ref{th:t2vla} }

\end{document}
The error is:

! Missing \endcsname inserted.
<to be read again>
\protect
l.18 \end{document}

?

The error comes from the semi-column ":" in the \ref. It is interpreted in the French style, which is why there is a "\endcsname".

However, there are no \selectlanguage{frenchb} before, so it should not interpret it as it is obviously doing. I have tried to add a \selectlanguage{english} before, but he does not change anything.

This seems to me as a bug in latex or babel. Does anyone has a fix which does not involve removing the ":" from the reference.

Perhaps, this is due to the version of latex and babel, I am using:

TeX, Version 3.14159 (Web2C 7.4.5)
LaTeX2e <2001/06/01>
Babel <v3.7h>

Thanks for any help.

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Error due to babel and :

Post by gmedina »

Hi,
argtjs wrote:Hi,

I am getting an error when trying to compile the following code:

Code: Select all

\documentclass{book}

\usepackage[frenchb,english]{babel}

\begin{document}

\section{The proof of Theorem \protect \ref{th:t2vla} }

\end{document}
...
The code you posted does not produce errors (just 4 warnings) when compiled (in my system). Please post a minimal working example (MWE) clearly showing the undesired behaviour.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
argtjs
Posts: 3
Joined: Tue Aug 04, 2009 5:52 pm

Re: Error due to babel and :

Post by argtjs »

Well,
I thought I posted a MWE. It still produces an error with my system, so this is probably a bug which has been corrected in the more recent versions of tex or babel but not on my version.

Unfortunately, I do not have administrator privilege on the computer which I am using (university computer) so I cannot change the version of tex used. Perhaps, I can download the last version of babel (3.8) and try to use it locally in place of the old one (3.7).

Anyone has another suggestion ?
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: Error due to babel and :

Post by gmedina »

Can't you just contact your administrator and ask him/her to keep an updated LaTeX system installation?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
argtjs
Posts: 3
Joined: Tue Aug 04, 2009 5:52 pm

Re: Error due to babel and :

Post by argtjs »

After contacting my administrator, it gave a quick fix (they can't update TeX easily). Just insert \string before : to tell Tex that this is not a macro.
Post Reply