Placing things in the Preview

The Preview is where you put things on the scene. Click to select, drag to move, with guides that line things up; nudge with the arrow keys; scale and turn with handles; and work on several things at once.

The Preview at a glance

The Preview shows the scene at the time of the playhead (the line you move along the ruler of the timeline), as Manim will draw it. What you do in it edits the clip of the formula you touch — one appearance of that formula on the timeline (see the glossary): its position, its scale and its rotation. Scene positions are in Manim's units: the frame is 8 units tall and, at 16:9, 14.22 units wide, with the origin at its centre and y going up.

The view toolbar sits in the title bar of the panel, at the right. Its buttons, from the left:

The Preview's toolbar with seven numbered parts: five buttons, the zoom control and the Fit button.
(1) Align by symbol, (2) Circle selector, (3) Keep the transform handles shown, (4) Snap to objects, (5) Multicamera, which gives the scene a camera, (6) Zoom out, the zoom and Zoom in, (7) Fit.

Selecting

Point at a formula and the glyph under the pointer is outlined. Click, and the formula's clip is selected: it gets a teal box. A click on a clip of the timeline selects the same thing, so the Preview and the timeline always agree.

While the scene plays, the Preview leaves the pointer alone: nothing is outlined, selected or dragged, and the transform handles are hidden. What is selected stays selected. Stop the scene to work on it. You can still pan and zoom the view while it plays.

A click selects a clip; Ctrl+click adds a second one; a rectangle drawn from empty space selects the clips it touches, in place of the ones selected before.

The whole formula counts, not only its ink: the gap between two glyphs belongs to the formula. To pick single glyphs of a formula, hold Alt: that is its own page in the Layout section.

Dragging and snapping

Press on a formula and drag: its clip follows the pointer. If it is one of several selected clips, they all move together. The box around what you move snaps to the edges and the centres of the other formulas and of the frame, as soon as it is within 8 pixels of a match. Yellow guides show what it lines up with.

The third formula goes up to the row of the other two: the yellow lines say what its box is lined up with, first the middle of the frame, then the other formulas. Between the two it stops where the gaps are equal. Ctrl+Z undoes the whole drag.

On an axis where no edge or centre matches, a dragged formula can still snap to the spot that is as far from two formulas as they are from it, or to the gap two neighbours keep. Those equal gaps are drawn as bars with a tick at each end.

A formula between two others on one row, with a yellow line along their tops and two yellow bars with end ticks under the gaps.
The yellow line says the tops are level; the two bars under the gaps say the gaps are equal.

A corner drag of a handle (below) sticks the same way to the width or the height of another formula, and shows the two equal sizes as bars.

Snapping has a switch: the magnet button of the view toolbar (Snap to objects, also in Preferences ▸ Snap to objects). The colour and the width of the guides are in the same menu, as Guide colour and Guide width.

One drag is one undo step, and Esc during the drag puts everything back.

Holding a drag to one axis, or setting it free

Press the button first, then the key: with a key already down, the press means something else (Ctrl+click adds to the selection, and Alt+click picks glyphs or pans the view).

Held during the dragWhat the drag does
nothingFollows the pointer, snapping to the other formulas and to the grid.
AltMoves only along one axis: horizontally or vertically, whichever the pointer has gone further along since the drag began. It still snaps along that axis.
CtrlFollows the pointer with no snapping at all: no guides, no grid.
Ctrl+AltAlong one axis, with no snapping.

The axis is chosen again as the pointer moves, and a note at the bottom of the Preview says which one holds. Let go of Alt and the drag follows the pointer again. A key pressed or let go changes the drag at once, without a pointer move.

Alt pressed in the middle of a drag holds the formula on one horizontal line, and it still snaps along it; let go of Alt and the formula goes to the pointer.

Nudging with the arrow keys

Click a formula, and the arrow keys move the selected clips: ← → ↑ ↓ by 0.01 scene units, with Shift by 0.1. A hint at the bottom of the Preview says so once it has the keys. There is no snapping: a press moves by its step exactly.

The X and Y of the clip's Initial state, in the Timing tab of the Animations panel (ringed), follow the keys. Four presses of → make X 3.74; two of Shift+↑ make Y 2.75; one of Shift+← makes X 3.64. One Ctrl+Z undoes the whole run.

For an exact place, type it: the X, Y, Scale and Rotation fields of Initial state take numbers, and Flip X and Flip Y mirror the formula.

The grid

The Show grid button, in the middle of the transport bar, draws a grid under the formulas and makes a dragged formula land on its nearest node. The grid exists only in the editor: it is never in an export.

The grid controls of the transport bar: a button with a hash sign (1), a minus, the number 1 and a plus (2), and a button with a square dot (3).
(1) Show grid; (2) Sparser grid, the spacing in Manim units and Denser grid; (3) what the grid holds.
The grid is shown (1 unit). With the magnet off, so that only the grid holds the formula, a drag across it jumps from node to node by the formula's centre.

Scale and rotate: the handles

Hold Shift over a selected clip and its transform handles appear, with a hint in the corner. The button that keeps them on without Shift is the third one of the view toolbar (Preferences ▸ Keep the transform handles shown).

A formula inside a teal box with a square handle at each corner and a small circle above it; the hint at the bottom says what to drag.
Four square handles scale; the circle above the box turns.
A corner scales the formula and the circle turns it; the ringed Scale and Rotation fields of its Initial state follow.

Several at once

With two or more clips selected, a bar appears in the top-left corner of the Preview: the number of clips, the buttons to align and distribute them (Align and distribute), and the menus Paste properties and Match colors (Match colors). Dragging any of the selected clips moves them all, and the box around the whole group is what snaps.

Hold Shift and the handles frame the whole group: a corner scales every clip about the middle of the group, and the circle turns the group, each clip about that same point. The scale snaps in steps, as for one clip.

The four formulas of the scene selected, one teal box round all of them with a square handle at each corner and a circle above it.
Ctrl+A selects the four formulas; with Shift held, the handles frame the group. A corner scales them all toward its middle; the circle turns them all.

Not every selected clip can move. A clip on a locked track, a clip locked in the preview, a clip locked after its transformations and a clip that is not on screen stay where they are. A drag leaves them without a word; Align, Distribute and Paste properties name them in a notice, and so do the arrow keys and the group's handles for the ones that are on screen. Braces, shapes and labels attached to a formula follow the formula they hang on.

When a clip does not move

Some clips cannot be moved from the Preview. For the first three kinds below, a notice says why:

When several clips are selected and only some of them can move, the others stay. A drag leaves them without a word; Align, Distribute, Paste properties, the arrow keys and the group's handles name them in a notice (“2 clips stayed”).

Zooming and panning

Zoom with Ctrl and the mouse wheel, about the pointer, or with the Zoom out and Zoom in buttons of the toolbar (about the middle of the view). Pan with the middle mouse button held, or with Alt held while you drag on empty space. Fit shows the whole frame again.

Ctrl and the wheel zoom about the formula under the pointer; Alt and a drag on empty space pan; Fit brings the whole frame back.

The view is for looking: zooming and panning change nothing in the project, and they do not move the formulas or the export.

Locking a formula in the preview

A formula you have placed can be locked, so that you cannot move it by accident while you place the others around it. Right-click its clip on the timeline and choose Lock in the preview.

The menu of a clip on the timeline, with its last entry, Lock in the preview, highlighted.
The entry is at the end of the clip's menu on the timeline.
The Preview with four formulas, one of them, in the upper right, drawn faded.
The formula at the upper right is locked: it is drawn at 40 %.
The start of a clip on the timeline with a small mark, a crossed-out pointer, before the formula's name.
The mark on a locked clip.

Locking is for the editor only: the exported Python and the video are the same with or without it.

A right-click on a formula selects its clip (unless it is already among the selected ones) and opens its menu.

The Preview's right-click menu of a clip: Copy properties, Paste properties, Align, Distribute, Add brace, Add shape, Add line, Intro, Outro, Remove animations, Remove relations, Unlink formula, Split at playhead, Apply match colors, and the colours in order.
The menu of a formula in the Preview.

Copy properties and Paste properties ▸ copy the look of a clip — scale, rotation, flips, opacity, colours — and, if you choose Position, its place, onto other clips; Align ▸ and Distribute ▸ are described in Align and distribute; Add brace ▸, Add shape ▸ and Add line ▸ add those objects on the formula (Braces, Shapes, Lines and arrows); the rest are the clip's own entries, as on the timeline.

A right-click on empty space opens a small menu of scene actions, Add line. A double-click on a text in the Preview opens that text in the composition editor, at that clip (LaTeX texts and font texts); a formula opens from the Creator, or by a double-click on its clip on the timeline.

Try it

Open preview-placing and put the four formulas where you want them.

The scene itself writes its four formulas one after the other. Here it is, as you will find it once you have tidied the layout:

The snapping example, preview-guides, is the scene of the clips about guides:

Keys and gestures of this page

GestureWhat it does
Click; Ctrl or Shift+clickSelect; add to the selection or take out
Drag on empty spaceRectangle that selects the clips it touches (Esc cancels)
Ctrl+ASelect every clip on screen at the playhead
Drag; then AltMove; hold to one axis
Drag; then CtrlMove without snapping
← → ↑ ↓; with ShiftMove the selected clips 0.01; 0.1
Shift heldShow the transform handles (a group's when several are selected)
Ctrl held while scaling or turningFree values, no steps and no size guides
Ctrl+'; Alt+↑ Alt+↓Show or hide the grid; denser, sparser
Pinch or Ctrl + wheel; scroll, middle button or Alt + drag on empty spaceZoom about the pointer; pan
EscCancel the drag in progress

The whole list is in the keyboard and mouse reference. To pick single glyphs, see Picking glyphs with Alt; to line formulas up exactly, Align and distribute and Align by symbol.

Where to go next