hooks_rtl | R Documentation |
This function defines customized knitr
hooks to handle RTL (right-to-left)
text formatting for languages like Persian and Arabic for Sweave
. It allows you to modify
the appearance of output, messages, warnings, and errors when producing RTL documents.
hooks_rtl(fontcolor = "black", backcolor = "gray")
fontcolor |
Font color for inline output. Default is "black". |
backcolor |
Background color for inline output. Default is "gray". |
The function returns a list of customized knit_hooks
that handle RTL text formatting.
It modifies the output, messages, warnings, errors, inline expressions, and source code
to include appropriate commands for RTL languages.
Xie, Y. (2014). Dynamic Documents with R and knitr. Chapman & Hall/CRC. ISBN: 978-1482203530.
Use markdown_rtl
to enable RTL formatting for Markdown documents.
# Define custom RTL hooks
rtl_hooks <- hooks_rtl()
# Apply custom RTL hooks to `knit_hooks`
knitr::knit_hooks$set(rtl_hooks)
# After setting the hooks, knit your document as usual to produce RTL formatting.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.