Skip to contents

The 'munch' package renders rich inline text (bold, italic, code, links, images) in grid graphics and 'ggplot2', from markdown or 'flextable' chunks.

For 'ggplot2' integration, use element_md() and element_chunks() in theme elements, or geom_text_md() and geom_label_md() for annotations.

Advanced usage

Use md_grob() to convert markdown text to a grid grob, or chunks_grob() to convert 'flextable' paragraph objects (for superscripts, subscripts, and custom colors not available in markdown).

Limitations

Only graphics devices that support 'systemfonts' are compatible: 'ragg', 'svglite', or 'ggiraph'. The cairo_pdf() device is also supported when fonts are installed at the system level. Standard R devices (pdf(), png(), jpeg()) are not compatible but can still produce correct output if fonts are made available to the device (e.g. via 'extrafont'). See the "Getting started" vignette for details.

LaTeX and MathJax equations are not supported. For simple scientific notation, use as_sup() and as_sub() from 'flextable'.

Only inline formatting is supported: bold, italic, code, strikethrough, links, and images. Block elements such as headings, bullet lists, and numbered lists are not available.

Options

munch.skip_device_check

If set to TRUE, the device compatibility warning is suppressed. Use this when you have ensured that the fonts used by 'munch' are available to the active graphics device (e.g. via 'extrafont' for pdf()). Set with options(munch.skip_device_check = TRUE).

Author

Maintainer: David Gohel david.gohel@ardata.fr

Other contributors:

  • ArData [copyright holder]