make4ht beschwert sich über „Modul ‚luaxml-domobject‘ nicht gefunden“

make4ht beschwert sich über „Modul ‚luaxml-domobject‘ nicht gefunden“

Ich habe die Installation make4htmit dem Befehl durchgeführt tlmgr install make4ht.

Wenn ich jetzt den Befehl eingebe make4ht foo.tex, erhalte ich diese Fehlermeldung:

[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: foo.tex
...texmf-dist/scripts/make4ht/filters/make4ht-domfilter.lua:2: module 'luaxml-domobject' not found:
        no field package.preload['luaxml-domobject']
        [kpse lua searcher] file not found: 'luaxml-domobject'
        [kpse C searcher] file not found: 'luaxml-domobject'

Was muss ich sonst noch installieren, bevor ich es make4hterfolgreich verwenden kann?

Antwort1

Unter Ubuntu (20.04) habe ich make4htdie Installation über das aptStandardpaket durchgeführt texlive-extra-utils.

Und ich habe einen ähnlichen Fehler:

...texmf-dist/scripts/make4ht/filters/make4ht-domfilter.lua:2: module 'luaxml-domobject' not found:
        no field package.preload['luaxml-domobject']
        [kpse lua searcher] file not found: 'luaxml-domobject'
        [kpse C searcher] file not found: 'luaxml-domobject'

Um den Fehler zu beheben, habe ich einfach das Paket installiert texlive-luatex:

sudo apt install texlive-luatex

(Es scheint, dass eine Abhängigkeit für das Paket fehlt texlive-extra-utils)

Antwort2

Lassen Sie mich antworten, wie ich dieses Problem gelöst habe. Der Kommentar von @michal.h21 hat geholfen.

Beachten Sie, dass die Punkte 2 bis 6 Fehlstarts oder Versuche zeigen, die nicht zu guten Ergebnissen geführt haben. Nur der letzte Punkt, also Punkt 7, führte zu guten Ergebnissen.

  1. Erstellen Sie eine Datei foo.tex, mit der ich testen werde, ob sie make4hterfolgreich funktioniert:

    \documentclass{article}
    \usepackage{amsmath}
    \title{Demo}
    \begin{document}
    
    \begin{align}
    1 + 0 & = 1, \label{eq1} \\
    1 + 1 & = 2, \label{eq2} \\
    e^{i \pi} = -1. \label{eq3}
    \end{align}
    
    Equation \( \eqref{eq1} \), \( \eqref{eq2} \) and \( \eqref{eq3} \)
    describe eternal truths.
    
    The equation \( e^{i \pi} = -1 \) can also be rewritten as \( e^{i \pi}
    + 1 = 0 \) which is known as Euler's identity.
    \end{document}
    
  2. Installieren make4htund kompilieren Sie foo.texwie foo.htmlfolgt:

    sudo tlmgr install make4ht
    make4ht foo
    

    Dies führte zu folgendem Fehler:

    [STATUS]  make4ht: Conversion started
    [STATUS]  make4ht: Input file: foo
    ...texmf-dist/scripts/make4ht/filters/make4ht-domfilter.lua:2: module 'luaxml-domobject' not found:
            no field package.preload['luaxml-domobject']
            [kpse lua searcher] file not found: 'luaxml-domobject'
            [kpse C searcher] file not found: 'luaxml-domobject'
    
  3. Installieren make4htund luaxmlerneut versuchen:

    sudo tlmgr install make4ht luaxml
    make4ht foo
    

    Dies führte zu folgendem Fehler:

    [STATUS]  make4ht: Conversion started
    [STATUS]  make4ht: Input file: foo
    [ERROR]   htlatex: Compilation errors in the htlatex run
    [ERROR]   htlatex: Filename     Line    Message
    [ERROR]   htlatex: ?    ?        LaTeX Error: File `tex4ht.sty' not found.
    [ERROR]   htlatex: ?    2        Emergency stop.
    [FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1
    
  4. Installieren Sie make4ht, luaxml, und tex4ht, und versuchen Sie es erneut:

    sudo tlmgr install make4ht luaxml tex4ht
    make4ht foo
    

    Diesmal ist die Konvertierung gelungen:

    [STATUS]  make4ht: Conversion started
    [STATUS]  make4ht: Input file: foo
    sh: dvipng: command not found
    sh: dvipng: command not found
    sh: dvipng: command not found
    sh: dvipng: command not found
    sh: dvipng: command not found
    [STATUS]  make4ht: Conversion finished
    

    So foo.htmlsah die Ausgabe aus:

    <!DOCTYPE html> 
    <html lang='en-US' xml:lang='en-US'> 
    <head><title></title> 
    <meta charset='utf-8' /> 
    <meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' /> 
    <meta content='width=device-width,initial-scale=1' name='viewport' /> 
    <link href='foo.css' type='text/css' rel='stylesheet' /> 
    <meta content='foo.tex' name='src' /> 
    </head><body>
    <!-- l. 6 --><p class='noindent'>
    </p><table class='align'>
                               <tr><td class='align-odd'>1 + 0</td>                               <td class='align-even'> = 1<span class='cmmi-10'>,</span></td>                                                      <td class='align-label'><a id='x1-2r1'></a>(1)
                               </td></tr><tr><td class='align-odd'>1 + 1</td>                               <td class='align-even'> = 2<span class='cmmi-10'>,</span></td>                                                      <td class='align-label'><a id='x1-3r2'></a>(2)
                               </td></tr><tr><td class='align-odd'><span class='cmmi-10'>e</span><sup><span class='cmmi-7'>iπ</span></sup> = <span class='cmsy-10'>−</span>1<span class='cmmi-10'>.</span></td>                           <td class='align-even'></td>                               <td class='align-label'><a id='x1-4r3'></a>(3)                                                      </td></tr></table>
    <!-- l. 12 --><p class='noindent'>Equation <img alt='(1)  ' src='foo0x.png' class='math' />, <img alt='(2)  ' src='foo1x.png' class='math' /> and <img alt='(3)  ' src='foo2x.png' class='math' /> describe eternal truths.
    </p><!-- l. 15 --><p class='indent'>   The equation <img alt='eiπ = − 1  ' src='foo3x.png' class='math' /> can also be rewritten as <img alt='eiπ + 1 = 0  ' src='foo4x.png' class='math' /> which is known
    as Euler’s identity. </p> 
    </body> 
    </html>
    

    Die mit HTML und Bildern gerenderten Mathematikwerte sehen nicht besonders gut aus.

  5. Rendern Sie Mathematik mit MathJax:

    make4ht foo mathjax
    

    Die Konvertierung schlägt fehl:

    [STATUS]  make4ht: Conversion started
    [STATUS]  make4ht: Input file: foo
    [ERROR]   htlatex: Compilation errors in the htlatex run
    [ERROR]   htlatex: Filename     Line    Message
    [ERROR]   htlatex: ?    ?        LaTeX Error: File `environ.sty' not found.
    [ERROR]   htlatex: ?    22       Emergency stop.
    [FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1
    
  6. Installieren Sie make4ht, luaxml, tex4ht, und environund versuchen Sie es erneut:

    sudo tlmgr install make4ht luaxml tex4ht environ
    make4ht foo mathjax
    

    Es schlägt wieder fehl:

    [STATUS]  make4ht: Conversion started
    [STATUS]  make4ht: Input file: foo
    [ERROR]   htlatex: Compilation errors in the htlatex run
    [ERROR]   htlatex: Filename     Line    Message
    [ERROR]   htlatex: ?    ?        LaTeX Error: File `trimspaces.sty' not found.
    [ERROR]   htlatex: ?    17       Emergency stop.
    [FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1
    
  7. Installieren Sie make4ht, luaxml, tex4ht, environ, und trimspacesund versuchen Sie es erneut:

    sudo tlmgr install make4ht luaxml tex4ht environ trimspaces
    make4ht foo mathjax
    

    Die Konvertierung ist erfolgreich:

    [STATUS]  make4ht: Conversion started
    [STATUS]  make4ht: Input file: foo
    [STATUS]  make4ht: Conversion finished
    

    Hier ist die Ausgabe foo.html:

    <!DOCTYPE html> 
    <html xml:lang='en-US' lang='en-US'> 
    <head><title></title> 
    <meta charset='utf-8' /> 
    <meta name='generator' content='TeX4ht (https://tug.org/tex4ht/)' /> 
    <meta name='viewport' content='width=device-width,initial-scale=1' /> 
    <link href='foo.css' type='text/css' rel='stylesheet' /> 
    <meta name='src' content='foo.tex' /> 
    <script>window.MathJax = { tex: { tags: "ams", inlineMath: [ ["\\\(","\\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true, processEnvironments: true, packages: ['base', 'color', 'ams'] }, loader: { load: ['[tex]/color', '[tex]/ams'] } }; </script> 
     <script id='MathJax-script' type='text/javascript' async='async' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js'></script>  
    </head><body>
    <!-- l. 10 --><p class='noindent'>\begin{align} 1 + 0 &amp; = 1, \label{eq1} \\ 1 + 1 &amp; = 2, \label{eq2} \\ e^{i \pi } = -1. \label{eq3} \end{align}
    </p><!-- l. 12 --><p class='noindent'>Equation \( \eqref{eq1} \), \( \eqref{eq2} \) and \( \eqref{eq3} \) describe eternal truths.
    </p><!-- l. 15 --><p class='indent'>   The equation \( e^{i \pi } = -1 \) can also be rewritten as \( e^{i \pi } + 1 = 0 \) which is known as Euler’s identity.
    </p> 
    </body> 
    </html>
    

    Hier ist ein Beispiel für JSFiddle, das die Ausgabe zeigt:https://jsfiddle.net/9xubrm47/.

verwandte Informationen