thaipdf_document {thaipdf} | R Documentation |
Convert to a PDF/LaTeX document with Thai Language Compatibility
Description
Thai language supported conversion of R Markdown to a PDF or LaTeX document.
It is a wrapper around rmarkdown::pdf_document()
.
Usage
thaipdf_document(thai_font = "TH Sarabun New", line_spacing = 1.5, ...)
Arguments
thai_font |
(Character) Name of the Thai font to use. Default font is "TH Sarabun New". It can be any Thai font that installed in your system. |
line_spacing |
(Numeric) Spacing between each line. Line spacing 1.5 is recommended for Thai language (default). |
... |
Arguments to pass to |
Details
To achieve Thai language compatibility for LaTeX,
This function injects preamble fragment of Thai LaTeX typesetting into the preamble of output LaTeX via includes
argument,
and set latex_engine
to "xelatex".
Value
An S3 object of class "rmarkdown_output_format" to pass to rmarkdown::render()
See Also
How to use
rmarkdown::pdf_document
, please see official documentation.How to use
thaipdf_book()
.
Examples
## Not run:
library(rmarkdown)
# Simple Conversion
render("input.Rmd", output_format = thaipdf::thaipdf_document())
# Render with Thai font "Laksaman", font size 10pt, enable table of contents
render("input.Rmd",
output_format = thaipdf::thaipdf_document(
thai_font = "Laksaman", # you must have this font in your system
toc = TRUE,
pandoc_args = pandoc_metadata_arg("fontsize", "10pt")
))
## End(Not run)