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 want to specify encoding that is used by Lyx when it generates LaTeX source for preview or export. That is not a big problem Document->Settings->Language->Encoding->Other->Select encoding from combo box will do just that. But it will also add command \usepackage[selectedEncoding]{inputenc} to preamble of generated document.

How do I prevent that? I want all my LaTeX documents to be generated in UTF-8 but I do not want that inputenc declaration in preamble.

share|improve this question
Why this automatic inputenc declaration is it a problem? – Paul Gaborit Dec 26 '12 at 2:01
@Paul Gaborit Because LaTeX class of the document may also declare inputenc therefore there is option clash possible. See tex.stackexchange.com/questions/88177/… – drasto Dec 26 '12 at 14:42
A LaTeX class should not impose specific encoding. – Paul Gaborit Dec 26 '12 at 14:45
@Paul Gaborit Thank you for this! This is what I needed to hear (hope this is not your subjective opinion). Apparently Lyx also expect LaTeX classes to not to impose specific encodings. Would you mind answering my question tex.stackexchange.com/questions/88177/… in this manner? It might be accepted answer. – drasto Dec 26 '12 at 14:59
up vote 2 down vote accepted

You more or less answered your own question:

enter image description here

By selecting Language Default (no inputenc) as encoding, LyX will not add \usepackage[<encoding>]{inputenc} to the preamble.

share|improve this answer
Why don't I even have the option to set the encoding?! And how do I fix it if I don't have "Encoding" in my language settings? Do I have an old version or did it change over time? So many questions : ( There is only "Language" and a dropdown box for that. – user32073 Jun 11 '13 at 11:51
@Garrin I have no idea. To find out which version you have, go to Help --> About LyX. The latest version is 2.0.6, you can download it from lyx.org – Torbjørn T. Jun 12 '13 at 7:09

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.