1

I'm using TeXLive 2020 on Debian Testing, and LyX 2.3.5.2. I wrote some notes for a course I'm teaching, in LaTeX, using UTF8 encoding (default). When importing to LyX, I cannot compile it to PDF because it imports the characters wrong; I attach screencap of this at the end.

I have repeatedly set UTF8 as the default enconding for documents at Document>Settings>Language, but this changes don't seem to persist; I also added \usepackage[utf8]{inputenc} to the default preamble, and LyX saves this into its settings, but on Importing from LaTeX source, I get the same characters shown in the screencap.

I use LyX because it is a nice environment for student who don't know LaTeX yet, and don't have time to learn it during the course. They have reacted positively to LyX, and they use it for their turn-ins. So I give them the notes in LyX so they can edit them for their own use.

EDIT: I tried the solution on this question, but I still get the funny characters.

EDIT2: Added forgotten screencap.

Any ideas? Thanks!

enter image description here

4
  • 1
    There is not screenshot in your question. Commented Aug 27, 2020 at 7:29
  • @UlrikeFischer Thanks, I forgot it. It is there now. :) Commented Aug 27, 2020 at 15:31
  • Export the code to latex so that you can find out if it contains something that sets the input encoding back to latin1. Commented Aug 27, 2020 at 15:49
  • Well, indeed it imports it with latin9: the line \usepackage[latin9]{inputenc} is present in the TEX file when I reimport it to LaTeX from LyX. I have been looking at the preferences for a few minutes now but I cannot figure out where to change that. Commented Aug 28, 2020 at 2:36

1 Answer 1

1

It turns out that I have to add \usepackage[utf8]{inputenc} to my TEX file preamble so LyX knows what encoding to use when importing; I had forgotten to add this line because it is no longer necessary.

EDIT: I noticed the line was commented out at the time of importing from LyX.

2
  • 1
    I'm not a lyx user but if it really uses latin9 as default it should be reported. Commented Aug 28, 2020 at 6:13
  • I guess I might need to keep writing \usepackage[utf8]{inputenc} in my MWEs for a while longer. Commented Sep 27, 2020 at 3:59

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.