The commands
$\mathcal{\mbox{$M$}}$
and
\mbox{$\mathcal{M}$}
produce different output. I would like a replacement for \mbox
that creates a box preserving all features of the current font in math mode. How can I do this?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityThe commands
$\mathcal{\mbox{$M$}}$
and
\mbox{$\mathcal{M}$}
produce different output. I would like a replacement for \mbox
that creates a box preserving all features of the current font in math mode. How can I do this?
Please always post complete documents:
\documentclass{article}
\usepackage{amsfonts}
\begin{document}
$\mathcal{\count0=\fam\mbox{$\fam=\count0 M$}}$
\end{document}
\mathcal{M}
– David Carlisle
Nov 9 '14 at 20:35
You can use the similar commands \mathmbox
or \mathmakebox
provided by the mathtools
package.
\mathcal{M}
as result, but \mathcal{\mathmbox{M}}
gives the other M.
– Heiko Oberdiek
Jul 4 '15 at 5:38