I have created some macros to simplify the my typesetting of proofs and theorems within my paper.
%the proof builder, takes 1 argument, should be a sequence of \psteps, definined next
\newcommand{\prf}[1]
{
\begin{proof}
\begin{align}
#1
\end{align}
\end{proof}
}
% \pstep is designed for use inside the align block of a proof. takes 2 arguments {step::wff}{reference::label}
\newcommand{\pstep}[2]
{
& #1 & \text{[#2]}
}
%the theorem builder. takes 5 arguments
%{thm type::thm type str}{thm name::text}{reference::label}{thm statement::mathmode}{proofsteps::pstep block}
\newcommand{\theorem}[5]
{
\begin{#1}[#2]#3
\begin{equation*}
#4
\end{equation*}
\prf{#5}
\end{#1}
}
These macros work as desired. However, when I use theorem macro above, the 4th argument contains some mathmode only characters, and Overleafs syntax checker is giving a warning that the characters are not in mathmode.
\theorem{prop}{generalized modus ponens}{\label{pred:prop:gmp}}
{
\vdash_1\phi\vdash_1(\forall x\phi\implies\psi)\tfs\vdash_1\psi
}
{
\pstep{\phi}{hypothesis 1}\\
\pstep{\forall x\phi}{\ref{pred:ax:gen}}\\
\pstep{\forall x\phi\implies\psi}{hypothesis 2}\\
\pstep{\psi}{\ref{prop:ax:mp}}
}
interestingly it is not giving the same warning for mathmode characters inside \pstep arguments. Can anyone explain why this is? Is there a way to specify what kind of characters are allows in a macro argument so that the syntax checker knows that mathmode characters will work? Again, the macros work as intended, but I'd prefer to not have to look at these irrelevant error messages, especially if they are just cluttering actual errors.
\vdash_1
would be interpreted as\vdash
(a macro name),_
(math mode subscript command),1
(the subscript, if in mathmode, as in$x_1$
).