TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a new class file that is based on book, and thought of making it available both in an English and in a Dutch version. Easiest to do seemed passing the arguments, so I constructed following class file :

\ProvidesClass{UGentCourse}[2011/07/28 v1.0 UGentCourse]

\ProcessOptions \relax

\RequirePackage{babel} %francais, polish, spanish, ...

Which I believed would allow me to do :


Strange thing, it doesn't work completely. If I switch it from dutch to English (or back), I get an error :

Package babel Error: You haven't loaded the option english (dutch) yet.

If I rerun the file, the error is gone. I have a faint idea about what is going on, but not really a clue of how I can prevent this from happening. All help appreciated.

share|improve this question
It's normal; babel writes the language in the .aux file. If you change from Dutch to English, at the subsequent compilation LaTeX finds the annotation about Dutch and doesn't know about the language. – egreg Jul 29 '11 at 11:40
I realized. I just need a way to get rid of that. Which @mhp gave me, thanks for that. – Joris Meys Jul 29 '11 at 13:26
up vote 7 down vote accepted

You can avoid this error by modifying your class definition as follows:

\ProvidesClass{UGentCourse}[2011/07/28 v1.0 UGentCourse]





\RequirePackage[dutch, english]{babel}

The last language in the option list passed to the babel package (i.e. english here) is the default language. It is active at the beginning of the document if no language has been specified in the optional argument of \documentclass.

share|improve this answer
Thx, this works smoothly. – Joris Meys Jul 29 '11 at 13:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.