![empheq amsart 枚举错误](https://linux22.com/image/409755/empheq%20amsart%20%E6%9E%9A%E4%B8%BE%E9%94%99%E8%AF%AF.png)
我已经开始使用 empheq 包,遇到了一些问题。以下内容可以正常编译:
\documentclass[fleqn]{article}
\usepackage{empheq}
\usepackage{xcolor}
\newcommand*\mybluebox[1]{\colorbox{blue!20}{\hspace{1em}#1\hspace{1em}}}
\begin{document}
\begin{enumerate}
\item We have
\begin{empheq}[box=\mybluebox]{equation}
f(x)=g(x)
\end{empheq}
\begin{empheq}[box=\mybluebox]{align}
f(x)=f(x)=g(x)
\end{empheq}
\item etc.
\end{enumerate}
\end{document}
结果:
另一方面,在 amsart 类中,align 环境和 empheq 存在故障(在 equation 环境中似乎没有出现),即用
\documentclass[fleqn]{amsart}
答案1
这不是真正的答案,但需要更多空间
更新 2020/03/18:更新修复。尽管这确实不是flalign
与环境合作
\documentclass[fleqn]{amsart}
\usepackage{empheq}
\usepackage{xcolor}
\newcommand*\mybluebox[1]{\colorbox{blue!20}{\hspace{1em}#1\hspace{1em}}}
\usepackage{xpatch}
\MHInternalSyntaxOn
\def\EQ_initialize:{%
\m@th
\MH_let:NwN\SetTagPlusEndMark\EQ_tag_plus_endmark:
\MH_let:NwN\SetOnlyEndMark\EQ_only_endmark:
\l_EQ_temp_linewidth_dim\linewidth
\@tempdima\z@
\begingroup
\ifdefined\fullwidthdisplay\relax
\fullwidthdisplay
\global\@tempdima\displaywidth
\fi
\endgroup
\ifdim\@tempdima>\linewidth\relax
\l_EQ_temp_linewidth_dim\@tempdima
\fi
\@tempdima\z@
\g_EQ_toprow_height_dim\z@
\g_EQ_bottomrow_depth_dim\z@
\g_EQ_toptag_height_dim\z@
\g_EQ_bottomtag_depth_dim\z@
\g_EQ_widesttag_dim\z@
\xdef\g_EQ_latest_nonzerodepth_row_fint{\z@}
\edef\EQ_restore_tex_delimiter:{%
\delimiterfactor\the\delimiterfactor
\delimitershortfall\the\delimitershortfall\relax}%
\g@addto@macro\EQ_complete_mathdisplay:
\EQ_restore_tex_delimiter:
\delimitershortfall\EmphEqdelimitershortfall
\delimiterfactor\EmphEqdelimiterfactor
\MH_let:NwN\intertext@\EQ_intertext:
\EQ_displaybreak:}
% trick to see what empheq is typesetting
%\def\EQ_use_mathdisplay:{%
% \EQ_outerbox:{\fbox{\usebox{\EQ_mathdisplay_box}}}}
\MHInternalSyntaxOff
\begin{document}
\begin{enumerate}
\item We have
\begin{empheq}[box=\mybluebox]{equation}
f(x)=g(x)
\end{empheq}
\begin{empheq}[box=\mybluebox]{align}
f(x)=f(x)=g(x)
\end{empheq}
\item no empheq
\begin{equation}
f(x)=g(x)
\end{equation}
\begin{align}
f(x)=f(x)=g(x)
\end{align}
\end{enumerate}
\end{document}