4

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?

4
  • 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, 2012 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. Sep 16, 2012 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. Sep 16, 2012 at 14:15
  • I updated to Lyx 2.0.4, but got the same error. Sep 17, 2012 at 9:14

3 Answers 3

6

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.

5
  • 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. Sep 16, 2012 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, 2012 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. Sep 17, 2012 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, 2012 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. :) Sep 17, 2012 at 14:30
1

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.

1
  • 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, 2014 at 21:01
0

If you change the document class from svjour3 to revtex and the converter works well! If you still need to work in a svjour3 or report class, reconstruct an empty LyX file from the template and copy all things you obtained from the revtex class and this may solve the problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .