Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to import this latex document into Lyx (version 2.0.2 on Ubuntu 12.04), but it fails and won't give any explanation about the error:

Lyx: cannot convert file
 An error occurred while running: tex2lyx -f "frontespizio.tex" "frontespizio.lyx" 

What could be the problem here?

share|improve this question
    
This works under LyX 2.0.4 (with some minor editing, of course). Perhaps consider updating? Once that's done, give some more feedback. –  Werner Sep 16 '12 at 13:56
    
Does importing fail, or compiling? I was able to import [File --> Import --> LaTeX (plain)] without errors, but it gave an error on compiling, but the PDF was still generated. Ubuntu 12.04, LyX 2.0.2. –  Torbjørn T. Sep 16 '12 at 14:00
    
I can't import it at all. Here's the output: Lyx: cannot convert file An error occurred while running: tex2lyx -f "frontespizio.tex" "frontespizio.lyx" I will update the question with this piece of information. –  Ricky Robinson Sep 16 '12 at 14:15
    
I updated to Lyx 2.0.4, but got the same error. –  Ricky Robinson Sep 17 '12 at 9:14

2 Answers 2

up vote 6 down vote accepted

Too long for a comment:

Importing the downloaded file into a non-UTF8 editor (like TeXnicCenter 1.0), reveals:

enter image description here

The first character could be the cause of the problem - called a Byte Order Mark. Even importing this into LyX 2.0.4 adds the following into the preamble (Document > Settings > LaTeX Preamble):

enter image description here

which you'll have to remove. Either remove this from the file first before importing, or attempt an update of your version from 2.0.2 to 2.0.4 and remove it after importing.

share|improve this answer
    
Thank you. Is there any ordinary text editor that I can use to remove that first character? I can't seem to find it. I also wanted to upgrade to Lyx 2.0.4, but www.lyx.org isn't responding. –  Ricky Robinson Sep 16 '12 at 22:13
1  
Here is a BOM-free version of frontespizio.tex on Pastebin. Copy and paste this in a regular (UTF8-free) file/editor and (re)try importing it in LyX. –  Werner Sep 17 '12 at 0:02
    
Thanks. I copied and pasted into gedit, but it didn't work. Same thing when I saved the file directly from pastebin. Updating to 2.0.4 also didn't work. I don't know how to proceed at this point. –  Ricky Robinson Sep 17 '12 at 9:15
2  
@RickyRobinson: Are you still getting the same error when importing using LyX 2.0.4? Here's the LyX 2.0.4 file of frontespizio.tex. After importing I erased the BOM, as well as the two comments around some title. –  Werner Sep 17 '12 at 13:54
    
I was getting the same error, yes. But thank you so much for the .lyx file! This time of course it worked. :) –  Ricky Robinson Sep 17 '12 at 14:30

I did the importation when I open the tex file with Kile, after that opening it with TexnicCenter and finally the Lyx (2.1) in Windows.

share|improve this answer
    
That is very particular (what if I don't have Kile, say) and convoluted... it's most likely just because one of these applications strips unidentifiable characters... –  Werner Jun 27 at 21:01

Your Answer

 
discard

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.