Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"\AA" in math mode breaks math-to-image-conversion with "latexmlpost --mathimages" #1012

Closed
siegfriedzoetzsche opened this issue Jul 10, 2018 · 2 comments

Comments

@siegfriedzoetzsche
Copy link

siegfriedzoetzsche commented Jul 10, 2018

If I convert the file aa.tex:

    \documentclass{article}
    \usepackage{amsmath}
    \begin{document}
    $3\,\text{\AA}$
    \end{document}

with

    latexml --destination aa.xml aa.tex
    latexmlpost --verbose --pmml --mathtex --mathimages --destination=aa-post.xml aa.xml 

I get

    [...]
    Error:shell:latex LaTeX command 'latex ltxmlimg > ltxmlimg.ltxoutput' failed
    [...]

/tmp/LaTeXML<...>/ltxmlimg.log:

    ! Undefined control sequence.
    <argument> \lx 
                   @utf@AA
    l.60 \beginINLINE 3\,\text{\lx@utf@AA}
                                          \endINLINE\clearpage

/tmp/LaTeXML<...>/ltxmlimg.tex:

    \begin{document}
    \beginINLINE 3\,\text{\lx@utf@AA}\endINLINE\clearpage
    \end{document}

I can work around the problem by using the Definition of \AA from TeX.pool.ltxml:

    DefPrimitiveI('\AA', undef, UTF(0xC5));     # LATIN CAPITAL LETTER A WITH RING ABOVE

instead of that in LaTeX.pool.ltxml:

    DefMacroI('\AA', undef, '\lx@utf@AA');

and changing aa.tex to aafix.tex:

    \documentclass{article}
    \usepackage{amsmath}
    \usepackage{aafix}
    \begin{document}
    $3\,\text{\AA}$
    \end{document}

with aafix.sty.ltxml:

    # -*- CPERL -*-
    package LaTeXML::Package::Pool;
    use strict;
    use warnings;
    use LaTeXML::Package;
    
    DefPrimitiveI('\AA', undef, UTF(0xC5));
    
    1;

and running:

latexml --destination aafix.xml aafix.tex
latexmlpost --verbose --pmml --mathtex --mathimages --destination=aafix-post.xml aafix.xml 

I guess the problem occurs for all of these defined in LaTeX.pool.ltxml:

    DefMacroI('\OE', undef, '\lx@utf@OE');
    DefMacroI('\oe', undef, '\lx@utf@oe');
    DefMacroI('\AE', undef, '\lx@utf@AE');
    DefMacroI('\ae', undef, '\lx@utf@ae');
    DefMacroI('\ae', undef, '\lx@utf@ae');
    DefMacroI('\AA', undef, '\lx@utf@AA');
    DefMacroI('\aa', undef, '\lx@utf@aa');
    DefMacroI('\O',  undef, '\lx@utf@O');
    DefMacroI('\o',  undef, '\lx@utf@o');
    DefMacroI('\L',  undef, '\lx@utf@L');
    DefMacroI('\l',  undef, '\lx@utf@l');
    DefMacroI('\ss', undef, '\lx@utf@ss');
    DefMacroI('\dh', undef, '\lx@utf@dh');    # in latex?
    DefMacroI('\DH', undef, '\lx@utf@DH');
    DefMacroI('\dj', undef, '\lx@utf@dj');
    DefMacroI('\DJ', undef, '\lx@utf@DJ');
    DefMacroI('\ng', undef, '\lx@utf@ng');
    DefMacroI('\NG', undef, '\lx@utf@NG');
    DefMacroI('\th', undef, '\lx@utf@th');
    DefMacroI('\TH', undef, '\lx@utf@TH');
@siegfriedzoetzsche siegfriedzoetzsche changed the title \AA in math mode breeaks math-to-image-conversion with latexmlpost --mathimages "\AA" in math mode breeaks math-to-image-conversion with "latexmlpost --mathimages" Jul 10, 2018
@siegfriedzoetzsche siegfriedzoetzsche changed the title "\AA" in math mode breeaks math-to-image-conversion with "latexmlpost --mathimages" "\AA" in math mode breaks math-to-image-conversion with "latexmlpost --mathimages" Jul 10, 2018
@dginev dginev added this to the LaTeXML-0.8.4 milestone Jul 10, 2018
@dginev
Copy link
Collaborator

dginev commented Jul 10, 2018

Thank you for the report! I have quickly edited the code blocks for extra readability, without changing any content.

@brucemiller
Copy link
Owner

Jeez, silly me. I added a level of redirect (since some etoolbox stuff(?) seemed to expect these to be macros), but neglected to add aliases so that revert back to the normal `\AA'. Sorry! Fixed now. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants