2

Maybe my question is easy. When I want to write

$$ \mbox{div}(F) = \sum_i (F_i)_{x_i} $$

I have to type \mbox{div}(F), which is cumbersome.

Is there a way to define a command \blabla to produce \mbox{div}(F)?

egreg
  • 1,121,712
user29999
  • 129
  • 2
    Welcome to TeX.SX! Does http://tex.stackexchange.com/questions/671/define-additional-math-operators-to-be-typeset-in-roman help? If it does, then we can close this question as duplicate; otherwise, please add to your question some more details. – egreg Nov 07 '12 at 18:36
  • 1
    @egreg: I'm pretty sure the use of $$ stems from Math.SE, as the user is register there. – Werner Nov 07 '12 at 18:43
  • If the question is about MathJax, I don't think there's much to do about it. – egreg Nov 07 '12 at 19:00
  • 1
    For a drop-in replacement of that command sequence you can simply wirte \newcommand{\blabla}{\mbox{div}(F)} and thereafter use \blabla. However, do have a look at the question pointed to by @egreg. – Andrew Swann Nov 07 '12 at 19:05

1 Answers1

5

Perhaps you want

\DeclareMathOperator{\mydiv}{div}  

in your preamble. Then you could write

\begin{equation}
\mydiv(F) = ...
\end{equation}

Please don't use the outdated $$ for displayed equations as detailed in Why is \[ ... \] preferable to $$ ... $$?.

Ethan Bolker
  • 9,333
  • 3
  • 42
  • 69