Learn R Programming

cocoon (version 0.2.0)

format_chr: Format character strings with italics and type

Description

Format character strings with italics and type

Usage

format_chr(x, italics = TRUE, type = "md")

Value

A character string that has either Markdown or LaTeX formatting for italics or not.

Arguments

x

Character string.

italics

Logical value (default = TRUE) for whether text should be italicized.

type

Type of formatting ("md" = markdown, "latex" = LaTeX).

Examples

Run this code
format_chr("Hello world!")
# Format in LaTeX syntax
format_chr("Hello world!", type = "latex")
# Remove italics
format_chr("Hello world!", italics = FALSE)

Run the code above in your browser using DataLab