We put everything in a shell script. We don't want to bother about anything else. We want to ponder comfortably upon the meaning of life while drinking some coffee or tea, watching our computer do
the work for us - personally, a very rewarding experience :-)
We use sed to correct LyX' SGML output. The more we are able to correct, the more SGML features we get out of our plain
We use the sgmltools package which hides a lot of details from the end user, giving nonetheless all the power of the involved tools.
The current version of the lyxtox script make less use of sgmltools, due to the need of processing intermediate results for the integration of Mathematics,
Bibliography etc. The originally used calls to sgmltools are nonetheless included in the comments of that script to demonstrate alternative ways of achieving the same result.