stefan wolfbauer wrote:
I have experienced several times, that Lyx itself creates errors in latex code. 
I suddenly have errors in the middle of simple text and the conversion of the 
document to anything else fails. Also sometimes when opening a document it gets 
truncated and only a tiny part of it gets displayed.
1.) If it is possible, how can i prevent lyx from making coding errors (my 
documents contains a few images, references and formulas, but nothing more 
complicated than that)?
Ideally, LyX shouldn't make errors.  But it happens. Often there is
a simple explanation and the problem can be avoided. For example,
when using images, make sure the filenames (and pathnames)
involved do not contain spaces or other "weird" characters.
Apostrophes, spaces, underscores, braces and brackets and such
is _supposed_ to work - but if you have them - try changing that
and see if that helps.  If it do - please report the exact problem.

Storing the LyX file in a directory with a troublesome name
can be dangerous too.  Spaces ought to work, this has been tested
quite a bit due to windows using the "My Documents" path.
Still, older versions of LyX and some versions of latex will
trip up on that.

2.) If there is an error, how do i get lyx/tex to convert, what it can even if 
the result is ugly, instead of refusing to convert anything at all?
Look at the error message, sometimes they give a hint. Or post the
error message here, so latex experts can have a look.

The most common source of errors are latex code in the preamble,
or TeX boxes in the document. Try removing such things.  If restoring
them is lots of work, make a test copy of the document.

Other problems with images is the case where the image is
erroneously inserted in the caption of a float.  (Lyx 1.5 makes this
particular mistake harder to do.)  Position the cursor next to the image,
check that the paragraph type is "standard", not caption. If it is caption,
reset it to standard. The caption (if you want one) should be a
paragraph of its own.

Images in a heading might also cause trouble, especially if your document
has a TOC or running headers.

3.) Till now, i have always resolved such errors by randomly switching between 
versions of lyx or exporting as latex and reimporting or uninstall/reinstall 
while choosing all options different than with last install or things like 
that. When worst case happens and i am unable to continue my work in lyx, how 
do i convert to open office (especially, how do i convert something that throws 
latex errors to open office) (there is an export function, but that one always 
silently fails, in addition it needs a latex run)
Thank you!
Conversion: If latex fails you, consider marking text in LyX and
pasting into openoffice.  This looses all formatting except paragraph
breaks.  A last resort, but you get the text out.


You are sure that your computer is stable, that none of these truncations
have other explanations (faulty hardware or
crashing/turning the machine off without proper shutdown).
This would affect all other software making files too though.
And of course  no disk/quota-full conditions and no viruses.
I have never seen LyX truncate anything before, except when I had
trouble with a network filesystem. But then, just copying files
would screw up too.

It is occationally possible to get LyX to make invalid latex (without
using TeX code in the document)  Always report such things, and provide
the document unless it is confidential.  You can of course send a document
to a developer without posting it to a public mailing list.

There is also the somewhat tedious way of opening a faulty but confidential
document in a text editor (notepad, vim, nano, ...) and carefully replace
every sentence with sequences of X'es, without touching any of the
formatting commands.  Then, chech that the anonymized file
still opens fine in LyX and still produce latex faults. You may then post the censored file here. Debugging usually need the
formatting, not the exact text.  Always check that the censored file
still have the problem though.

Anything causing random file truncation can of course lead to
latex errors too - if the latex file get truncated.

Helge Hafting

Reply via email to