我有一个非常奇怪的行为,即用其扩展名替换某些东西可以消除错误。
问题如下:
\documentclass{article}
\usepackage{xparse}
\usepackage{mathpartir}% http://cristal.inria.fr/~remy/latex/
\begin{document}
\ExplSyntaxOn
\newcommand{\hide}[2]{
%\str_if_eq:nnTF { #2 } { \\ } { Y } { N } % A1
\str_if_eq:nnTF { #2 } { \\ } {} { #2 } % A2
}
\ExplSyntaxOff
\newcommand{\yeshide}[1]{
\hide#1
}
\newcommand{\nohide}[1]{
#1
}
\let\maybehide\yeshide
\begin{mathpar}
\ExplSyntaxOn
\inferrule*{
A\\
\maybehide{B}\\% B1
%\hide{B}\\% B2
C\\
D
}{\ }
\ExplSyntaxOff
\end{mathpar}
\end{document}
%A1B1: ! Extra }, or forgotten $.\\...im 0em \else \setbox 0 \hbox {\mpr@item {#1}}\relax \advance \mpr@tmpdi... }{\ }
%A1B2: Works.
%A2B1: Works but the \\ doesn't seem to be removed (so the premices of the rules aren't centered).
%A2B2: Works (and produces exactly the output I want)
我想要的代码是A2B1
,我想要的行为是A2B2
(`A1 是我在尝试[但失败]调试时添加的东西)。