as_paragraph() to compose rich cell content.
as_chunk()
Add formatted text to a paragraph.Text or any value that can be formatted as text using the
formatter function.An
fp_text_default() or officer::fp_text() object specifying font properties. If NULL, the cell default is used.A function that converts
x to a character vector....
Additional arguments passed to
formatter.Example
as_b()
Produce a bold text chunk.A chunk object or a value to convert to a chunk. If not already a chunk, it is converted via
as_chunk().as_i()
Produce an italic text chunk.A chunk object or a value converted to a chunk.
as_sub()
Produce a subscript text chunk.A chunk object or a value converted to a chunk.
as_sup()
Produce a superscript text chunk.A chunk object or a value converted to a chunk.
as_bracket()
Paste values together and wrap the result in brackets.Values to paste together. Each is formatted with
formatC().Separator between values.
Prefix character.
Suffix character.
Example
colorize()
Apply a text color to a chunk.A chunk object or a value converted to a chunk.
A valid color string (e.g.,
"red", "#FF0000").Example
as_highlight()
Apply a background highlight color to a chunk.A chunk object or a value converted to a chunk.
A valid color string used as the highlight (background) color.
Example
hyperlink_text()
Create a clickable hyperlink chunk.The link display text.
Font properties from
fp_text_default() or officer::fp_text().A function that converts
x to a character vector.The URL. URLs are not encoded; they are preserved as-is.
Requires the
officedown package in R Markdown contexts with Word output.Example
as_equation()
Insert a MathJax equation chunk. Requires theequatags package.
MathJax equation strings.
Display width of the equation.
Display height of the equation.
Unit for
width and height: "in", "cm", or "mm".Font properties applied to the equation text.
as_image()
Insert an image chunk from a file path.Path to the image file.
Display width. Can be omitted when
guess_size = TRUE and the magick package is installed.Display height. Can be omitted when
guess_size = TRUE and magick is installed.Unit for
width and height: "in", "cm", or "mm".If
TRUE and magick is installed, image dimensions are read from the file automatically.PowerPoint cannot mix images and text in a paragraph. Images are removed when outputting to PowerPoint format.
Example
See also
as_paragraph()— combine chunks into a paragraphcompose()— apply a paragraph to selected cellscolformat_image()— display image file paths as images in a column