1

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.

1 Answer 1

1

\ifinner is what you want:

\newcommand*\mymathspace{%
    \mskip\ifinner6\else18\fi mu
}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .