On Mon, Mar 06, 2017 at 03:59:53PM +0000, Alexandru Băluț wrote: > I'm converting a LYX file to PDF from the command line and the conversion > apparently fails, the exit code of the process is 1: > $ lyx -e pdf2 docs/myfile.lyx -dbg latex > > The process reports failure even though it did actually create a PDF file > which seems to be complete and usable. Is it safe to ignore the exit code > in case it managed to create the PDF?
No you should never ignore the exit code from any command. A non-zero exit code means an error. > When I do the export to PDF from the UI, I get the errors below. Why do > they appear twice? > LaTeX Error: \begin{document} ended by \end{thenomenclature}. > Extra \endgroup. > LaTeX Error: \begin{document} ended by \end{thenomenclature}. > Extra \endgroup. I think the general advice is only to pay attention to the first LaTeX error. > I kept removing stuff and I got to a point where I have a section 2.2.3 > containing some simple text and if I remove its text leaving the section > empty (only the title), exporting to PDF succeeds with no errors, whereas > before it failed. I don't see how I could minimize the lyx file to be able > to report the bug. I don't understand. Why not? If there is a word in section 2.2.3 and LyX exports with error with it and with no error without it, then the MWE would include the word and in your description you would state "when I remove the word abc, the error goes away". For more information, see: https://wiki.lyx.org/FAQ/MinimalExample > Side question: Removing paragraphs led to broken refs: "BROKEN: Ref: ...". > To me these seem important, one would not want the final document to > contain them, but maybe I'm missing something. Why are these errors ignored > when exporting to PDF? Is there a way to validate a lyx file from the > command line, and in such a way that these errors are not ignored? I > searched for "compile lyx file" but did not find much. I think there is a LaTeX package. Alternatively, in LyX in the outline you can view labels and references. just filter for "BROKEN" and you will see the current ones that are broken. Scott
signature.asc
Description: PGP signature