Learn R Programming

onbrand (version 1.0.8)

ft_apply_md: Render Markdown in flextable Object

Description

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)

Value

flextable with markdown applied

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.

Examples

Run this code
library(onbrand)
library(flextable)

df = data.frame(
 A = c("e^x^",      "text"),
 B = c("sin(x~y~)", "**S**~x~"))

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

ft

Run the code above in your browser using DataLab