Sign and variation tables
The web equivalent of tkz-tab (LaTeX). With <mp-vartable> you declare the columns and rows, mathpad draws the arrows cleanly, vertically aligns the symbols, automatically inserts separator bars and «forbidden» double-bars. Native scaling, mobile adaptation via the scale attribute.
Anatomy of a table
A <mp-vartable> contains:
<mp-vartable-abscissa>— required, top row with the $x$ values and interval cells between them<mp-vartable-sign>— sign row (typical for $f'(x)$). Optional, repeatable.<mp-vartable-top>— upper values of a variation (limits, local maxima)<mp-vartable-middle>— arrows row: cell «increasing», «decreasing» or «forbidden»<mp-vartable-bottom>— lower values (symmetric to top)- Each row contains
<mp-cell>elements — one per column.
<mp-cell>. If they don't match, alignment breaks — a common pitfall when adding a column without updating all rows. Sign table
Example: sign of $f'(x) = 2x - 4$.
<mp-vartable>
<mp-vartable-abscissa>
<mp-cell>$x$</mp-cell>
<mp-cell>$-\infty$</mp-cell>
<mp-cell></mp-cell>
<mp-cell>$2$</mp-cell>
<mp-cell></mp-cell>
<mp-cell>$+\infty$</mp-cell>
</mp-vartable-abscissa>
<mp-vartable-sign>
<mp-cell>$f'(x)$</mp-cell>
<mp-cell></mp-cell>
<mp-cell>$-$</mp-cell>
<mp-cell>0</mp-cell>
<mp-cell>$+$</mp-cell>
<mp-cell></mp-cell>
</mp-vartable-sign>
</mp-vartable>
Variation table
The three rows top, middle, bottom work together: middle states the arrow direction, top and bottom position the values at the corners the arrow reaches.
<mp-vartable>
<mp-vartable-abscissa>
<mp-cell>$x$</mp-cell>
<mp-cell>$-\infty$</mp-cell>
<mp-cell></mp-cell>
<mp-cell>$2$</mp-cell>
<mp-cell></mp-cell>
<mp-cell>$+\infty$</mp-cell>
</mp-vartable-abscissa>
<mp-vartable-top>
<mp-cell>$f(x)$</mp-cell>
<mp-cell>$+\infty$</mp-cell>
<mp-cell></mp-cell>
<mp-cell></mp-cell>
<mp-cell></mp-cell>
<mp-cell>$+\infty$</mp-cell>
</mp-vartable-top>
<mp-vartable-middle>
<mp-cell></mp-cell>
<mp-cell></mp-cell>
<mp-cell>decreasing</mp-cell>
<mp-cell></mp-cell>
<mp-cell>increasing</mp-cell>
<mp-cell></mp-cell>
</mp-vartable-middle>
<mp-vartable-bottom>
<mp-cell></mp-cell>
<mp-cell></mp-cell>
<mp-cell></mp-cell>
<mp-cell>$-1$</mp-cell>
<mp-cell></mp-cell>
<mp-cell></mp-cell>
</mp-vartable-bottom>
</mp-vartable>
Combination: derivative + variation
Classic for a complete function study: one sign row for $f'(x)$, then top/middle/bottom for $f$.
Special markers
In cells of a mp-vartable-sign or middle, some keywords tell mathpad to draw a special shape:
| Value | Meaning | Used in |
|---|---|---|
| + or $+$ | plus sign | sign |
| - or $-$ | minus sign | sign |
| 0 | vertical separator bar + zero | sign |
| bar0 | variant: vertical bar + zero alongside (double-root column) | sign |
| bar | vertical bar alone (e.g. forbidden value) | sign |
| $0$ | styled zero WITHOUT separator bar | sign |
| forbidden | double vertical bar (forbidden zone) | sign, middle |
| increasing | increasing arrow | middle |
| decreasing | decreasing arrow | middle |
forbidden use case
For the function $f(x) = \dfrac{1}{x-2}$: at $x = 2$ forbidden value, hence <mp-cell>forbidden</mp-cell> in the middle row, separating the left and right asymptotes. scale attribute
Tables sometimes overflow available space. The scale attribute shrinks or enlarges the table without loss of detail (text, padding and arrows scale proportionally).
| Value | Effect |
|---|---|
| number (0.2 → 3) | Direct factor. 0.75 mobile-friendly, 1.25 for projector. |
| compact | Preset = 0.75 |
| normal | Preset = 1 (default) |
| large | Preset = 1.25 |
<mp-vartable> individually, set vartable-scale="0.75" on <mp-course> — applies to all tables in the document, overridable per table. Ready to try mathpad?
Create your first interactive scientific HTML document in the online editor, or import your existing LaTeX course in one click.