4

I have a LaTeX document which has some \clearpages issued and which I'm trying to convert to ODT using tex4ht. While it is understandable that \clearpage is ignored in html output, it would also make sense to have it considered in a ODT output.

Consider the following document:

\documentclass{article}

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\clearpage

\lipsum[2]

\end{document}

Processed with:

make4ht -f odt document.tex

Will output a single page:

enter image description here

How could I get the \clearpage respected?

1 Answer 1

3

Try this config file:

\Preamble{xhtml}
\begin{document}
\csname append:def\endcsname\clearpage{\Hclearpage}
\EndPreamble

It appends \Hclearpage command after \clearpage. This command inserts:

 <text:p text:style-name="clearpage"></text:p>

It requests the page break:

enter image description here

13
  • Nailed it, yet again! Thank you. One detail, for the config file, is there a way to call it implicitly (that is, not as an explicit command option)? (like with the equivalent for filename.mk4 for a filename.tex on the local directory). This would facilitate my automation of things.
    – gusbrs
    Commented Jun 6, 2018 at 21:12
  • @gusbrs you can add it in the configuration file, using set_settings{tex4ht_sty_par = "cfg_file_without_extension," .. settings.tex4ht_sty_par}
    – michal.h21
    Commented Jun 6, 2018 at 21:41
  • michal.h21 Thank you, but I cannot follow the whole chain. When I read the documentation I thought those are the places where .cfg would be found by make4ht. If I understand your suggestion, if I add this line to a file named .make4ht located in the documents' directory and have a file named filename.cfg also in this directory running make4ht on filename.tex will find the .cfg file automatically. Is that correct? Would it be also possible to set this in the .mk4 file?
    – gusbrs
    Commented Jun 6, 2018 at 22:13
  • I got it to work with .make4ht. Thank you!
    – gusbrs
    Commented Jun 6, 2018 at 22:59
  • 1
    @gusbrs I've finished the new version of ODT support in the development version of make4ht, so it is ready for testing :)
    – michal.h21
    Commented Jun 13, 2018 at 7:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .