Templating system for documents

Mike el.fontanero-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue Jan 12 22:44:33 UTC 2010


On Tue, Jan 12, 2010 at 4:53 PM, David J Patrick <djp-tnsZcVQxgqO2dHQpreyxbg at public.gmane.org> wrote:
> William O'Higgins Witteman wrote:
>
>> I've used desktop publishing platforms and authored documents for the
>> web, and I've also used LaTeX - none of these systems seems right for
>> what I want to do.  Does anyone have a method for creating correctly
>> styled documents without terrible pain and suffering?
>
> your pain and suffering will be directly proportional to the persnickityness
> of the "correctly styled document". What standard are you working to ? I can
> think of a few scriptable solutions, mostly starting by stripping the docs
> with unword (or similar) but as they get more exacting in output style, they
> move from a2ps back towards LaTeX (which shouldn't be that bad, if you can
> establish the stylesheet and then script most of the rest) and then
> PDFlatex.
>
> It's like ripping off a bandaid; an "ouch" now, or you can be picking at it
> forever.
>
> djp
>

Speaking as someone who has, for the most part, ripped off the
Microsoft Word 'bandaid', I find that DocBook XML is a joy to work
with... in comparison. Do I like super tag-heavy XML? Shrug. What I do
like is being able to use PHP DOM to read/process/write structured
DocBook. Incidentally, all my documents and embedded SVG graphics are
now text, happily manipulable using source code control tools...

I've found that most of the 'ouch' comes from adding XSL stylesheets
to customize the default ones that come with DocBook. Having done
that, however, I now have a fast, reliable DocBook XML -> xsltproc ->
APache FOP -> PDF toolchain.

Converting Word to DocBook isn't even all that difficult. The docbook
XSL distribution comes with a set of "roundtripping" utilities.
Briefly:

   1. Reformat your Word file according to the docbook-ish styles
       in the word template provided in the roundtripping tools.
   2. Save your file in WrdML XML format (MSOffice 2003)
   3. Run the WordML file through the necessary XSL stylesheets in
       the roundtrip tools
   4. A bit of DocBook XML cleanup and you're in business.

Cheers,
Mike
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list