latex_command: Generate a LaTeX command

View source: R/general.R

latex_commandR Documentation

Generate a LaTeX command

Description

Generate a LaTeX command

Usage

latex_command(
  x,
  required_args = list(),
  optional_args = list(),
  brace_protect = TRUE
)

Arguments

x

The contents of the environment, a scalar vector where it will be collapsed with newlines.

required_args

A list of the required arguments to the environment, in order.

optional_args

A named list of the optional arguments to the environment, in order. It is an error for an optional argument to be NULL prior to a non-optional argument.

brace_protect

If there are no required_args, should empty braces, \{\}, be added to the end of the command?

Value

A character scalar of the command

Examples

latex_command("newpar")
latex_command("newpar", brace_protect=FALSE)
latex_command("section", required_args="My first section")
latex_command("frac", required_args=list(1, 2))

billdenney/latex.makers documentation built on July 9, 2023, 12:46 p.m.