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, 2018 at 7:58

1 Answer 1


With \mathop, you can define:


or using \DeclareMathOperator (amsmath):


You must log in to answer this question.

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