Skip to contents

Takes a flextable object and renders any markdown in the specified part.

Usage

ft_apply_md(ft, obnd = NULL, part = "body", prows = NULL, pcols = NULL)

Arguments

ft

Flextable object.

obnd

Optional onbrand object used to format markdown. The default NULL value will use default formatting.

part

Part of the table can be one of "all", "body" (default), "header", or "footer".

prows

Optional rows of the part to process, ignored when part = "all". Set to NULL (default) to process all rows.

pcols

Optional columns of the part to process, ignored when part = "all". Set to NULL (default) to process all columns.

Value

flextable with markdown applied

Examples

library(onbrand)
library(flextable)

df = data.frame(
 A = c("e^x^",      "text"),
 B = c("sin(x~y~)", "**<ff:symbol>S</ff>**~x~"))

ft = flextable(df) |>
     delete_part(part="header") |>
     add_header(values = 
       list(A= "*Italics*", 
            B= "**Bold**") )    |>
     theme_vanilla()            |>
     ft_apply_md(part="all")

ft

Italics

Bold

ex

sin(xy)

text

Sx