Format Text as Inline Code
code.RdWraps text as inline code for Markdown, LaTeX, or HTML output.
Usage
code(x, fmt = c("markdown", "tex", "html"))Details
For Markdown output, this function uses single backticks for ordinary strings. If a string contains a backtick, it uses double backticks with surrounding spaces:
“` “ code with ` backtick “ “`
This avoids the common problem of producing invalid inline code when the content itself contains a backtick.
For LaTeX and HTML output, the input is first escaped using [escape()] and then wrapped in the appropriate code markup.