使用 lualatex 编译时,环境 \begin{multlined} 产生 LaTeX 错误:命令 \subarray 已经定义

使用 lualatex 编译时,环境 \begin{multlined} 产生 LaTeX 错误:命令 \subarray 已经定义

我有简单的 MNWE(见下文)。环境multilined产生 Latex 错误命令 \subarray 已定义。。Miktex 发行版更新后,它停止工作。

\documentclass{article}
\usepackage{mathtools}

\begin{document}
  \begin{equation*}
    \begin{multlined}
      a+b+c  \\
      \shoveleft[1cm]= d + e + f.
    \end{multlined}
  \end{equation*}
\end{document}

可以用 编译,pdflatex但不能用lualatex

\listfiles输出:

 *File List*
 article.cls    2020/04/10 v1.4m Standard LaTeX document class
  size10.clo    2020/04/10 v1.4m Standard LaTeX file (size option)
mathtools.sty    2021/03/28 v1.26 mathematical typesetting tools
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
    calc.sty    2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
 mhsetup.sty    2021/03/18 v1.4 programming setup (MH)
 amsmath.sty    2020/09/23 v2.17i AMS math features
 amstext.sty    2000/06/29 v2.01 AMS text
  amsgen.sty    1999/11/30 v2.0 generic functions
  amsbsy.sty    1999/11/29 v1.2d Bold Symbols
  amsopn.sty    2016/03/08 v2.02 operator names
l3backend-pdftex.def    2021-03-18 L3 backend support: PDF output (pdfTeX)
graphicx.sty    2020/09/09 v1.2b Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2020/08/30 v1.4c Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
  pdftex.def    2020/10/05 v1.2a Graphics/color driver for pdftex
supp-pdf.mkii
epstopdf-base.sty    2020-01-24 v2.11 Base part for package epstopdf
epstopdf-sys.cfg    2021/03/18 v2.0 Configuration of epstopdf for MiKTeX
 ***********

答案1

错误已确认。re添加lualatex分支时遗漏了。我很快就会修复它。

与此同时,这里有一个快速修复(请注意,这假设您正在运行 lualatex,因此我不会介绍这两个分支)

\MHInternalSyntaxOn

  \renewcommand\MultlinedHook{
    % from amsmath
    \renewenvironment{subarray}[1]{% <--- this needs to be renewenv
      \vcenter\bgroup
      \Let@ \restore@math@cr \default@tag
      \let\math@cr@@\AMS@math@cr@@  % <--- the fix
      \baselineskip \Umathstacknumup \scriptstyle
      \advance\baselineskip \Umathstackdenomdown \scriptstyle
      \lineskip \Umathstackvgap \scriptstyle
      \lineskiplimit \lineskip
      \ialign\bgroup\ifx c##1\hfil\fi
      \Ustartmath
      \m@th\scriptstyle####
      \Ustopmath
      \hfil\crcr
    }{%
      \crcr\egroup\egroup
    }
    % from mathtools
    \renewenvironment{crampedsubarray}[1]{% <-- same
      \vcenter\bgroup
      \Let@ \restore@math@cr \default@tag
      \let\math@cr@@\AMS@math@cr@@  % <--- the fix
      \baselineskip \Umathstacknumup \scriptstyle
      \advance\baselineskip \Umathstackdenomdown \scriptstyle
      \lineskip \Umathstackvgap \scriptstyle
      \lineskiplimit \lineskip
      \ialign\bgroup\ifx c##1\hfil\fi
      \Ustartmath
        \crampedscriptstyle{####}
      \Ustopmath
      \hfil\crcr
    }{%
      \crcr\egroup\egroup
    }
    % from mathtools
    \def\MT_smallmatrix_begin:N ##1{%
      \Let@\restore@math@cr\default@tag
      \let\math@cr@@\AMS@math@cr@@  % <--- the fix
      \baselineskip6\ex@ \lineskip1.5\ex@ \lineskiplimit\lineskip
      \csname MT_smallmatrix_##1_begin:\endcsname
    }
    % from amsmath
    \renewenvironment{smallmatrix}{\null\,\vcenter\bgroup
      \Let@\restore@math@cr\default@tag
      \let\math@cr@@\AMS@math@cr@@  % <--- the fix
      \baselineskip6\ex@ \lineskip1.5\ex@ \lineskiplimit\lineskip
      \ialign\bgroup\hfil$\m@th\scriptstyle####$\hfil&&\thickspace\hfil
      $\m@th\scriptstyle####$\hfil\crcr
    }{%
      \crcr\egroup\egroup\,%
    }
  }


\MHInternalSyntaxOff

相关内容