1

Feeding

\documentclass{article}
\pagestyle{empty}
\usepackage{amsmath}
\usepackage{mathpartir}% version 1.3.2 or 1.4.0
\begin{document}
\begin{gather*}
  \inferrule*[left=M,right=M]{premises}{conclusion}\\
  \textsc{\small M}\mskip5mu\frac{premises}{conclusion}\mskip5mu{\textsc{\small M}}
\end{gather*}
\end{document}

to pdflatex yields

output

As you see, the second inference rule is slightly shifted to the right with respect to the first one. So one of them is necessarily not centered, and my hunch is that \inferrule* of mathpartir is the culprit. Is this really so, or is gather* or \frac at fault? Any fix or a workaround? The maintainer of mathpartir has been informed.

1

1 Answer 1

1

From playing around with the code, from what I can tell, this seems to be the result of a spurious space added at the end of the starred version of \inferrule inside the macro \mpr@inferstar@.

It looks like you can patch the command with the xpatch package as follows:

\documentclass{article}
\pagestyle{empty}
\usepackage{amsmath}
\usepackage{mathpartir}% version 1.3.2 or 1.4.0
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\mpr@inferstar@}{\mpr@vdots$ }{\mpr@vdots$}{}{}
\makeatother
\begin{document}
\begin{gather*}
  \inferrule*[left=M,right=M]{premises}{conclusion}\\
  \textsc{\small M}\mskip5mu\frac{premises}{conclusion}\mskip5mu{\textsc{\small M}}
\end{gather*}
\end{document}

inferstar* after patching

4
  • It should be \xpatchcmd{\mpr@inferstar@}{\mpr@vdots$ }{\mpr@vdots$}{}{}
    – egreg
    Sep 5, 2022 at 10:47
  • Not sure why it matters, but sure, I'll switch to that.
    – frabjous
    Sep 5, 2022 at 15:34
  • I guess you hit a hidden feature of etoolbox. For some reason, your patch also removes the space token, which it shouldn’t.
    – egreg
    Sep 5, 2022 at 16:10
  • Works like a charm, thank you!
    – user224332
    Sep 5, 2022 at 20:13

You must log in to answer this question.