6

For a variety of reasons, I'm using LyX as my primary LaTeX document creation tool, but I want to avoid doing things or relying on features of LyX that make it hard to use other tools as well. While I've been able to configure LyX to make it possible to move the generated TeX into any other editor (e.g., I can simply paste my TeX code into TeXShop, and it works) I'm unclear on what command lines are required to perform various build tasks.

Is there a way to find out what command lines correspond to the various LyX "View" menu commands? Are these listed somewhere? For example, what commands (pdflatex? biblatex? etc.; with what arguments?) does the View > View [PDF (pdflatex)] menu command execute?

1 Answer 1

6

I think these are the ones listed in Tools --> Preferences --> File Handling --> Converters (see screenshot at the bottom). There you can see the command line arguments used.

$$-variables

The $$<letter> variables refer to the following (from the LyX Customization manual, found under Help --> Customization, section 3.3):

  • $$s The LyX system directory
  • $$i The input file
  • $$o The output file
  • $$b The base filename of the input file (i.e., without the extension)
  • $$p The path to the input file
  • $$r The path to the original input file (this is different from $$p when a chain of converters is called)
  • $$e The iconv name for the encoding of the document.

Extra flag

Quoting the manual mentioned above:

In the Extra Flag field you can enter the following flags, separated by commas:

  • latex This converter runs some form of LaTeX. This will make LyX's LaTeX error logs available.
  • needaux Needs the LaTeX .aux file for the conversion.
  • xml Output is XML.

The following three flags are not really flags at all because they take an argument in the key = value format:

  • parselog If set, the converter's standard error will be redirected to a file infile.out, and the script given as argument will be run as:

    script < infile.out > infile.log.  The argument may contain `$$s`.
    
  • resultdir The name of the directory in which the converter will dump the generated files. LyX will not create this directory, and it does not copy anything into it, though it will copy this directory to the destination. The argument may contain $$b, which will be replaced by the base name of the input and output files, respectively, when the directory is copied. Note that resultdir and usetempdir make no sense together. The latter will be ignored if the former is given.
  • resultfile Determines the output file name and may, contain $$b. Sensible only with resultdir and optional even then; if not given, it defaults to index.

enter image description here

5
  • Thanks. Some other things must be going on too though. For example, how does LyX decide when to rebuild the bibliography: it seems to be necessary to close and reopen the LyX file to get this to happen? Also, of course, LyX must be appending to these in order to launch a viewer or save a file, or cache somewhere, when employing these converters in Export vs. View vs. Update commands. And: I assume $$i = source file name, $$o = output file name (though I don't understand how some converters can omit $$i if that's true), and it's not clear what $$r is.
    – orome
    Commented Mar 15, 2012 at 16:51
  • Also (sorry) what does the "Extra flag" field do? In the example above latex=pdflatex is not a pdflatex option (that I can find in the manual).
    – orome
    Commented Mar 15, 2012 at 17:00
  • @raxacoricofallapatorius I assume LyX uses a script such as latexmk in the background, that checks if extra runs of pdflatex or bibtex is needed. -latex=pdflatex may be an argument to such a script (latexmk has something like that). As for $$r and $$s, I cannot say. One could perhaps be filename without extension (e.g. file instead of file.tex). Converters without $$i could be wrongly configured, I suppose. Commented Mar 15, 2012 at 17:17
  • @raxacoricofallapatorius Help --> Customization, there is some info about this in section 3.3. I added most of this to the answer. Commented Mar 15, 2012 at 18:43
  • Good answer! Another way, although ad hoc, is to open LyX from the command line if you're on Linux. The terminal output often says what commands it runs. If you want all of the possible output, run using lyx -dbg any, which turns debugging on. You might want to redirect the output of this command to sort through the output because otherwise it will flash by. Similarly, you can go to View > Messages (don't forget to look at the Settings to control what output appears).
    – scottkosty
    Commented Mar 15, 2012 at 21:41

You must log in to answer this question.

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