I have the following latex,

\documentclass{article} \usepackage{amsmath}

\DeclareMathOperator{\nin}{n_{\textrm{in}}} \DeclareMathOperator{\nout}{n_{\textrm{out}}}

     I want my declared math operators to look like this: \[
    n_{\textrm{in}}, n_{\textrm{out}} \] But when I use them, they look like this: \[
    \nin, \nout \]


Which produces the following output

enter image description here

Why is it that unwrapping the declared operator gives me the math font on the n, while the Operator itself does not? How do I get the operator to give me the correct n?

  • One of the effect of \DeclareMathOperator is precisely to use the "operators" Symbol Font which by default is Computer Modern upright. Are you sure you want an "operator" here. They look more like being variables, so why not \newcommand? – user4686 Apr 25 '18 at 7:58

With \mathop, you can define:


or using \DeclareMathOperator (amsmath):


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.