Generate a LaTeX command
latex_command.Rd
Generate a LaTeX command
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?
Examples
latex_command("newpar")
#> [1] "\\newpar{}"
latex_command("newpar", brace_protect=FALSE)
#> [1] "\\newpar"
latex_command("section", required_args="My first section")
#> [1] "\\section{My first section}"
latex_command("frac", required_args=list(1, 2))
#> [1] "\\frac{1}{2}"