I want a length macro, named \mymathspace, which is changeable in inline math (including \text command) and display math. For example,

Text mode $inline\ math\vert\mymathspace\vert{}inline\ math$

get a space 6mu between the \verts; and

\[display\ math\vert\mymathspace\vert{}display\ math\]

get a space 18mu between the \verts; while

\[display\ math\text{Text mode $math\ in\ text\ command
\vert\mymathspace\vert$}display\ math\]

get a space 6mu between the \verts. But I can't obtain this by \if@display and \ifmmode.


\ifinner is what you want:

    \mskip\ifinner6\else18\fi mu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.