About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.


9.4.4 Functional Names

Functions such as log and tan can't simply be typed in as log or tan otherwise they will come out looking like the variables l times o times g ( l o g ) or t times a times n ( t a n ). Instead you should use one of the commands listed in Table 9.5. The functions denoted with can have limits by using the subscript command _ or the superscript command ^[Sub- and superscript positioning for operators]. In addition, the modulo commands listed in Table 9.6 are also available.


Table 9.5: Function Names ( indicates command may have limits, defined by amsmath).
\arccos $ \arccos$ \arcsin $ \arcsin$ \arctan $ \arctan$
\arg $ \arg$ \cos $ \cos$ \cosh $ \cosh$
\cot $ \cot$ \coth $ \coth$ \csc $ \csc$
\deg $ \deg$ \det $ \det$ \dim $ \dim$
\exp $ \exp$ \gcd $ \gcd$ \hom $ \hom$
\inf $ \inf$ \injlim†‡ $ \injlim$ \ker $ \ker$
\lg $ \lg$ \lim $ \lim$ \liminf $ \liminf$
\limsup $ \limsup$ \ln $ \ln$ \log $ \log$
\max $ \max$ \min $ \min$ \Pr $ \Pr$
\projlim†‡ $ \projlim$ \sec $ \sec$ \sin $ \sin$
\sinh $ \sinh$ \sup $ \sup$ \tan $ \tan$
\tanh $ \tanh$ \varinjlim†‡ $ \varinjlim$ \varliminf†‡ $ \varliminf$
\varlimsup†‡ $ \varlimsup$ \varprojlim†‡ $ \varprojlim$    


Table 9.6: Modulo Commands ( defined by amsmath package)
Command Example Input Example Output
\bmod $m \bmod n$ $ m \bmod n$
\pmod{<maths>} $m \pmod{n}$ $ m \pmod{n}$
\mod{<maths>} $m \mod{n}$ $ m \mod{n}$
\pod{<maths>} $m \pod{n}$ $ m \pod{n}$
     

Example (Trigonometric Functions):

This example uses the cos and sin functions and also the Greek letter theta.

\[ z = r(\cos\theta + i\sin\theta) \]

Image: z equals r (cos theta plus i sign theta)

Example (Limit):

The command \infty is the infinity symbol image of infinity symbol , and the command \to displays an arrow pointing to the right. Note the use of _ since the limit is a subscript.

\[ \lim_{x\to\infty} f(x) \]

Image: limit as x tends to infinity of f of x

The operators with limits behave differently depending on whether they are in displayed or in-line maths. Notice the difference when the same code appears in-line:

In a line of text $\lim_{x\to\infty} f(x)$

which now displays as:

Image: the limit appears to the side of lim instead
of below it.

Example (With Subscript):

This is another example of a functional name using a subscript:

\[ \min_x f(x) \]

Image: the x appears below the word min.

Again, notice the difference when it is used in-line:

In a line of text $\min_x f(x)$

Image: the x appears to the side of the word min.


9.4.4.1 Defining New Functional Operators

It may be that you want a function that isn't specified in Table 9.5. In this case, the amsmath provides the preamble only command

\DeclareMathOperator{<cmd>}{<operator name>}

or its starred variant

\DeclareMathOperator*{<cmd>}{<operator name>}

[Defining a new log-like function in LaTeX]Both versions define a command called <cmd>, which must start with a backslash, that typesets <operator name> as a function name. The starred version is for function names that can take limits (like \lim and \min described above).

Example (Operator Without Limits):

Suppose I want a function called card, which represents the cardinality of a set $ \mathcal{S}$ . First I need to define the new operator command (which I'm going to call \card) in the preamble:

\DeclareMathOperator{\card}{card}

This operator doesn't take any limits, so I have used the unstarred version.

Later in the document, I can use this new operator command:

\[ n = \card(\mathcal{S}) \]

Image: n equals card (S)

In this example \mathcal is used as sets are typically represented in a calligraphic font.

Example (Operator With Limits):

Suppose I now want a function called mode, which represents the mode of a set of numbers. First, I define the operator command in the preamble:

\DeclareMathOperator*{\mode}{mode}

This operator needs to be able to have a subscript, so I have used the starred version.

Later in the document, I can use this new operator command:

\[ x_m = \mode_{x \in \mathcal{S}}(x) \]

Image: x subscript m equals mode of x in S of x


This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs