Display Notation with <symimage>

You can use the <symimage> tag to display well-formatted math notation in your questions and assignments in WebAssign. The markup used in the <symimage> tag is also used in NumberLine questions to display labels for points.

Unlike WaTeX, notation displayed with the <symimage> tag is displayed as a static image in your questions and does not offer the flexibility to include answer boxes in your math notation.

To use symimage markup in your questions or assignments, add the following code:

<symimage(markup)>

where markup is any symimage markup described in <symimage> Notation.

Note  
  • When creating a flag for a NumberLine question, do not include the <symimage> tag itself; just specify the markup.
  • As in HTML, successive whitespace characters in symimage markup are ignored. To add a space explicitly, precede the space with two backslash characters (\\ ).

Alphabetic characters that are not part of a function name or Perl variable are presumed to be variables and are italicized.

Controlling the Size of the Displayed Notation

Unlike WaTeX, which is automatically resized with the text in the browser window, images generated with the <symimage> tag are static. However, you can scale the initial image to one of seven sizes.

Note You cannot change the size of notation displayed in NumberLine questions.

To change the size of the displayed notation, append the following notation in your <symimage> tag:

, size => n 

where n is an integer from 1 through 7, with 3 being the default if you do not specify a size. For example:

<symimage(sqrt(x/a), size => 6)>

The following image shows how each size value is displayed.

seven different sizes of type, with each size being larger than the previous size

Controlling the Placement of the Displayed Notation

You can control the vertical alignment and spacing of the displayed notation relative to the surrounding text.

Note You cannot change the placement of notation displayed in NumberLine questions.

To align the displayed notation relative to the surrounding text, append one of the following notations in your <symimage> tag:

, align => top
, align => middle
, align => bottom

The top, middle, or bottom of the image is aligned with respect to the top, middle, or bottom of the text line where the image is displayed. The default alignment is bottom.

To add extra space around the displayed notation, append the following notation in your <symimage> tag:

, padding => n 

where n is a positive integer representing the number of pixels of whitespace to add on every side of the displayed notation. This is particularly useful when the <symimage> tag is used in multiple choice answers.

For example:

<symimage((3x+12)/(x^2), align => top, padding => 10)>

aligns the top of the displayed fraction with the top of the line of text and adds 10 pixels of space on every side of the displayed image.

<symimage> Notation

Expression

Code

Example

Display

Perl variables

$variable

Leave a space after the variable name.

Note Perl variables are not displayed in red with <symimage>.
$a x
7x

Roman text

text(text_string)
2x+1 text( if ) x <= -1
2x + 1 if x ≤ −1

Addition

+
x + 1
x + 1

Subtraction

-
x - 1
x − 1

Multiplication

*
cross
(implicit)
2 * x
2 cross x
2x

2 · x
2 × x
2x

Division

\/

You cannot display the division sign (÷) using <symimage>

x\/y
x/y

Fractions

/

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

x/y

x y

Exponents (superscripts)

^ (caret)
**

If the superscript is not just a number or a variable, enclose it in parentheses ().

Precede the superscript with a space if it precedes notation.

x^2
x**(2y)
 ^1text(H)^alpha

x2
x2y

Bases (subscripts)

_ (underscore)

If the subscript is not just a number or a variable, enclose it in parentheses ().

Precede the subscript with a space if it precedes notation.

x_2
x_(y + 3)

x2
x2y + 3

Binomial (over/under notation)

(top__bottom)^()

Type two underscores between the top and bottom expressions.

(7__3)^()

7 3

Permutations and isotopes (combined subscript and superscript)

_bottom^top

Precede the subscript with a space if the combined subscript/superscript precedes notation.

P_3^10 = 720
 _91^233text(Pa)

P 3 10 = 720

Pa 91 233

Parentheses

(arg)^()

Use this notation to explicitly add automatically-sized parentheses around an expression when they might otherwise be omitted.

(x/2)^()
x 2

Brackets

[arg]
matrix(1,1,[arg])

When using the matrix notation, the brackets are automatically sized to fit the contents. Some contents, such as fractions, are also resized.

[x]
matrix(1,1,[x/3])
[ x ]
x 3

Braces

matrix(1,1,{arg})

You cannot use {} without the matrix notation. When using the matrix notation, the brackets are automatically sized to fit the contents. Some contents, such as fractions, are also resized.

matrix(1,1,{x/3})
x 3

Angle brackets

langle arg rangle

Angle brackets are not resized.

langle x/3 rangle
x 3

Absolute values (vertical bars)

|arg|
abs(arg)

When using the abs notation, the vertical bars are automatically sized to fit the contents.

|x|
abs(x/3)
|x|
x 3

Overbrace

arg^^\\}

After the argument, add 2 carets, 2 backslashes, and the right brace. Enclose the argument in parentheses if needed.

(x+y+z)^^\\}
x + y + z

Underbrace

arg__\\_}

After the argument, add 2 underscores, 2 backslashes, another underscore, and the right brace. Enclose the argument in parentheses if needed.

(x+y+z)__\\_}
x + y + z

Square root

sqrt(arg)
sqrt(16)
16

Nth root

rootn(arg)

You can use only alphanumeric characters (a-z, A-Z, 0-9) and underscores for n.

root3(27x)
27 x 3

Factorial

!
5!
5!

Trigonometry

sin(x)     cos(x)     tan(x)
asin(x)    acos(x)    atan(x)
sinh(x)    cosh(x)    tanh(x)
asinh(x)   acosh(x)   atanh(x)
sec(x)     csc(x)     cot(x)
asec(x)    acsc(x)    acot(x)
sech(x)    csch(x)    coth(x)
asech(x)   acsch(x)   acoth(x)
asin(x)
cos(theta)
csch(a)
tan(45 deg)

asin(x)
cos(θ)
csch(a)
tan(45°)

Exponential function

e^n
exp(n)
e^2
exp(2)

e2
exp(2)

Logarithms

ln(n)
log(n)
log_b(n)

You can use only alphanumeric characters (a-z, A-Z, 0-9) and underscores for b.

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

ln(ex) = x
log(1000) = 3
log2(128) = 7

Equality

=
a = 2 pi r
a = 2πr

Inequality

>
<
>=
<=
!=
x > 3
x < 3
x >= 3
x <= 3
x != 3

x > 3
x < 3
x ≥ 3
x ≤ 3
x ≠ 3

Approximate

~=
!~=
x ~= 3
x !~= 3

x ≈ 3
x ≉ 3

Plus or minus

+/-
x +/- 3
x ± 3

Infinity

infinity
infinity

Greek

Type the name of lowercase Greek letters in lowercase. Type the names of uppercase Greek letters in proper case.

pi
Omega

π
Ω

Matrices

matrix(rows,cols,[cell,cell])
matrix(rows,cols,{cell,cell})
matrix(rows,cols,|cell,cell|)

The contents of the matrix are specified cell by cell in row-column order.

Use brackets, braces, or vertical bars to enclose the matrix contents.

matrix(2,3,[a,b,c,d,e,f])
matrix(3,2,{a,b,c,d,e,f})
a b c d e f
a b c d e f

Determinants

Use either the text or matrix notation illustrated in the example.

text(det)(A) = |A|
matrix(2,2,|a,b,c,d|)=ad-bc
det(A) = |A|
a b c d = a d - b c

Ellipses

...
_...
\...
...
_...
\...
ellipses across, down, and down and right

Indefinite summation

sum arg 
sum x_i
x i

Definite summation

sum_lower^upper arg 
sum__lower^^upper arg 

You can use two underscores and two carets to display the bounds using the same font size as the argument; see the example for Display Notation with <symimage>.

sum_(i = 0)^n x_i
i = 0 n x i

Indefinite integrals

int arg 
int f(x)dx
f x x

Definite integrals

int_lower^upper arg 
int__lower^^upper arg 

You can use two underscores and two carets to display the bounds above and below the integral using the same font size as the argument.

int_0^1 sqrt(x)dx
int__0^^1 sqrt(x)dx
0 1 x x
0 1 x x

Products

prod_lower^upper arg 
prod__lower^^upper arg 

You can use two underscores and two carets to display the bounds using the same font size as the argument; see the example for Display Notation with <symimage>.

prod_(i=m)^infinity x_i
i = m x i

Closed integrals

cintegral_lower^upper arg 
cintegral__lower^^upper arg 

You can use two underscores and two carets to display the bounds above and below the integral using the same font size as the argument; see the example for Display Notation with <symimage>.

cintegral_C y^3 \\ dx + x^2 
\\ dy
C y 3 x + x 2 y

Differentiation

diff
(difff(x))/(diffx)
f x x

Partial derivatives

partial
(partial^2u)/(partialx^2)
2 u x 2

Limits

lim_(x->p)
lim__(x->p)

Any expression can be used below the limit function.

You can use two underscores to display the expression below the limit function using the same font size as the argument; see the example for Display Notation with <symimage>.

lim_(x->0)
lim x 0

Arrows

->
-->
<-
<--
<->
==>
<==
<=>
->
-->
<-
<--
<->
==>
<==
<=>








Arrows over notation

^^->
^^-->
^^<-
^^<--
^^<->

Enclose the argument in parentheses as needed.

A^^->
A^^-->
A^^<-
A^^<--
A^^<->
A with a short rightward arrow over it. A with a long rightward arrow over it. A with a short leftward arrow over it. A with a long leftward arrow over it. A with a left-right arrow over it.

Arrows under notation

__->
__-->
__<-
__<--
__<->

Use two underscores. Enclose the argument in parentheses as needed.

A__->
A__-->
A__<-
A__<--
A__<->
A with a short rightward arrow under it. A with a long rightward arrow under it. A with a short leftward arrow under it. A with a long leftward arrow under it. A with a left-right arrow under it.

Harpoons

~>
<~
<~>
~>
<~
<~>



Harpoons over notation

^^~>
^^<~
^^<~>

Enclose the argument in parentheses as needed.

A^^~>
A^^<~
A^^<~>
A with a right harpoon over it. A with a left harpoon over it. A with a right-left harpoon over it.

Harpoons under notation

__~>
__<~
__<~>

Use two underscores. Enclose the argument in parentheses as needed.

A__~>
A__<~
A__<~>
A with a right harpoon under it. A with a left harpoon under it. A with a right-left harpoon under it.

Middle dot

middot
x middot y
x · y

Bold Roman

<b>text</b>

Text is displayed in bold and un-italicized. Do not use inside text() notation.

text(For all ) x text( in ) 
<b>R</b>,
For all x in R,

Underline

<u>text</u>

To display un-italicized text with underlining, put text() inside of <u> and not the other way around.

<u>all </u>\\ x
<u>text(all)</u>\\ x

all x
all x

Union

union
A union B
A ∪ B

Intersection

intersect
A intersect B
A ∩ B

Proportional To

propto
proportional
x propto y
xy

Perpendicular To

perp
perpendicular
x perp y
xy

Hat

^^\\^
x^^\\^

Vector

^^->
^^\\->
x^^->
x with arrow

Accent

^^\\'
x^^\\'
x with an acute accent

Tilde

^^\\~
x^^\\~
x with a tilde

Grave

^^\\`
x^^\\`
x with a grave accent

Script small L

ell
ell

Reduced Planck constant (h-bar)

hbar
E=hbar omega
E = ℏω

Overline

^^\\_
x^^\\_
x

Formula

{(statement,statement)

Use as many statements as needed.

Each statement must contain the same number of text() codes. These codes are used to control horizontal alignment of the statements with each other. You can put empty text() codes in each statement to align items even if you do not need to display Roman text.

f(x)={(|2x| text(if)\\ x <= 0,3x text(if)\\ x 
>0)
f x = 2 x if x 0 3 x if x > 0