Browse documentation

Reveal an aligned derivation, line by line

Stack several equation lines with every "=" aligned, and reveal them one at a time.

Show several steps of a derivation at once, stacked and aligned, revealed one line at a time.

When this is the right tool (vs. derivation)

Both mathtex (with lines) and derivation walk through a sequence of algebraic states, but they show that sequence differently:

  • derivation morphs ONE equation through successive states — each step replaces the last on screen, matched tokens sliding to their new position. Good for "watch this exact expression rearrange."
  • A mathtex with lines keeps every prior line visible, stacked below the one before it, with every = lined up vertically — the classic worked-proof layout. Good for "here's the full chain of reasoning, all still on screen."

If you want the classic "line 1, then line 2 appears below it, then line 3…" board-work look, use this. See Build a step-by-step equation derivation for the morph-in-place alternative.

Set up the lines

  1. Add a mathtex object (or open the Formula editor on an existing one).
  2. In Lines (one LaTeX per line, 2+ to enable), write each line of the proof, one per row. For example:
2x+3=112x=8x=4\begin{aligned} 2x + 3 &= 11 \\ 2x &= 8 \\ x &= 4 \end{aligned}

would be three lines: 2x + 3 = 11, 2x = 8, x = 4. The first = on each line becomes the alignment point automatically — you don't write the & yourself.

Leaving Lines empty falls back to the single f(x) = field above it — a plain one-line formula, unchanged from how mathtex has always worked. The aligned block only kicks in once you've entered 2 or more lines.

Reveal them one at a time

Once 2+ lines are set, a Lines shown field and a ◆ keyframe diamond appear. Keyframe it the same way as any other property — record mode or the ◆ diamond — and each integer boundary the playhead crosses reveals one more line via TransformMatchingTex, the same token-matching morph derivation's step uses. Leaving Lines shown unset (or dragging it to the last line) just shows the whole block at once, with no reveal animation.

Color a specific term

Turn on Color parts (set_color_by_tex) to recolor a specific substring everywhere it appears in the equation — useful for drawing the eye to the same term as it carries through several lines of a derivation. Add a substring (e.g. x, or \sin\theta) and a color; it compiles to set_color_by_tex(...), layered on top of the object's own fill color. This works whether or not Lines is in use — it's a plain per-part recolor on any mathtex object.

See Objects → Formula — mathtex for the exact field reference.