Draws a line of markdown, such as a plot title, with LaTeX math between
$...$. **bold**, *italic*, `code` and ~~strike~~ work,
and so does some inline HTML. For headings, lists, tables and other
blocks, use markdown_box_grob().
Arguments
- md
Markdown, as a character string.
- style
A
markdown_style(), CSS text, or a path to a.cssfile.NULL(default) useslatex_options("markdown_style"), if set. Only properties marked inline inmd_style()apply.- ...
Passed to
latex_grob(), such asx,y,hjust,vjust,rot,max_widthandgp.
Value
A grob, as from latex_grob(). grid.markdown() draws it and
returns it invisibly.
Details
These HTML tags are supported:
| tag | effect |
<b>, <strong> | bold |
<i>, <em>, <cite>, <dfn>, <var>,
<address> | italic |
<code>, <kbd>, <samp>, <tt> | monospace |
<u>, <ins> | underline |
<s>, <del>, <strike> | strikethrough |
<sub>, <sup> | sub / superscript |
<mark> | yellow highlight |
<small>, <big> | smaller / larger |
<q> | quotation marks |
<br> | line break |
<span style="..."> | see below |
A style attribute can set color, text-decoration (underline,
line-through), font-size (such as 12pt, 1.2em or smaller)
and font-family; other properties are ignored. Colours
are R colour names, CSS names, #rgb, #rrggbb or rgb().
font-family takes serif, sans-serif, monospace, an installed
font, or a font named with load_font().
Tags nest and can hold markdown and math. Other tags are dropped and their text kept. Links keep their text only. Images must be local PNG, JPEG or SVG files. The characters U+E000 to U+E002 are removed from the input.
Examples
# \donttest{
grid::grid.newpage()
grid.markdown(r"(The **fitted** slope is $\beta_1$, *p* < 0.001)")
# }