knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file()) # Set WD to Root
here::i_am("my_dev/tex-pkg.Rmd")
library(here)
library(dplyr)
library(stringr)
library(tinytex)

Install TinyTeX

tinytex::install_tinytex()

list all installed LaTeX packages

# list all installed LaTeX packages
tlmgr(c('info', '--list', '--only-installed', '--data', 'name'))

Thai LaTeX Packages Dependencies

Read Thai Preamble from inst/template

th_pre_chr <- readLines(con = here("inst/templates/thai-preamble.tex"))
th_pre_chr
th_pre_chr %>% 
  str_subset("usepackage")

Main one is "fontspec", "ucharclasses", "setspace", "polyglossia"

thai_latex_pkg <- c("fontspec", "ucharclasses", "setspace", "polyglossia", 
                    "hyperref", "url", "cite", "xcolor")

thai_latex_pkg

Install Specific PKG for Thai

thai_latex_pkg <- c("fontspec", "ucharclasses", "setspace", "polyglossia", 
                    "hyperref", "url", "cite", "xcolor")
thai_latex_pkg
tinytex::tlmgr_install(pkgs = thai_latex_pkg)
tinytex::tlmgr_install(c(
  "fontspec", "ucharclasses", "setspace", "polyglossia",
  "hyperref", "url", "cite", "xcolor"
))


Lightbridge-KS/thaipdf documentation built on June 18, 2022, 6:58 a.m.