Skip to content

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

Closed

Description

@siegfriedzoetzsche

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');

Activity

  1. 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"[/+] on Jul 10, 2018
  2. 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"[/+] on Jul 10, 2018
  3. added this to the LaTeXML-0.8.4 milestone on Jul 10, 2018
  4. dginev commented on Jul 10, 2018

    @dginev
    Collaborator

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

  5. brucemiller commented on Jul 10, 2018

    @brucemiller
    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions