Render an emphatic object to Latex
as_latex(x, ..., font_size = NULL)
emphatic object
other arguments passed to as.character.emphatic()
Integer value indicating font size measured in points. Default: NULL.
single character string containing a latex representation
hl_diff("hello", "there") |>
as_latex() |>
cat()
#> \begingroup
#> \setlength{\fboxsep}{0pt}
#> \texttt{
#> {{[1]\hspace*{0.52em}"\vrule height 3mm depth 1.25mm width 0mm}}\textcolor[HTML]{000000}{\colorbox[HTML]{9AFF9A}{\hspace*{0.52em}\vrule height 3mm depth 1.25mm width 0mm}}{{he\vrule height 3mm depth 1.25mm width 0mm}}\textcolor[HTML]{000000}{\colorbox[HTML]{97FFFF}{ll\vrule height 3mm depth 1.25mm width 0mm}}\textcolor[HTML]{000000}{\colorbox[HTML]{FF7F50}{o\vrule height 3mm depth 1.25mm width 0mm}}{{"\vrule height 3mm depth 1.25mm width 0mm}}\\
#> {{[1]\hspace*{0.52em}"\vrule height 3mm depth 1.25mm width 0mm}}\textcolor[HTML]{000000}{\colorbox[HTML]{9AFF9A}{t\vrule height 3mm depth 1.25mm width 0mm}}{{he\vrule height 3mm depth 1.25mm width 0mm}}\textcolor[HTML]{000000}{\colorbox[HTML]{97FFFF}{re\vrule height 3mm depth 1.25mm width 0mm}}\textcolor[HTML]{000000}{\colorbox[HTML]{FF7F50}{\hspace*{0.52em}\vrule height 3mm depth 1.25mm width 0mm}}{{"\vrule height 3mm depth 1.25mm width 0mm}}
#> }
#> \endgroup