I use the command mk4ht oolatex
to convert a simple latex document to odt. So far, it works quite well with a basic document. However, tex4ht inserts a section break before and after some environments, e.g. \begin{quote}
and \end{quote}
will produce section breaks. A <text:section ...>
tag in the converted odt-file, or the contents.xml more precisely, seems to be responsible for this.
Minimal Example:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
This is a normal paragraph.
\begin{quote}
This is an blockquote.
\end{quote}
Another paragraph.
\end{document}
If we compile this with mk4ht oolatex
we end up with this (in content.xml):
<text:p text:style-name="Text-body">This is a normal paragraph.
</text:p>
<text:section
text:style-name="begin-end-env" text:name="begin-end-env-1"><text:p text:style-name="begin-env-p"/>
<!--l. 10
--><text:p text:style-name="quote">This is an blockquote.</text:p>
<text:p text:style-name="end-env-p"/></text:section>
<!--l. 13
--><text:p text:style-name="First-line-indent"> Another paragraph.
</text:p>
In contrast, these passages in a similar document written with Libreoffice looks like this (in content.xml):
<text:p text:style-name="P1">This is a normal paragraph.</text:p>
<text:p text:style-name="Quotations">This is an blockquote. </text:p>
<text:p text:style-name="P1">Another normal paragraph.</text:p>
In ooffice.4ht we find the following definition that seems responsible for this behaviour:
\ConfigureEnv{quote}
{\ifvmode \IgnorePar\fi \EndP
\ifnum \BegEnd:D=0
\gHAdvance\BegEnd:N by 1
\HCode{<text:section
text:style-name="begin-end-env"
text:name="begin-end-env-\BegEnd:N"
>%
<text:p text:style-name="begin-env-p" ></text:p>}%
%
\else
\gHAdvance\BegEnd:N by 1
\hbox{\HCode{<text:p><draw:frame
draw:name="begin-end-env-\BegEnd:N"
draw:style-name="env-frame"
text:anchor-type="as-char"
% fo:min-width="0.14in"
svg:width="90\%"
draw:z-index="0"
>
<draw:text-box
% fo:min-height="0.14in"
>}}%
%
\fi
\gHAdvance\BegEnd:D by 1
}
{\gHAdvance\BegEnd:D by -1
\ifvmode \IgnorePar\fi\EndP
\ifnum \BegEnd:D=0
\HCode{<text:p text:style-name="end-env-p" ></text:p></text:section>}%
%
\else
\hbox{\HCode{</draw:text-box>
</draw:frame></text:p> }}%
%
\fi
\par\ShowPar}
{\EndP \ifvmode \IgnorePar\fi
\bgroup \Configure{HtmlPar}
{\EndP \HCode{<!--l. \the\inputlineno-->%
%
<text:p text:style-name="quote\if@rl-rtl\fi
"
>}}
{\EndP \HCode{<!--l. \the\inputlineno-->%
%
<text:p text:style-name="quote\if@rl-rtl\fi
"
>}}
{\HCode{</text:p>}}
{\HCode{</text:p>}}%
%
}
{\IgnorePar\EndP \egroup \ShowPar \ShowIndent}
So, I guess we should change that definition, but how? How can we suppress those unwanted section breaks?
<text:section>
elements?