# WaTeX Notation

The code listed in this table is valid in the <watex> tag. Unless specified otherwise, all of the examples in the following table are shown as they are displayed when using math mode.

Note As in HTML, successive whitespace characters in WaTeX are ignored. To add multiple spaces, you can use <s:space>.

Expression

Code

Example

Display

Perl variables

$variable ${variable}
<EQN $variable> Use braces when the Perl variable is followed by other text. Use <EQN> to display the variable in black. $a
${a}x <EQN$a>

35

35x

35

Roman text, WebAssign tags, or HTML

\pre{text}

Not needed unless using math mode.

Not needed for answer placeholder string <_>.

2x\pre{ km}

2x km

<_>

This cannot be done with <symimage> or LaTeX.

\frac{6}{8} = \frac{<_>}{4}

Line breaks

\\

Use \\ instead of <br \>.

Consecutive line breaks are treated as a single line break. To add more vertical spacing, use \vspace.

3x \\ 4y

3x

4y

Line breaks with vertical spacing

\vspace{nem}
\vspace{npx}

Adds a line break with the specified amount of space between the lines.

Do not add a space between the number and the unit.

For on-screen display, ems and pixels are preferred units, but you can also use cm, in, mm, pc, or pt.

3x \vspace{1em} 4y

3x

4y

+
x + 1

x + 1

Subtraction

-
x - 1

x − 1

Multiplication

*
\times
(implicit)
x * 2
x \times 2
2x

x · 2

x × 2

2x

Division

\div
x \div 2

x ÷ 2

Fractions

\frac{num}{den}

You can put a fraction in the numerator or denominator of another fraction.

\frac{x}{4} Binomial

\left(\over{n}{k}\right)
\left(\over{a}{b}\right)

Combinations, permutations, and isotopes (over/under notation)

\over{top}{bottom}

This is sometimes used with <s:space> in the top or bottom to help vertical alignment.

\left(\over{52}{5}\right) =
2598960
P\over{10}{3} = 720
\over{233}{91}\pre{Pa}

Exponents (superscripts)

^ (caret)

If the superscript is more than 1 character, enclose it in braces {}.

x^2
x^{12}

x2

x12

Bases (subscripts)

_ (underscore)

If the subscript is more than 1 character, enclose it in braces {}.

x_2
x_{(y + 3)}

x2

x(y + 3)

Parentheses

(arg)
\left[size](
\right[size])

Specify the optional size as an integer from 1 through 9.

(x)
\left( \frac{x}{3}
\right)

(x)

Brackets

[arg]
\left[size][
\right[size]]

Specify the optional size as an integer from 1 through 9.

[x]
\left[ \frac{x}{3}
\right]

[x]

Braces

{arg}
\left[size]\{
\right[size]\}

Specify the optional size as an integer from 1 through 9.

{x}
\left\{ \frac{x}{3}
\right\}

{x}

Angle brackets

\left[size]<
\right[size]>

Specify the optional size as an integer from 0 through 9.

\left<x\right>
\left< \frac{x}{3}
\right>

Absolute values (vertical bars)

|arg|
\left[size]|
\right[size]|

Specify the optional size as an integer from 1 through 9.

|x|
\left| \frac{x}{3}
\right|

|x|

Magnitude (double vertical bars)

\lleft[size]|
\rright[size]|

Specify the optional size as an integer from 0 through 9.

\lleft|\overrightarrow{v
}\rright|

Greatest integer function (double brackets)

\lleft[size][
\rright[size]]

Specify the optional size as an integer from 1 through 9.

\lleft[x\rright]

Square root

\sqrt{arg}
\sqrt{size}{arg}

Specify the optional size in positive integers; the height is approximately size lines.

\sqrt{16}
\sqrt{3}{\frac{1}{2}}

Nth root

\sqrt[n]{arg}
\sqrt{size}[n]{arg}

Specify the optional size in positive integers; the height is approximately size lines.

\sqrt{27x}
\sqrt{3}{\frac{x}{81}}

Factorial

!
5!

5!

Trigonometry

\sin      \cos      \tan
\arcsin   \arccos   \arctan
\isin     \icos     \itan
\sinh     \cosh     \tanh
\arcsinh  \arccosh  \arctanh
\isinh    \icosh    \itanh
\sec      \csc      \cot
\arcsec   \arccsc   \arccot
\isec     \icsc     \icot
\sech     \csch     \coth
\arcsech  \arccsch  \arccoth
\isech    \icsch    \icoth

\arccos, \arcsin, and so on can be abbreviated like \acos or \asin, but the longer version of the function name is displayed.

\asin x
\cos <s:theta>
\csch a
\tan(45<s:degree>)
\icoth(x)

arcsin x

cos θ

csch a

tan(45°)

coth-1(x)

Exponential function

e^n

e^2

e2

Logarithms

\ln(n)
\log(n)
\log_b(n)
\ln(e^x) = x
\log(1000) = 3
\log_2(128) = 7

ln(ex) = x

log(1000) = 3

log2(128) = 7

Equality

=
a = 2<s:pi>r

a = 2πr

Inequality

>
<
\geq
\leq
\neq
<s:notgreater>
<s:notless>
x > 3
x < 3
x \geq 3
x \leq 3
x \neq 3
x <s:notgreater> 3
x <s:notless> 3

x > 3

x < 3

x ≥ 3

x ≤ 3

x ≠ 3

x 3

x 3

Approximate

\approx
x \approx 3

x ≈ 3

Plus or minus

\pm
x \pm 3

x ± 3

Minus or plus

\mp
x \mp 3

x 3

Infinity

\infty
\infty

Greek

<s:letter_name>
<s:pi>

π

Capital Greek

<s:Letter_name>
<s:Omega>

Ω

Arrays

\begin{array}{alignment}
cell & cell \\
cell & cell
\end{array}

\begin{array}{rl}
y = & <s:space>3x + 10 \\
2y = & <s:space>4x - 5
\end{array}

Matrices

\begin{matrix}{alignment}
cell & cell \\
cell & cell
\end{matrix}

A = \begin{matrix}{c}{2}
x & y & z\\
a & b & c
\end{matrix}

Determinants

\pre{det}(A) = |A|
\left|\begin{array}{c}
a & b \\ c & d
\end{array}\right| = ad -
bc

det(A) = |A| Ellipses

\ddots
\cdots
\vdots
\iddots
\ldots
\ddots
\cdots
\vdots
\iddots
\ldots

Overline

\overline{}
0.\overline{3}

0.3

Indefinite summation

\sum{arg}
\sum{x_i}

Definite summation

\sum_{lower}^{upper}{arg}
\sum_{i = 0}^{n}{x_i}

Indefinite integrals

\int{arg}
\int{f(x)dx}

Definite integrals

\int_{lower}^{upper}{arg}
\int_{0}^{1}{\sqrt{x}dx}

Limits

\lim_{lower}{arg}
\lim{}_{lower}
\lim_{n\rightarrow\infty}{x
_n}
\lim{}_{n\rightarrow\infty}
x_n

Right arrows

\rightarrow
\Longrightarrow
\rightarrow
\Longrightarrow Arrows over notation

\overleftarrow{arg}
\overrightarrow{arg}
\overleftrightarrow{arg}
\overleftarrow{AB}
\overrightarrow{AB}
\overleftrightarrow{AB}

Harpoons over notation

\overleftharpoon{arg}
\overrightharpoon{arg}
\overleftrightharpoon{arg}
\overleftharpoon{AB}
\overrightharpoon{AB}
\overleftrightharpoon{AB}

Middle dot

\cdot
\cdot

·

Circle

\circ
\circ

Non-breaking text

\nobr{}
\nobr{1.2 \times 10^2}

1.2 × 102

Italics

\it{}

Not needed in math mode.

text \it{italicized} text

text italicized text

Boldface

\bf{}
\bf{boldface}

boldface

Strikeout

\sout{}
\sout{strikeout}

strikeout

Underline

\uline{}
\uline{underlined}

underlined