On 2009-04-22, Jean-Marc Lasgouttes wrote: > My goal is to implement the new tag OutputFormat in layout files, that > would complement OutputType. However I'd like to do it right.
Another useful case is the setting in a module. Instead of n >= 3 "*-literate" layouts we could have a "literate" or "noweb" module. > When OutputType is defined, it would imply a default output format > (latex, docbook, literate) > Then one would be able to override it: OutputFormat "sweave" comes to > mind to support R. I would rather provide for extending the list of supported OutputFormats: [latex, docbook, noweb, sweave, lilypond-book, pst-pdf, ... ] actually every format that is known to LyX (but only modules where it makes sense). ... > ?). "platex" seems to be a subformat like "pdflatex" is, but is there > a pdfplatex, or does it only export to dvi? Export/View formats that cannot be generated via a coversion-chain from the documents OutputFormat should be greyed out. > And there is of course the "xetex" case, which is yet another latex > variation. I tend to think that if should be considered qs equivalent > to pdflatex, but things are not as simple. XeTeX (and even pdflatex) could be implemented as module too. > Actually, the goal I had when looking at this code was to allow _any_ > preprocessing of code to take place. If define OutputType "foo", > declare a foo->latex converter and, voilà!, the code will be exported > as normal latex (because of OutputType Latex). From there, the > converter machinery should be able to do its stuff. > > Of course, this will mean some changes: for example LITERATE should > eventually not be an OutputType (which mean that we could have > docbook-based literate programming), but maybe a converter flag, > for example. Actually, even the foo->latex step might be bypassed if there is an alternative converter-chain to the end format. Then, e.g. "literate" (or "noweb", "cweb", "nuweb", "sweave", ....) can remain an OutputType as long as you define a literate -> docbook converter. Günter