plot_math: Preview shaped math expression

View source: R/shape_math.R

plot_mathR Documentation

Preview shaped math expression

Description

This function allows you to preview the layout that shape_math() calculates. It renders the positioned glyphs and lines (fraction bars, radical overlines, cancel lines, etc.) using grid graphics, and shows the position of the baseline relative to the equation. This is primarily a debugging and visualization tool.

Usage

plot_math(shaped, id = 1)

Arguments

shaped

The output of a call to shape_math()

id

The index of the expression to show if shaped contains multiples

Value

This function is called for its side effects

Examples

## Not run: 
shaped <- shape_math(r"(\frac{a}{b})", family = "STIX Two Math")
plot_math(shaped)

shaped <- shape_math("x^2 + y^2 = z^2", family = "STIX Two Math")
plot_math(shaped)

## End(Not run)

textshaping documentation built on Nov. 20, 2026, 5:08 p.m.