Any characters put into a math environment are displayed in an italic math font. Some operators though, mostly functions, are typically written with other letter styles. To make this efficient, these characters are provided as commands, simply by putting a \ in front of the regular function name.

Here are all function commands in a nice table:

FunctionFunctionFunctionFunctionFunction
\arccos\arcsin\arctan\arg\cos
\cosh\cot\coth\csc\deg
\det_\dim\exp\gcd_\hom
\inf_\key\lg\lim_\liminf_
\limsup_\ln\log\max_\min_
\Pr_\sec_\sin\sinh\sup_
\tan\tanh

Some of these functions practically always have subscripts. For example, limits (\lim_) have one that tell us which variable is nearing what value. That’s what the underscore ( _ ) indicates in the table. You’ll see much more of it next chapter.

1$cos(x)^2 + sin(x)^2 = 1$ is wrong, instead use $\cos^2 x + \sin^2 x = 1$
2
3$lim_{x \rightarrow 2}$ is ugly, instead use $\displaystyle \lim_{x \to 2}$
Code above > output below
Code above > output below

If your favourite function isn’t listed, you can get the same result with

1\operatorname{yourOperator}{x}

If you want your custom operator to use those typical subscripts, use the star variation.

1$\operatorname*{pandaFunction}{x+y} = 2x + 2y$
Code left > output right
Code left > output right

Modulo

Modulo operators work the same, but they have two variations.

  • \bmod expression simply prints mod expression
  • \pmod expression adds space and parentheses around it
1$4 = 9 \bmod 5$ is true, but also $4 = 9 \pmod 5$
Code left > output right
Code left > output right
Continue with this course
Support me and this website!

Want to support me?

Buy one of my projects. You get something nice, I get something nice.

Donate through a popular platform using the link below.

Simply giving feedback or spreading the word is also worth a lot.