2

I need to HTMLize several largeish, complex LaTeX documents. Looking around, I see praise for make4ht. But there are several snags, that the documentation states can be sidestepped by a .mk4 configuration file for the file. Reading the documentation bundled with it in TeXlive I wrote a test configuration file poly-zero.mk4 for poly-zero.tex like the documentation seems to suggest:

Make:latexmk

(I fully intend to add more to this). But I just get:

Output dir:     
Compiler:   latex
Latex options:   -jobname=poly-zero 
tex4ht.sty :    xhtml,
tex4ht  
build_file  poly-zero.mk4
Output format   html5
Using build file    poly-zero.mk4
[string "Make:latexmk_build..."]:2: function arguments expected near <eof>
/usr/share/texlive/texmf-dist/scripts/make4ht/mkutils.lua:417: assertion failed!

So the documentation-mandated Make:latexmk is dead wrong.

Any reliable (hopefully also complete) source on how to configure make4ht? I'm completely ignorant of lua, BTW.

1 Answer 1

2

You need to use valid Lua code in the build file, so you must add () to all commands. The correct form is thus Make:latexmk(). The documentation is maybe a bit confusing on this point, because it doesn't list available commands with parentheses. It is preceded by the section about build files where it is discussed an example is provided.

6
  • Damn diagonal reading... and documentation that talks about several types of configuration files, without telling of differences (in format, ...) or no. Thanks!
    – vonbrand
    Commented Aug 24, 2020 at 21:31
  • @vonbrand I can try to make the documentation more clear. do you have any suggestions?
    – michal.h21
    Commented Aug 24, 2020 at 21:58
  • Please do document switches (what does -u mean?) How to invoke extensions (what is tidy? How do I get it to decompose ligatures -- here they just diissapear? The list is long. The examples given have no explanation of what they do (it seems they are silly uses of the machinery, not anything remotely realistic). Get rid of all the talk about htlatex problems (or move that to an appendix), I want to use make4ht precisely because I don't want to meddle with those. Give some configurations for realistic tasks (want HTML + MathML, UTF-8, images in e.g. SVG, in directory so-and-so).
    – vonbrand
    Commented Aug 24, 2020 at 22:25
  • How do I generate HTML and PDF, reusing as much as possible in terms of intermediate files? (Running LaTeX six times, BibTeX twice, ... isn't much fun for a 400+ page document). How do I split the document into e.g chapters/sections? Can I generate subdirectories for chapters, with files for sections?
    – vonbrand
    Commented Aug 24, 2020 at 22:31
  • 1
    @vonbrand thanks for the suggestions, I will try to incorporate them. The up-to date documentation is on my website - it is generated automatically on every commit. The version shipped in TeX Live is bit older, especially if you use TL 2019.
    – michal.h21
    Commented Aug 25, 2020 at 8:30

You must log in to answer this question.

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