# Exercise package with Babel

About two years ago, I used the Exercise package with Babel to obtain a document of exercises in French. Now, I can't get it to work : it's always in English, with the exercise header as "Exercise" instead of "Exercice". I recompiled some old source files, and the localization didn't work as well. I tried with MacTex on Mac OS X, and TeXlive 2015 on Windows 10, as well as MikTex, all with the same non-localized result. I'm missing something here, any clue?

Here's a sample code.

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}

\usepackage{amsmath,amssymb}
\usepackage{mathrsfs}  % Ralph Smith’s Formal Script Font (rsfs)

\usepackage{exercise} % for exercises and answers

\begin{document}

\begin{Exercise}[title={Lorsque $f(x)$ dépasse $k$}, label=ex1]

Dans le programme ci-contre, $F1$ est la fonction définie par :
\begin{equation*}
F1(x) = 2x^2 + 5x + 7
\end{equation*}

\Question Justifier le sens de variation de cette fonction, puis dresser son tableau de variation sur l'intervalle $]0;+\infty[$.

\end{Exercise}

\end{document}


I don't think that it could ever have worked. The package adds the definitions to the language "frenchb" instead of "french". (There are also a number of spurious spaces in some of the language definitions). You should make a bug report, in the meantime you can add the definitions yourself:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}

\usepackage{amsmath,amssymb}
\usepackage{mathrsfs}  % Ralph Smith’s Formal Script Font (rsfs)

\usepackage{exercise} % for exercises and answers

\def\listexercisename{Liste des exercices}%
\def\ExerciseName{Exercice}%
\def\ExerciseListName{Ex.}%
\def\ExePartName{Partie}}%

\begin{document}

\begin{Exercise}[title={Lorsque $f(x)$ dépasse $k$}, label=ex1]

Dans le programme ci-contre, $F1$ est la fonction définie par :
\begin{equation*}
F1(x) = 2x^2 + 5x + 7
\end{equation*}

\Question Justifier le sens de variation de cette fonction, puis dresser son tableau de variation sur l'intervalle $]0;+\infty[$.

\end{Exercise}
\end{document}


• Thanks for your comment, but it did work in summer 2013. I put online on my website the answers for the Baccalaureate exams, and I didn't need to use manual definitions. The file are here. I will make a bug report. – macxpat Apr 24 '16 at 10:04
• It did work in texlive 2012, but not in texlive 2013 and later. As far as I can see the change is in frenchb.ldf (and imho a good idea, "french" is a better name for the language, and it doesn't make sense to have a lot of variants like frenchb or Frenchb). – Ulrike Fischer Apr 24 '16 at 10:17
• Thanks for the thorough check. Well, "french" and "frenchb" are the equivalent to "german" and "ngerman". By the way, I checked the compilation with the locale "german" and it did not work as well. I will mention it to the author of the package "exercise". Quickly creating a customized document in Latex is often daunting. Latex documents are pretty, but writing a customized document in Latex is an ugly task. Efforts should go on developing a modern Latex engine that allows for easy customization out-of-the-box, without having to load a myriad of add-ons. – macxpat Apr 24 '16 at 16:42
• ngerman and german are related to two different orthographies, this is not the same situation as with french. The "german/ngerman" option works fine with your package. If you don't like the package system of latex, use context. – Ulrike Fischer Apr 24 '16 at 16:53