20
! Package babel Error: You haven't defined the language en yet

I am getting the above error - no matter what I do... I have tried everything from the other answers and am sure now that its not related: Package babel Error: You haven't loaded the option english yet, Language problems with biblatex and babel. Nothing is working. These are the errors:

! Package babel Error: You haven't defined the language en yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.81 \select@language{en} Your command will be ignored, type to proceed ! Package babel Error: You haven't defined the language en yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.89 \select@language{en} Your command will be ignored, type to proceed ! Package babel Error: You haven't defined the language English yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.97 \select@language{English} Your command will be ignored, type to proceed ! Package babel Error: You haven't defined the language en yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.105 \select@language{en} Your command will be ignored, type to proceed ! Package babel Error: You haven't defined the language jpn yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.129 \select@language{jpn} Your command will be ignored, type to proceed ! Package babel Error: You haven't defined the language en yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.137 \select@language{en} Your command will be ignored, type to proceed ! Package babel Error: You haven't defined the language en yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.145 \select@language{en} Your command will be ignored, type to proceed ! Package babel Error: You haven't defined the language en yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.153 \select@language{en} Your command will be ignored, type to proceed ! Package babel Error: You haven't defined the language en yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.161 \select@language{en} Your command will be ignored, type to proceed ! Package babel Error: You haven't defined the language en yet. See the babel package documentation for explanation. Type H for immediate help.

...

l.169 \select@language{en} Your command will be ignored, type to proceed )

It doesn’t matter if I have this line or not:

\usepackage[english]{babel}

~~~~~~~~~~~~~~~~~~~~~ MWE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

\documentclass{../frontiersstyle.sty/frontiersENG}

\usepackage{url,lineno}
\usepackage{textcomp} 
\usepackage{gensymb}

\usepackage{mathtools}
\usepackage{calc}
\linenumbers

\copyrightyear{}
\pubyear{}

\begin{document}

\bibliographystyle{../frontiersstyle.sty/frontiersinSCNS&ENG}

\cite{katsuyama_functional_2010}

\bibliography{refs}

\end{document}
ashley
  • 301
  • Please post the entire preamble. There might be some package conflicts. – remus Mar 31 '14 at 11:40
  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Moreover, it is hard to tell what is going wrong without looking at a minimal working example (MWE). – Ruben Mar 31 '14 at 11:46
  • 2
    Remove the .aux files, type \usepackage[english]{babel} and retry. The error is due to a preceding attempt with wrong options. – egreg Mar 31 '14 at 11:46
  • 1
    @egreg: I doubt it. You wouldn't get languages "en", "jpn" and "English" (uppercase) with the normal babel options. It is probably a faulty "language switching" command. – Ulrike Fischer Mar 31 '14 at 11:50
  • @UlrikeFischer Possible; a minimal example is surely necessary. – egreg Mar 31 '14 at 17:59
  • @remus `\documentclass{../frontiersstyle.sty/frontiersENG} \usepackage{url,lineno} \usepackage{textcomp} \usepackage{gensymb}

    \usepackage[english]{babel}

    \usepackage{mathtools} \usepackage{calc} \linenumbers

    \copyrightyear{} \pubyear{}`

    – ashley Apr 01 '14 at 12:33
  • @egreg This I have done - in every possible combination – ashley Apr 01 '14 at 12:35
  • @ashley Well, doing \selectlanguage{jpn} or \selectlanguage{en} is invalid. Please, try making a minimal example. – egreg Apr 01 '14 at 12:40
  • Where could I find 'frontiers' template? – remus Apr 01 '14 at 12:47
  • I think it may have something to do with the bib file.. – ashley Apr 01 '14 at 12:50
  • @remus http://www.frontiersin.org/design/zip/Frontiers%20LaTeX%20%28Science%2C%20Health%20and%20Engineering%29%20V2.4%20-%20with%20Supplementary%20material.zip – ashley Apr 01 '14 at 12:53
  • @egreg your answer here: http://tex.stackexchange.com/questions/88861/language-problems-with-biblatex-and-babel does not work for me - though I think its on the right track – ashley Apr 01 '14 at 12:59
  • I copy/pasted your preamble into frontiers template and I could not reproduce the babel error. – remus Apr 01 '14 at 13:00
  • Could you give us your tex files (post them somewhere publicly)? It's important to reproduce the bug in order to find a fix. – remus Apr 01 '14 at 13:03
  • @ashley I won't look at this any more, unless you add to the *question* (not in comments) some code that reproduces the issue. – egreg Apr 01 '14 at 13:03
  • @egreg I added to the question – ashley Apr 04 '14 at 09:48
  • 6
    I had a similar issue and I solved it by removing language = {en} in bib file (or changing them to language = {english}). – Piotr Migdal Sep 03 '14 at 09:28
  • 3
    I had the same error. The solution was to delete language = {eng} from the bib entry, as @PiotrMigdal said. – jmjr Jul 15 '16 at 14:25
  • 1
    Strange that the question is closed. It described very much my problem. In my case it was a missing texlive-lang-german package on Ubuntu that caused the error message. – Harald Sep 07 '16 at 10:16
  • I had a similar problem with a book template (Los_Academicos) with English language selected, with error for Spanish not defined. Solved installing texlive-lang-spanish. (sudo apt install texlive-lang-spanish). – Hastur Feb 28 '23 at 20:25

1 Answers1

11

When you change what babel languages you use, it's good to remove the .aux file which contains things LaTeX saves from run to run, since it will contain lines that only work with the babel settings you had before.

If you rerun after removing the .aux file and get errors anyway they will have linenumbers, maybe pointing to lines where you do something like

\selectlanguage{SOMELANGUAGE}

where SOMELANGUAGE isn't mentioned in your babel settings.

From your error messages we can see you have called English "english" sometimes, and just "en" sometimes. The latter is incorrect. We can also see you at some time have tried to include Japanese. There is a question about writing Japanese here.

pst
  • 4,674
  • The presence of \select@language makes it highly unlikely that it refers to the main document, but rather to the .aux file. – egreg Mar 31 '14 at 17:58
  • True. I mostly wanted to alert ashley to the fact that these are strings that originally are from the document. – pst Mar 31 '14 at 18:08
  • Not changing languages at any point, include accents but that's about it language wise. I would like to remove babel all together, but then it fails to compile at all. – ashley Apr 01 '14 at 12:37
  • When it seems to not work "no matter what you do", there is a risk of changing several things at the same time, and not noticing the effect.

    Remove babel, since that's what you want. Remove the .aux files. (If you are unsure if you've removed all intermediary files, copy your TeX file to a new directory, to start from a clean slate.) Rerun. Then state more precisely what happens then, when it "fails to compile".

    – pst Apr 01 '14 at 13:11
  • @pst I removed babel and .aux and reran - the errors remain so it must be defining it somewhere else other than my main doc.. – ashley Apr 02 '14 at 08:46
  • you can simply try this : sudo apt install texlive-lang-german – Sihem Hcine Apr 06 '19 at 16:21
  • 2
    I had the same problem, the \selectlanguage{en} command was in the bbl file. It seems that Zotero put the "en" in the respective entry when autoimporting references, exported it into my bib file and then the compiler put in the command. Not sure why I never had this problem before, perhaps it was natbib that puts the command there (which I normally do not use)? In any case, I removed the entry from my Zotero library entry, updated the bib file, and deleted the bbl file. It was tedious, but that solved it. There should be a less tedious way though. – user510186 May 24 '21 at 22:48
  • @user510186 please consider adding this comment as an answer. This was useful to me. The problem can be hidden or appear depending on one’s bib style, I think. – Olivier Cailloux Nov 18 '21 at 22:11