[Tex/LaTex] MS Word to LaTeX template conversion

msword

I've started using LaTeX a few weeks ago and I really like it.

Now… I have a bunch of MS Word templates (.dotx files) I'd like to convert to LaTeX. Each of these templates basically consists of fonts, header, footer, several paragraph styles, etc.

Is there any tool or procedure I can follow to automate this Word to LaTeX template conversion?

Best Answer

This answer addresses a specific subset of the cases which the question might apply to.

In some cases. .dot(x) files are relatively simple but, as pointed out by others, they can be more complex. Moreover, the last time I attempted to deal with such things, they were typically created on the basis of a document. Essentially, you created a document with the stuff you needed and then saved it as a template. You could edit them etc., but that was also quite like editing a document.

So, although you can't directly convert a template, you can use it to create a document and then convert that.

In many cases, it will be better not to do this and to start the LaTeX coding from scratch.

However, there are cases in which it can be useful to convert them because, for example, you are provided with a form in .doc(x) format, and need to complete this form regularly. You could turn this into a .dot(x) - at least, if you have Word, you could do this or, if you are like me, you could use LibreOffice instead. Or you could, if you are sufficiently bloody-minded about the whole thing, insist on converting it to a .tex document which you then treat as a fill-in 'template'. And, bloody-minded or not, you might want to merge data to fill multiple forms and have no idea at all how to do that in a word processor but understand perfectly how to use textmerg. If so, a one-time loss of efficiency in converting the form may easily be worthwhile in terms of saving your time and hair later. The mere knowledge that you do not have to tangle with an alien system over and over again may bring a measure of joy and peace to your existence. The knowledge that you never again need fill in the data on triplicate carbon copies by hand or dive into the Auto-Correct Nightmare may enable you to banish the most insidiously pointless of your bureaucratic traumas.

Now you could make it into a proper class or style. That's The Right Way to LaTeX It. But, frankly, life is sometimes too short to worry overly much about ensuring that institutional forms are created using clean code. Especially when they must look exactly as if they were created in Word in order to be acceptable to the institution.

In these circumstances, automatic conversion and minimal clean-up is the way to go.

In these circumstances, wvware does a very good job of producing messy code which produces PDF which looks every bit as bad as the Word original: too tight spacing, crowded tables with gray, shaded bits in odd configurations: you name it, it converts it.

It probably actually does a better job if the original document is logically constructed. I'm guessing all the \textbf{}s I get reflect real changes in the original document which the converter cannot tell are entirely pointless.

The result is an admirably high-fidelity clone of the original, including all aesthetic and typographical atrocities, and thereby ensuring conformity with the most exacting of institutional requirements.

This conversion software has preserved what little sanity I have in the face of institutional paperwork requirements. I highly recommend it to anybody faced with similar organisational demands.

Related Question