LaTeXML icon indicating copy to clipboard operation
LaTeXML copied to clipboard

[feature request] package environ

Open nschloe opened this issue 1 year ago • 0 comments

https://ctan.org/pkg/environ

MWE:

\documentclass{article}
\usepackage{amsmath}

\usepackage{environ}
\NewEnviron{as}{\begin{align}\begin{split}\BODY\end{split}\end{align}}

\begin{document}
\begin{as}
  a & = 1\\
  b & = 2
\end{as}
\end{document}

LaTeX output:

screenshot_2023-12-04-175942

LaTeXML output:

<document xmlns="http://dlmf.nist.gov/LaTeXML">
  <resource src="LaTeXML.css" type="text/css"/>
  <resource src="ltx-article.css" type="text/css"/>
  <para xml:id="p1">
    <ERROR class="undefined">\NewEnviron</ERROR>
    <p>as</p>
    <equationgroup class="ltx_eqn_align" xml:id="S0.EGx1">
      <equation xml:id="S0.E1">
        <tags>
          <tag>(1)</tag>
          <tag role="refnum">1</tag>
        </tags>
        <MathFork>
          <Math tex="\displaystyle\begin{split}\BODY\end{split}" text="[\BODY]" xml:id="S0.E1.m2">
            <XMath>
              <XMDual>
                <XMRef idref="S0.E1.m1.1.mf"/>
                <XMArray colsep="0pt" name="aligned">
                  <XMRow>
                    <XMCell align="right">
                      <ERROR class="undefined" xml:id="S0.E1.m1.1.mf">\BODY</ERROR>
                    </XMCell>
                  </XMRow>
                </XMArray>
              </XMDual>
            </XMath>
          </Math>
          <MathBranch>
            <td align="center" colspan="2"><Math mode="inline" tex="\displaystyle\begin{split}\BODY\end{split}" text="[\BODY]" xml:id="S0.E1.m1">
                <XMath>
                  <XMDual>
                    <XMRef idref="S0.E1.m1.1"/>
                    <XMArray colsep="0pt" name="aligned">
                      <XMRow>
                        <XMCell align="right">
                          <ERROR class="undefined" xml:id="S0.E1.m1.1">\BODY</ERROR>
                        </XMCell>
                      </XMRow>
                    </XMArray>
                  </XMDual>
                </XMath>
              </Math></td>
          </MathBranch>
        </MathFork>
      </equation>
    </equationgroup>
    <ERROR class="undefined">\NewEnviron</ERROR>
    <p>as*</p>
    <equationgroup class="ltx_eqn_align" xml:id="S0.EGx2">
      <equation xml:id="S0.Ex1">
        <MathFork>
          <Math tex="\displaystyle\begin{split}\BODY\end{split}" text="[\BODY]" xml:id="S0.Ex1.m2">
            <XMath>
              <XMDual>
                <XMRef idref="S0.Ex1.m1.1.mf"/>
                <XMArray colsep="0pt" name="aligned">
                  <XMRow>
                    <XMCell align="right">
                      <ERROR class="undefined" xml:id="S0.Ex1.m1.1.mf">\BODY</ERROR>
                    </XMCell>
                  </XMRow>
                </XMArray>
              </XMDual>
            </XMath>
          </Math>
          <MathBranch>
            <td align="center" colspan="2"><Math mode="inline" tex="\displaystyle\begin{split}\BODY\end{split}" text="[\BODY]" xml:id="S0.Ex1.m1">
                <XMath>
                  <XMDual>
                    <XMRef idref="S0.Ex1.m1.1"/>
                    <XMArray colsep="0pt" name="aligned">
                      <XMRow>
                        <XMCell align="right">
                          <ERROR class="undefined" xml:id="S0.Ex1.m1.1">\BODY</ERROR>
                        </XMCell>
                      </XMRow>
                    </XMArray>
                  </XMDual>
                </XMath>
              </Math></td>
          </MathBranch>
        </MathFork>
      </equation>
    </equationgroup>
    <ERROR class="undefined">{as}</ERROR>
    <p>a &amp; = 1<break/>b  = 2</p>
  </para>
</document>

nschloe avatar Dec 04 '23 17:12 nschloe