3

I am working on a multi-file document in LyX (my thesis) and occasionally have problems where LyX seems to rely on old version of intermediate files when updating the PDF output. Is there an easy way to force a clean/refresh from scratch within LyX?

For example, I have a separate LyX file that uses exclusively raw LaTeX (in ERT mode) to define acronyms that are shared across chapters. I then conditionally include this file in each chapter to enable building stand-alone chapters for review. The problem is that when I make and save changes (e.g. spelling) to an existing entry in the acronym file, the changes do not automatically show up in the PDF output on the next view "Update" (Shift--R) or if the PDF preview is build with "View" (-R). As a work around, I have forced a refresh by adding a new dummy entry to the acronym list, which apparently forces LyX to rebuild the temp files in a different way.

I have experienced similar issues with other non-plain text edits.

Any ideas of how to force a complete temp file re-build when updating the view?

I am aware of the low-level (La)TeX answers from this post but am looking for a LyX specific method, ideally one available through the graphical interface.

Environment: LyX 2.0.4, pdfLatex, Mac OSX 10.7.4

7

Based on an informal discussion entitled "how to update .aux file in LyX?" (with the current "stable branch maintainer", Jürgen Spitzmüller) it seems that LyX automatically reruns a file based on an evaluation of the .log file. Another motivation for this stems from the LyX documentation on Customizations (under the menu item Help > Customizations, section 5 Installing New Document Classes, Layouts, and Templates):

First, let us a say a few words about how one ought to think about the relation between LyX and LaTeX. The thing to understand is that, in a certain sense, LyX doesn't know anything about LaTeX. Indeed, from LyX's point of view, LaTeX is just one of several “backend formats” in which it is capable of producing output. Other such formats are DocBook, plaintext, and XHTML. LaTeX is, of course, a particularly important format, but very little of the information LyX has about LaTeX is actually contained in the program itself.

For example, the default LaTeX warning message

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

would initiate a re-compile, while the etaremune-specific warning message

LaTeX Warning: Etaremune labels have changed.
               Rerun to get them right.

was "a specific syntax" that needed to be considered. Another example from the totcount package:

Package totcount Warning: Rerun to get correct total counts on input line ???.

that is not referenced as a "LaTeX warning", but rather a "package warning". Moreover, there seems to be no interest in implementing a forced, full, recompile (more than once) option in LyX. So, if the change does not initiate "a known warning", no recompile will be performed.

A suggestion would be to post this, in the form of a full example of your document usage/structure that shows the validity of such an option as being a feature, on the LyX mailing list. See their Get involved or Mailing Lists page for a reference.

  • It is unfortunate that there is no interest in implementing a forced, full, recompile option. Seems there will always be unknown warnings, and such a feature would provide a valuable work around. – Bryan P Dec 12 '13 at 8:35
1

The following is a hack, based on Werner's answer, and will likely force more recompilations than necessary and possibly have other unintended consequences. However, since it has helped some, I "log" it here:

Go to Document > Settings > LaTeX Preamble and paste the following:

\wlog{LaTeX Warning:Rerun to get cross-references}

What this does is write to the log file to trick LyX into thinking that it needs to recompile for one of its hard-coded situations.

  • I guess that LyX has to have some way to stop itself, to avoid falling on an infinite loop. If LyX stop runing until does not have warnings that sugest to rerun, your solution have the risk to fall in an infinite loop. Have you experienced your hack? – djnavas Jul 1 '18 at 5:24
  • @djnavas There's a hard-coded maximum of 6 runs in LyX (if curious, see here). – scottkosty Jul 1 '18 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.