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.
- 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.
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.
Controlling the Placement of the Displayed Notation
You can control the vertical alignment and spacing of the displayed notation relative to the surrounding text.
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 |
Leave a space after the variable name. Note Perl variables are not displayed in red with <symimage>.
|
|
7x |
Roman text |
|
|
2x + 1 if x ≤ −1 |
Addition |
|
|
x + 1 |
Subtraction |
|
|
x − 1 |
Multiplication |
|
|
2 · x |
Division |
You cannot display the division sign (÷) using <symimage> |
|
x/y |
Fractions |
You can put a fraction in the numerator or denominator of another fraction. |
|
|
Exponents (superscripts) |
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. |
|
x2 |
Bases (subscripts) |
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. |
|
x2 |
Binomial (over/under notation) |
Type two underscores between the top and bottom expressions. |
|
|
Permutations and isotopes (combined subscript and superscript) |
_bottom^top Precede the subscript with a space if the combined subscript/superscript precedes notation. |
|
|
Parentheses |
Use this notation to explicitly add automatically-sized parentheses around an expression when they might otherwise be omitted. |
|
|
Brackets |
When using the matrix notation, the brackets are automatically sized to fit the contents. Some contents, such as fractions, are also resized. |
|
[ x ] |
Braces |
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. |
|
|
Angle brackets |
Angle brackets are not resized. |
|
|
Absolute values (vertical bars) |
When using the abs notation, the vertical bars are automatically sized to fit the contents. |
|
|x| |
Overbrace |
After the argument, add 2 carets, 2 backslashes, and the right brace. Enclose the argument in parentheses if needed. |
|
|
Underbrace |
After the argument, add 2 underscores, 2 backslashes, another underscore, and the right brace. Enclose the argument in parentheses if needed. |
|
|
Square root |
|
|
|
Nth root |
You can use only alphanumeric characters (a-z, A-Z, 0-9) and underscores for n. |
|
|
Factorial |
|
|
5! |
Trigonometry |
|
|
asin(x) |
Exponential function |
|
|
e2 |
Logarithms |
You can use only alphanumeric characters (a-z, A-Z, 0-9) and underscores for b. |
|
ln(ex) = x |
Equality |
|
|
a = 2πr |
Inequality |
|
|
x > 3 |
Approximate |
|
|
x ≈ 3 |
Plus or minus |
|
|
x ± 3 |
Infinity |
|
|
∞ |
Greek |
Type the name of lowercase Greek letters in lowercase. Type the names of uppercase Greek letters in proper case. |
|
π |
Matrices |
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. |
|
|
Determinants |
Use either the text or matrix notation illustrated in the example. |
|
det(A) = |A| |
Ellipses |
|
|
|
Indefinite summation |
|
|
|
Definite summation |
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>. |
|
|
Indefinite integrals |
|
|
|
Definite integrals |
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. |
|
|
Products |
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>. |
|
|
Closed integrals |
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>. |
|
|
Differentiation |
|
|
|
Partial derivatives |
|
|
|
Limits |
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>. |
|
|
Arrows |
|
|
→ |
Arrows over notation |
Enclose the argument in parentheses as needed. |
|
|
Arrows under notation |
Use two underscores. Enclose the argument in parentheses as needed. |
|
|
Harpoons |
|
|
⇀ |
Harpoons over notation |
Enclose the argument in parentheses as needed. |
|
|
Harpoons under notation |
Use two underscores. Enclose the argument in parentheses as needed. |
|
|
Middle dot |
|
|
x · y |
Bold Roman |
Text is displayed in bold and un-italicized. Do not use inside
|
|
For all x in R, |
Underline |
To display un-italicized text with underlining, put
|
|
all x |
Union |
|
|
A ∪ B |
Intersection |
|
|
A ∩ B |
Proportional To |
|
|
x ∝ y |
Perpendicular To |
|
|
x ⟂ y |
Hat |
|
|
x̂ |
Vector |
|
|
|
Accent |
|
|
|
Tilde |
|
|
|
Grave |
|
|
|
Script small L |
|
|
ℓ |
Reduced Planck constant (h-bar) |
|
|
E = ℏω |
Overline |
|
|
x |
Formula |
Use as many statements as needed. Each statement must contain the same number of |
|