Gallery

71 figures · Open a figure to explore its code.

layout (11)

geometry (10)

plotting (16)

maps (9)

networks (6)

text (5)

math (12)

api (2)

(inline_math)

Math inside prose

Text accepts formulas and other Gum elements alongside prose. Use Tex for text-style formulas; Latex keeps its display-style default, even inline.

Each formula is one indivisible item. The paragraph breaks around it at Unicode line-break opportunities, keeping adjacent punctuation and nonbreaking spaces attached. An oversized formula overflows instead of shrinking. wrap={false} keeps the whole paragraph on one line; use fitting when scaling is intentional.

String expression children make spaces explicit while keeping nested JSX indented. Ordinary literal prose newlines still create hard breaks in Text.

Inline elements align on their baseline, or their bottom edge if they have no baseline. The normal prose strut sets a minimum line height. Fractions and other tall items expand that line using logical height and depth; intentional ink overhang remains overflow. Subsequent lines retain their ordinary height.

Span passes its font size and color to a formula. Math retains its own default faces independently of the prose family. Ordinary kerning, whitespace normalization, hard breaks, and nonbreaking spaces still apply to the surrounding text.

TextBox and Text children in a bullet accept arrays mixing prose, spans, and formulas. Captions and titles can use the same arrays, or an explicit Text element. A sole block child stays a block. For several elements without prose, wrap them in Text to request inline layout, or use TextCol for separate blocks.

The example reuses one formula in two different paragraph widths and in a list. See Gum inside math for the other direction.