# How to write tex4ht source files

How can I learn how to edit 4ht files? What should I read?

I want to fix a number of issues in ooffice.4ht (inconsistent footnote size, style names which mismatch names used by LibreOffice, dangling space at the end of sentences, etc.)

I've read the chapter on tex4ht in the LaTeX Web Companion, but I'm still unable to read, let alone modify, it.

-

Open document format is big and ugly, so ooffice.4ht is also big and ugly. If you want to better understand, what is going on, you must understand some basics, which are described in resources posted in your post.

ooffice.4ht also add some custom macros, useful for dealing with styles. There are two types of styles used here. One are defined in file with text content, an they are configured like in the answer about inconsistent footnotes:

\Configure{automatic-styles}
{\csname a:footnote-style\endcsname}
\NewConfigure{footnote-style}{1}
\Configure{footnote-style}{%
<style:style style:name="Footnote-text" style:family="text">
<style:text-properties fo:font-size="10.0pt" />
</style:style>
}


With \NewConfigure{footnote-style}{1} you are declaring new configuration footnote-style, with one parameter. With \Configure{footnote-style} you declare the style and \Configure{automatic-styles} is inserting call to the declared configuration footnote-style. You must use internal name a:footnote-style, this is created automaticaly by NewConfigure.

Other style macros are \NewConfigureOO and \ConfigureOO:

\NewConfigureOO{textul}
\ConfigureOO{textul}{<style:style style:name="textul" style:family="text">
<style:text-properties style:text-underline-style="solid"
style:text-underline-width="auto"
style:text-underline-color="font-color"
/>
</style:style>
}


These configurations go to the settings.xml file. I don't know what is the key about what styles belongs to styles.xml and which to the content.xml, you must find that in odf documentation.

Other parts of that file deals with command redefinitions for inserting configurable hooks and providing xml configurations with these hooks.

-

### tex4ht:

1. documentation in source repository.

2. more on configuration at tug.org

3. Michel Goossens, Sebastian Rahtz et al. The LaTeX Web Companion. Addison Wesley, 1999, pp. 169-194,404-415.

### ooffice.4ht:

1. Maarten Wisse (2002) “Hacking TeX4ht for XML Output: The Road toward a TeX to Word Convertor”, MAPS 28, 2002, pp. 28-35.
-