I get the following error in Lyx when I try to generate the pdf file.

Package babel Error: You haven't specified a language option

I have tried using the information in similar questions for TeX but it doesn't work in LyX. For example, I tried changing the Lyx preamble by including


but I still get the same error. What is the right solution to this problem in LyX?

Minimal working example is the following standard text in a LyX file with class article.

  • 1
    Document > Settings ... > Language and check the options and the LaTeX source generated with each option. Unless you select Language package: None do not include \usepackage[english]{babel} in the preamble. – Fran May 11 '16 at 3:44
  • For this and future posts, it is very helpful if you can post a minimal working example: wiki.lyx.org/FAQ/MinimalExample – scottkosty May 11 '16 at 4:44
  • Thanks. I made the change. Does that look good ? – user25957 May 11 '16 at 4:52
  • @Fran I tried that but it didn't help. May be I need to look more into the LaTeX source. – user25957 May 11 '16 at 4:53
  • On Debian Jessie I solved the issue by installing the corresponding textlive-lang-[language] package. – munro Sep 10 '16 at 15:06

I just ran into the same problem with a German document. Here is what fixed the problem without any workarounds in Ubuntu; You need to adjust this to your TeX/OS combination.

sudo apt install texlive-lang-german

Also note that the described PDF Properties workaround did not work in my case. In general, I would always first look for ways to fix the actual problem, rather than using workarounds that strip my software of its features.

Edit: On Fedora this helped: sudo dnf install texlive-babel-german

| improve this answer | |

What worked for me is unchecking the option "Automatically fill header" under Document-> Settings-> PDF properties. I guess that just helps never loading babel and running into the problems caused by it.

| improve this answer | |

You have to install texlive-lang-all (or texlive-lang-english, texlive-lang-italian, etc.).

In the terminal:

sudo apt install texlive-lang-all

Then you have to change the preferences in LyX: Language: automatic.

It should work.

| improve this answer | |

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