1

I included the [1ex] spacing command in a tabular and attempted to convert to ODT using tex4ht (make4ht -f odt file). It doesn't work.

\documentclass{article} 
\begin{document}
\begin{tabular}{lll}
    one & two & three \\[1ex]
    1 & 2 & 3
\end{tabular}                                                                                                                                                                                                                            
\end{document}

The Java interpreter (I think) gives this error message, and everything goes haywire from there:

org.xml.sax.SAXParseException; lineNumber: 59; columnNumber: 8; 
The entity "nbsp" was referenced, but not declared.
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
        at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
        at xtpipes.Xtpipes.execute(Xtpipes.java:1300)
        at xtpipes.Xtpipes.execute(Xtpipes.java:783)
handler="xtpipes.util.ScriptsManagerLH" > : While parsing file file:/tmp/tex/convert.tmp: : org.xml.sax.SAXParseException; lineNumber:
59; columnNumber: 8; The entity "nbsp" was referenced, but not declared.
--- Warning --- System return: 256

Loading the booktabs package and using \addlinespace does convert successfully.

5

The issue is that the configuration for the vertical space in table inserts the &nbsp entity for non breaking space. This entity is not declared in the ODT xml, which results in the Xtpipes error. I will fix this issue in tex4ht, in the meantime you can use the following configuration file, myconfig.cfg:

\Preamble{xhtml}
\Configure{HBorder}
   {<table:table-row  \Hnewline table:style-name="hline-row">%
}
      {<table:table-cell table:style-name="hline-cell"
                         table:value-type="string">%
          <text:p text:style-name="hline-p-hr"  />%
       </table:table-cell>\Hnewline
}
   {</table:table-row>\Hnewline
}
   {<table:table-row\Hnewline table:style-name="cline-row">\Hnewline
}
      {<table:table-cell table:style-name="cline-cell">%
          <text:p text:style-name="cline-p"  />%
       </table:table-cell>\Hnewline
}
      {<table:table-cell table:style-name="cline-cell">%
          <text:p text:style-name="cline-p-hr"  />%
       </table:table-cell>\Hnewline
}
   {</table:table-row>\Hnewline
}
   {<tr\Hnewline class="vspace-si-delas" style="font-size-grr:\HBorderspace">%
}
       {<td\Hnewline>\string&\csname :sharp\endcsname xA0;</td>%
}
   {</tr>%
}

\begin{document}
\EndPreamble

This configuration inserts the &#xA0; entity, which should be OK. Compile using:

make4ht -f odt -c myconfig.cfg file

The result in LO:

enter image description here

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.