[tex4ht] Multitude of problems when trying to convert from .tex to .html.

phseiff phseiff at phseiff.com
Sat Mar 6 01:20:18 CET 2021


Hello, everyone!

I am trying to convert some .tex files to .html files (I am hoping to 
automate this process over the next view days as part of a pipeline), 
and I ran into a couple of problems doing so. The documentation I found 
assumes that these problems don't happen, and everything I found so far 
wasn't able to solve these problems, so I decided I'd just ask for it 
here directly.

The tex file I am trying to convert can be found here 
(https://raw.githubusercontent.com/phseiff/gender-render/main/docs/spec.tex), 
and the command I am using to convert it is `htlatex spec`.

  * Running `pdflatex spec.tex` works fine, so the files validity as a
    LaTeX file is probably not the issue, but `htlatex` chokes on it
    several times (fails with a `?` and reruns again once I enter `q`
    and press enter, for a total of 3 runs).

  * The process ends with `System call: rungs -q -dNOPAUSE -dBATCH
    -sDEVICE=pngalpha -r300  -sOutputFile='images/title-black-.png'
    images/title-black.pdf`. This is apparently because I embed a
    .pdf-file into the tex file via `\includegraphics`, which htlatex
    attempts to convert to png using a tool called rungs, but googling
    `rungs` yields no results except some posts of people who ran into
    the same problem I did, like this
    (https://github.com/michal-h21/tex4ebook/issues/50), but neither am
    I using xelatex, nor did the fix suggested in this thread fix my
    problem. Could it be I am using an old version of htlatex, or that
    it doesn't work as intended on Ubuntu 18.04? I can probably work
    around this issue, though, by extracting the error message and
    running imagemagick on the image in question.

  * The resulting html file does not have any table of contents. The tex
    file uses the `\tableofcontents`-command, which, according to the
    documentation I found, is supported by htlatex, yet nothing but the
    "Content"-heading is created for it. I found some posts on
    tex.stackexchange.com suggesting that it is because I used
    `\setcounter{tocdepth}` and/or `\usepackage{titlesec}`, but nothing
    more specific than that or how to fix it.

  * `\multicolumn`s don't appear to work, and their content appears on
    top of the tale rather than within it. This is the same issue
    documented here
    (https://comp.text.tex.narkive.com/QYwBaL9w/tex4ht-multicolumn), but
    compiling multiple times like the post suggests doesn't fix it for me.

I would be very happy if you could help me out with at least some of 
these problems, or tell me how to solve them on my own.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex4ht/attachments/20210306/ff3d3e5e/attachment.html>


More information about the tex4ht mailing list.