I would like to use the semantic package to write inference rules, and I would also like to use the proof-at-the-end package to put proofs of my theorems in the appendix. However, when I use these two packages together, it seems that I can no longer properly use the first argument of a macro. Here is an example with the \frac macro:
\documentclass{article}
\usepackage{amsthm}
\usepackage{proof-at-the-end}
\usepackage{semantic}
\newtheorem{thm}{Theorem}
\begin{document}
\begin{theoremEnd}{thm}
$2 = \frac{4}{2}$.
\end{theoremEnd}
\begin{proofEnd}
Because of the rule
\[ \inference{bc \neq 0}{\frac{a}{b} = \frac{ac}{bc}} \]
we can conclude that $2 = \frac{4}{2}$.
\end{proofEnd}
\printProofs
\end{document}
As shown in the screenshot, the equation $2 = \frac{4}{2}$ appears correct in the statement of the theorem, but in the proof, the numerator is pushed into the denominator, and the denominator is pushed to the right of the fraction, as if I had written $2 = \frac{}{4}2$ instead.
If I remove the semantic package and \inference rule, both fractions are rendered correctly. The issue also disappears if I remove the proof-at-the-end package and the \printProofs macro, and replace the theoremEnd and proofEnd environments with thm and proof respectively.
How can I use both these packages simultaneously, to appendicize proofs containing inference rules?


