2

When using newfloat to create a new type of float, tex4ht swallows the first line of text inside the float when it converts to .odt format.

In the MWE, the new float is example; this works the same as table when compiling with pdflatex, but tex4ht treats the two environments differently in the.odt.

\documentclass{article}

\usepackage{newfloat}
\DeclareFloatingEnvironment{example}

\begin{document}

See example~\ref{ex:music}.

% First line will disappear in ODT
\begin{example}
Explanatory text.

More explanatory text.

\caption{Musical example}
\label{ex:music}
\end{example}

See table~\ref{table}.

% All text will appear in ODT
\begin{table}
Explanatory text.

More explanatory text.

\caption{Table}
\label{table}
\end{table}

\end{document}

PDF output from pdflatex file (twice):

enter image description here

ODT output from pdflatex file && mk4ht oolatex file && libreoffice file.odt

enter image description here

  • The same thing happens if I use the float package. – musarithmia Mar 28 '16 at 20:10
1

Did you ever try plastex?

call with

 plastex --theme minimal --sec-num-depth 0 --split-level 0 <filename>.tex

I have tried it, but I cannot get an odt file directly. I opened the html file via open office....currently. enter image description here

Have a look...

  • 1
    I haven't: does it produce better results? – musarithmia Apr 3 '16 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.