LyX ⇒ Importing txt-Files with special characters
Importing txt-Files with special characters
I want to import a txt-file into LyX. I'm using the report (KOMA-script) class. Now I have sentences like "Zu messen sind Formänderungen an Körperteilen, z.B. Füßen" in a normal .txt-file. As you can see, it contains four special characters. By copy&paste the special characters display but the line breaks don't. So I tried to do it via File->Import->Simple text (I translated it from german so I hope it's the same in the english version).
Now line breaks display but all special characters like german umlauts and also the ° show up as question marks in rhombuses.
Also writing {\"A} in the txt-file instead of Ä does not help.
How can I import text with special characters and line breaks?
Thank you very much!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- Posts: 6
- Joined: Fri Feb 10, 2012 3:12 pm
Re: Importing txt-Files with special characters
I don't know if that may be a solution for your problems, but that's still not the solution for your question.
So, let's see if the people of the forum can give us some more advices. I am still trying to find a solution.
Re: Importing txt-Files with special characters
Anyway, I solved the problem by myself otherwise. I replaced all accents/special characters/etc with distinct strings like ä->aE, °->[dg] and replaced them again after importing.
The only disadvantage is that you have to know before which characters won't work.
-
- Site Moderator
- Posts: 542
- Joined: Sat Sep 01, 2012 6:38 am
Importing txt-Files with special characters
Hi ion87 and hm_cavalcanti,ion87 wrote:hm_cavalcanti, thanks for your answer. I hope I understood you correctly, but line breaks are not copied with the text in your solution, right?
Anyway, I solved the problem by myself otherwise. I replaced all accents/special characters/etc with distinct strings like ä->aE, °->[dg] and replaced them again after importing.
The only disadvantage is that you have to know before which characters won't work.
Can you please report this bug on the LyX bug tracker? This way it will get fixed for future versions. It is easy to register and post. Go here: http://www.lyx.org/trac
Under component, please choose "tex2lyx".
I believe the main developer of the tex2lyx component is German(-speaking at least) so he should know what's going on and what to do about it.
Also, which versions of LyX are you using?
Thanks,
Scott
Importing txt-Files with special characters
I reported the bug and the answer was the following:
A bit weird, because the whole page appeared in german but ok^^This is an English bugtracker, please post in English.
Your problem is that the plain text file apparently uses an encoding which
is not detected by LyX. I think the file needs to be encoded in utf8.
scottkosty, if you have contact maybe you can tell them that if the prompt is in german it is not obvious to have to post in english.
