Eelis/cxxdraft-htmlgen

cxxdraft-htmlgen complains "tex2html" cannot be found

Closed this issue · 5 comments

When running "path/to/cxxdraft-htmlgen path/to/draft" in ubuntu 22.04, an error is given like following:
cxxdraft-htmlgen: tex2html: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
This "tex2html" is not in standard package. Ubuntu uses a package called "latex2html".

It's called tex2html upstream. If Ubuntu's renaming of things breaks things, that's on them.

I take back what I claimed. It is indeed mathjax-node-cli that is needed to be installed. Using npm install mathjax-node-cli doesn't help because "tex2html" is not called within node.js? instead it is treated as a shell command.

Also, I found in ubuntu 22.04, installing haskell is best to be done through "cabal-install" with command cabal update. Otherwise it might have version conflict if following official installation suggestion.

Here is my working procedure:

  1. sudo apt-get update
  2. sudo apt-get install git npm cabal-install graphviz
  3. installing haskell by cabal update
  4. npm install split mathjax-full mathjax-node-sre
  5. downloading mathjax-node-cli git clone https://github.com/mathjax/mathjax-node-cli/ and add "bin" path to PATH echo "export PATH=\"$PWD/mathjax-node-cli/bin:\$PATH\"" >> ~/.bashrc && source ~/.bashrc
    Now it is ready to download cxxhtmlgen and draft to compile.
mpusz commented

This is a life-saver for Ubuntu :-) I was stuck on this error for a long time. Maybe the above instructions could be added to the top-level README.md file?

It seems that what I always did was: npm install mathjax-node-cli.
An alternative is to add to PATH the directory ./node_modules/.bin, which is populated with tex2html when building the HTML documents.
mathjax-node-cli, which includes tex2html, is under "Prerequisites" in the README, although the requirement could be more clear ("for tex2html"?).

Eelis commented

I'm tempted to just provide a Dockerfile. Then the README can be simplified a lot.