Thanks a lot for the quick reply! > 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.
I think I'll give a try to the route involving LaTeX and RTF, without using LyX... this seems promising enough. I wonder if the RTF route (compared to HTML) can do a better job at handling page breaks and complex tables... I guess I'll have to give it a try to know! But thanks a lot for the several possibilities you ennumerated, gives me a few good options! =) > 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. I think you're right. I mainly thought LyX could output msword documents... but I've done my homework and read several pages on the website/wiki and seems like anything2msword is tricky! > 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. What's most overkill is that I'd have to learn LyX for so little advantage after all... unless there are some other advantages related to my tasks that LyX could help with... > 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. This is exactly my plan (or the basics of it). Since a few things might "get lost in the translation", I'll work on building such functions that give the most stable final output. Since I'm only concerned about the final output, I wont have to work on making both the LaTeX->PS output and the msword render the same (though this would be highly convenient). Thanks a lot! Simon