I'm using the latest texlive to compile tex file into HTML:
$ apt show texlive
Package: texlive
Version: 2021.20220204-1
Priority: optional
Section: universe/tex
Source: texlive-base
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian TeX Task Force <debian-tex-maint@lists.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 73.7 kB
Depends: texlive-fonts-recommended (>= 2021.20210921), texlive-latex-base (>= 2021.20210921), texlive-latex-recommended (>= 2021.20210921)
Homepage: http://www.tug.org/texlive/
Download-Size: 14.3 kB
APT-Sources: http://apt.pop-os.org/ubuntu jammy/universe amd64 Packages
When I invoke htlatex tool to do this, I found 2 problems:
- htlatex should compiles into hypertext, and use tex4ht as the backend compiler. But when I execute it:
$ htlatex -synctex=1 -file-line-error -interaction=nonstopmode -output-directory=/home/peng/git-slide/oricep_support_and_actuation/out /home/peng/git-slide/oricep_support_and_actuation/doc/tex/Main.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(/home/peng/git-slide/oricep_support_and_actuation/doc/tex/Main.tex
...
Output written on Main.dvi (6 pages, 21096 bytes).
This behaviour seems to be deliberately broken, as pdfTex should be the backend of pdflatex, and is only intended to generate pdf and dvi, it is completely irrelevant to hypertext.
- The "-output-directory" part appears to be ignored, as even the generated dvi file is dropped into the same directory as the text file
Is the tool htlatex always broken like this? What are the possible successors?
htlatexis a shell script that runslatex(which these days is pdftex running in dvi/latex mode) and then runs tex4ht/t4ht afterwards. Moreover,htlatexdoes not take the same arguments aspdf/latex. The argument-synctex=1makes no sense in this context, and the others are at best misplaced; see here. The closest thing to a successor is probably make4ht. – frabjous Sep 06 '22 at 00:33