Skip to contents

Core rendering

Create and draw LaTeX math as grid grobs

latex_grob() grid.latex()
Create a grid grob from LaTeX
latex_dims()
Size of a LaTeX expression
latex_tree()
The layout of a LaTeX expression
grobMark()
Position of a named point in a LaTeX grob

Markdown

Render markdown, with LaTeX math inline, as grid grobs

markdown_grob() grid.markdown()
Render a markdown label as a grid grob
markdown_box_grob()
Render a markdown document as a boxed grid grob

Markdown styling

A small CSS cascade over the markdown tags

markdown_style()
A style for markdown rendering
md_style()
Declarations for one markdown tag

Syntax highlighting

Languages recognised in fenced code blocks, and how to add one

available_highlighters()
Syntax highlighting languages available
register_highlighter()
Add a syntax highlighting grammar

Options, macros, and cache

Project-wide defaults and advanced tooling

latex_options() reset_latex_options()
Set or show default rendering options
define_macro() clear_macros() list_macros()
Define a LaTeX shorthand for every label
latex_cache_limit() latex_cache_clear() latex_cache_info()
Layout cache

ggplot2 integration

Use LaTeX and markdown in ggplot2 plots

geom_latex()
A ggplot2 geom for LaTeX math labels
element_latex()
A ggplot2 theme element for LaTeX text
geom_markdown()
A ggplot2 geom for markdown labels
element_markdown()
A ggplot2 theme element for markdown text

Font management

Load and configure math and text fonts

available_math_fonts()
List available math fonts
load_math_font()
Load a math font from an OTF file
check_math_fonts()
Check math font status

Misc utilities

Utilities for working with LaTeX strings and rendering

latex_wrap()
Wrap the text of a label in \text{}