Les Denham wrote:
On Thursday 04 October 2007, you wrote:
The .lyx file format is a text format, modifying it should be no harder
than modifying latex.  LyX can even import latex files, if you
prefer to modify/generate latex code.

LyX has enough batch features that a script can create pdf/ps without
anyone having to run LyX manually.

Helge,

I know Lyx is plain text, so modifying it is easy. My problem is that the format of it does not seem to be as well documented (or as forgiving) as LaTeX
You are right, it is not well documented. It is probably
easiest to figure out by making a file with the features you want,
and then look at the saved file. The alternative is to
read the LyX source code.
.

Also, I haven't been able to find any documentation of the batch features of Lyx. Can you point where to look?
From http://wiki.lyx.org/FAQ/Running#toc2


   How do I convert LyX files to LaTeX from the command line?

File export was vastly improved in version 1.1.6. Simply say

 lyx --export latex <yourfile>.lyx

and that is all you need to do.

Also, try
lyx --help
which will show you:
Usage: lyx [ command line switches ] [ name.lyx ... ]
Command line switches (case sensitive):
       -help              summarize LyX usage
       -userdir dir       set user directory to dir
       -sysdir dir        set system directory to dir
       -geometry WxH+X+Y  set geometry of the main window
       -dbg feature[,feature]...
                 select the features to debug.
                 Type `lyx -dbg' to see the list of features
       -x [--execute] command
                 where command is a lyx command.
       -e [--export] fmt
                 where fmt is the export format of choice.
       -i [--import] fmt file.xxx
                 where fmt is the import format of choice
                 and file.xxx is the file to be imported.
       -version        summarize version and build info
Check the LyX man page for more details.

I am not sure about the LyX commands, but the
exports I know. They are the same exports as found in
the file->export menu.

You can look up the names under
tools->preferences->file formats. Each format has a "short name"
that you can use with the --export switch.
So you can export latex, pdf, html and anything else for which
a converter exists.

You can also look up formats in the file .lyx/lyxrc.defaults
The fourth column has names as seen on the file->export menu,
such as "latex(pdflatex)"
The second column has the names used with the --export switch,
such as "pdf2"

Be aware that not all the formats are "export" formats, some are
just for graphichs conversions, some are for inclusion of figures.
Those that exists on the file->export menu should be ok for
exporting, which I guess is the batch feature you need.

Helge Hafting

Reply via email to