michal-h21 / make4ht

Build system for tex4ht
131 stars 15 forks source link

Build failed with `MathJaxMacros` #139

Closed deepimpactmir closed 7 months ago

deepimpactmir commented 7 months ago

I am using the GitHub Actions workflow that you have written out in this post. Tried using MathJax for better display of math equations but I'm running into an error when I add \Configure{MathJaxMacros}{header.tex} in the config.cfg file.

make4ht -c config.cfg -ua debug -d out ./IA_M/groups.tex "mathml,mathjax,fn-in"

An excerpt from the logs:

l.2 --- TeX4ht warning --- \Configure{MathJaxMacros}? ---

! LaTeX Error: Missing \begin{document} in `config.cfg'.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.2 \Configure{MathJaxMacros}{h
                               eader.tex}
? 
! Emergency stop.
 ...                                              

l.2 \Configure{MathJaxMacros}{h
                               eader.tex}
Output written on groups.dvi (257 pages, 88688 bytes).
Transcript written on groups.log.
[FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1
michal-h21 commented 7 months ago

If you want to use LaTeX math with MathJax, remove the mathml option from your call to make4ht. It translates LaTeX commands to MathML, so your header.tex file wouldn't have any effect.

deepimpactmir commented 7 months ago

Mm. Unfortunately, I still have the issue after removing mathml option from the call

Here's the config.cfg

\Preamble{xhtml,mathjax,fn-in}
\Configure{MathJaxMacros}{header.tex}
\Css{body{max-width:50em; margin: 2em auto;}}
\Css{body{font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;}}
\Css{ span.verb, span.cmtt-10, span.cmtt-8{font-family:monospace,monospace;font-size:1em}}
\Css{.footnotes p + p{margin-top:0.3rem;line-height:1.5;margin-left:1rem;text-indent:-1rem;}}

\Css{p.indent{text-indent:0pt;}}
\Css{p{line-height:1.4;}}
\def\TeX{TeX}
\def\LaTeX{LaTeX}
\begin{document}
\EndPreamble
michal-h21 commented 7 months ago

It is possible that the make4ht-action used too old TeX Live. I've just rebuilt it, so it should get an update with the support for \Configure{MathJaxMacros}

deepimpactmir commented 7 months ago

I think it's still on TexLive 2022. An excerpt:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2022-06-01> patch level 5
L3 programming layer <2022-07-15> (./IA_M/groups.tex

Full run here.

michal-h21 commented 7 months ago

Ah, it seems that the update created another package, I couldn't write to the original one. I had to resolve some permission issues, which hopefully should be fixed now.

deepimpactmir commented 7 months ago

Thanks! Seems like I'm getting a new error:

make4ht -c config.cfg -ua debug -d out ./IA_M/groups.tex "mathjax,fn-in"
[INFO]    mkparams: Output dir: out
[INFO]    mkparams: Compiler: latex
[INFO]    mkparams: Latex options: -jobname='groups'  
[INFO]    mkparams: tex4ht.sty: config.cfg,mathjax,fn-in,charset=utf-8
[INFO]    mkparams: tex4ht:  -cmozhtf -utf8
[INFO]    mkparams: build_file: groups.mk4
[INFO]    mkparams: Output format: html5
[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: ./IA_M/groups.tex
/usr/local/bin/make4ht:44: attempt to call a nil value (field 'make_path')
michal-h21 commented 7 months ago

Ah, that's bad! It seems like make4ht doesn't use a correct version of it's libraries, so you get this error message about missing make_path function. I will need to investigate it more. In the meantime, you can try to use the TeX Live action, which includes make4ht too.

deepimpactmir commented 7 months ago

I will try that. Thanks!

michal-h21 commented 7 months ago

BTW, I think make4ht-action now works too, at least in my tests it doesn't cause a fatal error. But the TeX Live action will be more up-to-date, so I think it is better to use that.

deepimpactmir commented 7 months ago

I see. Thanks for update! :). I'll close the issue.