On 09/29/2009 07:13 PM, Simon wrote:
While on the other hand, authoring documents with MS tools is
extremely painful to me (i got the skin of a tux i guess!) and working
with OpenOffice is also quite painful... I've tried converting HTML
to Office documents and got great results sometimes, while I got
horrible results other times (compatibility issue, like the story
about MSword not allowing tables inside tables!). Conversion seems a
dangerous route (specially that I only own an old copy of office to
test the result...).
I used to do my lab reports and several homework in LaTeX long ago
when I was in highschool and college, so I do have some memory of what
it's like to use tex.
The ideal route would be: myProg -> (lyx?) -> msword
Something like this can work, but conversion from LyX to * generally
relies upon LyX->LaTeX->*, though there is an exception, namely, the
elyxer LyX->HTML converter. Whether you'd get decent results with that,
given the problems you said you already had with HTML->Word, is hard to say.
That said, there are decent LaTeX->RTF converters, which means there's a
decent LyX->RTF converter, and there's a good LaTeX->ODT converter,
namely, the oolatex program that comes with tex4ht. People often have
problems with oolatex on Windows, but it seems to work real well on
Linux. Of course, you'd then have to do a manual ODT->Word (or
RTF-->Word) conversion in OOo, or write a simple script to do it using
the OOo scripting capabilities. And then you have yet another step in
the conversion chain, so YMMV, obviously.
So, *all* of that said, given that you're going via LaTeX anyway, and
given that we're talking about generating this document programatically,
I'd think that writing your script to generate LaTeX is going to be a
lot easier than writing it to generate LyX's native file format, which
is not exactly made for such things. Though you could use LyX's other
scripting capabilities, via the so-called LyX server, to create the
document, that seems to me like overkill, if what you want in the end is
LaTeX. And LaTeX itself is sufficiently well-structured, and human
readable, that I doubt you'd have too much trouble generating it. I can
imagine something kind of like the old Perl cgi interface: a set of
routines that completely hides what LaTeX is doing, but allows you to
generate the document via a series of simple calls, like:
doc->makeSection('My Section'), and so forth.
Anyway, hope that helps.
rh