3

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.

lockstep
  • 250,273
Rasto
  • 1,855
  • 2
  • 19
  • 21
  • 1
    Why this automatic inputenc declaration is it a problem? – Paul Gaborit Dec 26 '12 at 02:01
  • 1
    @Paul Gaborit Because LaTeX class of the document may also declare inputenc therefore there is option clash possible. See http://tex.stackexchange.com/questions/88177/option-clash-for-package-inputenc-when-using-lyx-with-latex-class-that-already-u – Rasto Dec 26 '12 at 14:42
  • 2
    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 http://tex.stackexchange.com/questions/88177/option-clash-for-package-inputenc-when-using-lyx-with-latex-class-that-already-u in this manner? It might be accepted answer. – Rasto Dec 26 '12 at 14:59

1 Answers1

3

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.

Torbjørn T.
  • 206,688
  • 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. –  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 http://www.lyx.org/ – Torbjørn T. Jun 12 '13 at 07:09
  • I have this setting, but the whole Encoding fieldset (in HTML terms) is disabled. How can one enable that? – Zelphir Kaltstahl Aug 22 '16 at 10:51
  • @Zelphir No idea why it would be disabled, ask in the LyX users mailing list (http://www.lyx.org/MailingLists#toc2) or post a new question here. – Torbjørn T. Aug 22 '16 at 10:53