On 09/09/2011 02:57 PM, Tommaso Cucinotta wrote:
Il 09/09/2011 19:45, Tommaso Cucinotta ha scritto:
Il 09/09/2011 14:31, Jean-Marc Lasgouttes ha scritto:

Perosnally, I'd prefer to avoid this syntax of 'everything until the end of line', and stick with the good old
 -x "buffer-export latex \"/path/to/file name with space.tex\""
which LyX should be able to handle transparently with a few changes.

How would you like to use that from the mini-command-buffer ? Something like this ?

I also checked the front-end part by Guenter, and I have to say we had that potential issue
that

  lyx -o path -e latex

would work, but

  lyx -e latex -o path

would not.

So, in the end, I thought the best way to support this, given how the command-line parser is currently structured, was through a dedicated separate switch with 2 arguments:

  lyx -E latex /path/dest.tex

or

  lyx --export-to latex /path/to/dest.tex

This is implemented in the attached patch. Can I commit to trunk, or do you have further comments ?

One very last remark: the only alternative I can actually think of, is to have 2 possible formats for the "-e" argument: either a format-name, or a filename with extension. In the latter case, the export format would be inferred by extension. That would mean:

  lyx -e /path/to/myfile.tex mydoc.lyx

I have to admit I used myself multiple times exactly this syntax by mistake in writing Makefiles, then I switched to the right syntax after seeing it wasn't working. Of course, in case of multiple formats with the same extension, this type of syntax would have to prefer one export type over another.

At present, the argument to -e is a format, and could be pdf2, pdf3, etc. You can't infer that from the extension.

Richard

Reply via email to