3

I know there are a few questions on this, but I've found conflicting ideas and just wanted to know what people thought was best.

By inputting the following:

\documentclass{report}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}
  \begin{equation}
  Var(x)
  \end{equation}
\end{document}

I want the Var bit to appear as normal text rather than as an italics style Var. I know I could use \mbox{} but was just wondering if there was a better way?

  • 8
    Welcome! Since Var looks like a math operator (function name), you should use \DeclareMathOperator{\Var}{Var} from amsmath to get the right spacing. Then you can use it just like \sin, etc: \Var(x). – Paul Gessler Jan 13 '15 at 16:03
  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. It's good that you want to know the 'right way' :) Since it not only declares the presentation but also the meaning, \DeclareMathOperator is indeed that 'right way'. – Sean Allred Jan 13 '15 at 16:09
4

The solution of Paul Gessler is the best here:

\DeclareMathOperator{\Var}{Var}
...
$\Var(x)$

If you really want to use text in math mode (and not a notation in roman font) you should use the \text{...} command from the amsmath package.

$V_{\text{atom}}$

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.