Skip to content

Padding in aligned environment not correct after fourth column #968

Description

@siegfriedzoetzsche

Consider a latex file aligned.tex:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \begin{aligned}
    a & = b & c & = d & e & = f \\
  \end{aligned}
\end{equation}
\end{document}

with six columns representing three separate equations on the same line.

When running latexml (LaTeXML version 0.8.2; revision 48de2c4) with

latexml --strict --verbose --nocomments --destination=aligned-latexml.xml aligned.tex

a padding is added to the every third column ('c' and '= f' in the example):

aligned-latexml.xml:

[...]
<MathFork>
  <Math tex="\displaystyle\hskip 10.0ptc=d" text="c = d" xml:id="S0.E1X.m4">
    <XMath>
      <XMApp>
        <XMTok meaning="equals" role="RELOP">=</XMTok>
        <XMTok font="italic" lpadding="10.0pt" role="UNKNOWN">c</XMTok>
        <XMTok font="italic" role="UNKNOWN">d</XMTok>
      </XMApp>
    </XMath>
  </Math>
  <MathBranch>
    <td align="left"><Math tex="\displaystyle\hskip 10.0ptc" text="c" xml:id="S0.E1X.m5">
        <XMath>
          <XMTok font="italic" lpadding="10.0pt" role="UNKNOWN">c</XMTok>
        </XMath>
      </Math></td>
    <td align="right"><Math tex="\displaystyle=d" text="absent = d" xml:id="S0.E1X.m6">
        <XMath>
          <XMApp>
            <XMTok meaning="equals" role="RELOP">=</XMTok>
            <XMTok meaning="absent"/>
            <XMTok font="italic" role="UNKNOWN">d</XMTok>
          </XMApp>
        </XMath>
      </Math></td>
  </MathBranch>
</MathFork>
<MathFork>
  <Math tex="\displaystyle e\hskip 10.0pt=f" xml:id="S0.E1X.m7">
    <XMath>
      <XMTok font="italic" role="UNKNOWN">e</XMTok>
      <XMTok font="italic" name="quad" role="PUNCT"> </XMTok>
      <XMTok meaning="equals" role="RELOP">=</XMTok>
      <XMTok font="italic" role="UNKNOWN">f</XMTok>
    </XMath>
  </Math>
  <MathBranch>
    <td align="left"><Math tex="\displaystyle e" text="e" xml:id="S0.E1X.m8">
        <XMath>
          <XMTok font="italic" role="UNKNOWN">e</XMTok>
        </XMath>
      </Math></td>
    <td align="left"><Math tex="\displaystyle\hskip 10.0pt=f" text="absent = f" xml:id="S0.E1X.m9">
        <XMath>
          <XMApp>
            <XMTok lpadding="10.0pt" meaning="equals" role="RELOP">=</XMTok>
            <XMTok meaning="absent"/>
            <XMTok font="italic" role="UNKNOWN">f</XMTok>
          </XMApp>
        </XMath>
      </Math></td>
  </MathBranch>
</MathFork>
[...]

The expected behavior would be to add a padding to every odd column except the first.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions