[tex4ht] tex4ht and scrjura (KOMA-Script)

AW alexander.willand at t-online.de
Sun Jan 22 22:19:02 CET 2012


Dear readers,

I dare to bother you with a question I asked some months ago here:

http://tex.stackexchange.com/questions/25555/configure-tex4ht-for-package-
scrjura

The answer I got did not solve the problem. So let me ask here:

I'm drafting agreements on the topic of renewable energies. Trouble is, 
clients sometimes need a word-version = my agreement in html. The package 
tex4ht does the job pretty well, unless I use the package scrjura, a part of 
the KOMA-Script-bundle. But scrjura makes writing my agreements a lot easier, 
I would not like to do without it. The package allows to print the agreement 
in accordance to German standards.

See this example:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{scrjura, indentfirst}
%\usepackage{tex4ht}

    \begin{document}
    \begin{contract}
      \Paragraph{title=Does it make sense?}

    This first sentences usually talk about the sense of the whole
    contract / agreement / whatever. Unlike many people think, it is not
    forbidden to lawyers to write plain text.

    But there are obstacles. We need some definitions.

    \Paragraph{title=Share-purchase}

    Let's assume we talk about a share-deal agreement. We'd have to name
    the shares.

    And the price.

    \end{contract}

    \end{document}

The pdf pdflatex produces is pretty. The html by tex4ht unfortunately not. 
Most of the format gets lost. 

On tex.stackexchange somebody suggested to save the code below as 
"scrjura.4ht":

==============================================

\typeout{[scrjura for tex4ht]}

\ConfigureEnv{contract}{\HCode{<div class="contract">}}{\HCode{</div>}}{}{}

\append:def\parformat{\a:parformat} 
\append:def\parformat{\b:parformat} 
\NewConfigure{parformat}{2}
\Configure{parformat}{\HCode{<br /><span class="sentence" />}\EndP}{}

\append:def\contract at paragraph@font{\a:contract at paragraph@font} 
\append:def\contract at paragraph@font{\b:contract at paragraph@font} 
\NewConfigure{contract at paragraph@font}{2}
\Configure{contract at paragraph@font}{\HCode{<br /><span class="paragraph" />}}
{}

 \Css{.sentence{margin-left:2em;}}
===============================================

But the result still is poor, compared to the pdf. It seems, that the author 
of scrjura, Markus Kohm, took a deep dive into the realms of TeX to realise 
scrjura:

http://www.komascript.de/node/1540

This forum is in German, but Markus simply says, that the origin of 
difficulties might be the usage of low-level TeX-commands inside scrjura.

Ahm, anybody here who understands both: TeX and tex4ht? If I can help, e.g. by 
translating comments of the source code of scrjura or else: well, sure!

Kind regards,

Alexander


Can you help me to enhance scrjura.4ht? Or is there another way to keep 
scrjura and to use tex4ht?


More information about the tex4ht mailing list