(updated to incorporate the comments by @egreg, barbara beaton, and @DCh)
I assume your document uses a roman (serif) font rather than a sans-serif font for mathematics. To ensure that constants are typeset consistently using upright Roman letters, it's handy to create a dedicated macro named, say, \ct
that uses the following macros in a nested fashion: \text
(from the amsmath
package), \rmfamily
(just in case the surrounding material is non-roman), and \upshape
.
\newcommand\ct[1]{\text{\rmfamily\upshape #1}}
Then, use this macro to typeset an equation such as
$\ct{e}^{\ct{i}\pi}-1=0$
Suppose, furthermore, that your documents contains two frequently-occurring constants named ab-cd
and fi-fi
. (You did say that the names of the constants might contain ligatures...) To help speed up typing, you could define two macros \abcd
and \fifi
as follows:
\newcommand*{\abcd}{\ct{ab-cd}}
\newcommand*{\fifi}{\ct{fi-fi}}
The result of a full MWE:

\DeclareSymbolFont{AMSb}{U}{msb}{m}{n}
\documentclass[noamsfonts]{amsart} \usepackage[bitstream-charter]{mathdesign}
%% use the \ct macro to define math constants
\newcommand\ct[1]{\text{\rmfamily\upshape #1}}
%% define two math constants with rather contrived names...
\newcommand{\abcd}{\ct{ab-cd}}
\newcommand{\fifi}{\ct{fi-fi}}
\begin{document}
\sffamily % switch to sans-serif for main text font
$\ct{e}^{\ct{i}\piup}-1=0$,
$(\abcd)^2-\ct{e}^{(\fifi^3)}=0$
not in math mode: ab-cd, fi-fi
\end{document}
\mathrm{...}
.siunitx
package.\[ x\ \mathrm{iff}\ y\ \textup{iff}\ z_{\textup{iff}}^{\mathrm{iff}} \]
.\mathrm
is also what's documented in lamport's latex manual. (it can be used only in math mode, but it behaves the same as text roman; there's a reason for using\math...
commands instead of\text...
commands in math mode.\text...
commands should be used in math only within\text{...}
according to all the documentation i've read.)\DeclareSymbolFont{AMSb}{U}{msb}{m}{n} % fix [noamsfonts] bug \documentclass[noamsfonts]{amsart} \usepackage[bitstream-charter]{mathdesign} \begin{document} \[ x\ \mathrm{fin}\ y\ \textup{fin} \] \end{document}