Jean-Pierre Chretien wrote:
notes appear at the very begining of the document they are: missing $ inserted and bad math environment delimiter. The first math formula appears many pages later and the error appeared during the time I was working on chapters in the middle of the document. So I do not understand where the errors could be. I tried to go to the tmpdir and to run pdflatex directly, but it was compiling fine, but the index of the resulting file had a strange line. So I checked it and found \( and \) in an index field I removed them and it is now compiling fine with lyx !!Date: Tue, 06 Jul 2004 15:24:38 +0300 From: Robin Turner <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: How to debug a lyx file: where the error is?
[EMAIL PROTECTED] wrote:
Hello!
May I ask you a question?
I have a 40 pages document with 2 lyx errors in it. The lyx latex error
Ah, index entries.
Be aware that latex don't accept just anything in a index entry,
or in a label for referencing. Lyx doesn't check the content of
index entries or labels, it merely pass the stuff on to latex.
So it is easy to break latex with a ill-formed label or index entry,
for example one containing a "{" or a "_" or a number of other special characters.
Lyx cannot simply outlaw such constructs either, they are useful if you want actual latex commands in an index entry (in order to have things such as a bold index entry and other things not yet supported directly by lyx).
If you want to know the exact rules, look up indexing and cross referencing in a latex book. Or stick to simple alphabetic entries only.
What bug fighting strategy do you recomend in this kind of case?
Knowing that it was a index problem, check offending index entries. Looking at the latex file will likely give you some context so you won't have to check them all.
As a side remark, it's logical from the point of view of developers to fail to produce output until the document is bug-free: if there is no ERT at all (or preamble declarations, or local .tex inputs), the compilation should run without errors.From the point of view of an user in a hurry to output a documentdue yesterday, Lyx could allow (as a preference setting) to produce output even in case of errors, to avoid exporting to latex to do so.
This is a hard problem. How should lyx produce that output? It can run latex+dvips/pdflatex in spite of errors, but you'll end up with an empty document or a document that ends at the first error more often than you'll like. :-(
I recommend producing pdf (or ps od dvi) now and then to see that things work. That may be time-consuming for a large document, such as a book. If so, consider exporting to latex and run "latex filename.tex" in the background. You can then keep writing in lyx or do other work while latex slowly makes test output. (On unix: use "nice latex filename.tex" so the latex job won't slow down your computer)
Helge Hafting
