The function install_tinytex() downloads and installs TinyTeX, a
custom LaTeX distribution based on TeX Live. The function
uninstall_tinytex() removes TinyTeX; reinstall_tinytex()
reinstalls TinyTeX as well as previously installed LaTeX packages by default;
tinytex_root() returns the root directory of TinyTeX if found.
Usage
install_tinytex(
force = FALSE,
dir = "auto",
version = "daily",
bundle = "TinyTeX-1",
repository = "auto",
extra_packages = if (is_tinytex()) tl_pkgs(),
add_path = TRUE
)
uninstall_tinytex(force = FALSE, dir = tinytex_root())
reinstall_tinytex(packages = TRUE, dir = tinytex_root(), ...)
tinytex_root(error = TRUE)Arguments
- force
Whether to force to install or uninstall TinyTeX. For
install_tinytex(),force = FALSEwill stop this function from installing TinyTeX if another LaTeX distribution is detected, or the directory specified via thedirargument exists.- dir
The directory to install (should not exist unless
force = TRUE) or uninstall TinyTeX.- version
The version of TinyTeX, e.g.,
"2020.09"(see all available versions at https://github.com/rstudio/tinytex-releases, or viaxfun::github_releases('rstudio/tinytex-releases')). By default, it installs the latest daily build of TinyTeX. Ifversion = 'latest', it installs the latest monthly Github release of TinyTeX.- bundle
The bundle name of TinyTeX (which determines the collection of LaTeX packages to install). See https://github.com/rstudio/tinytex-releases#releases for all possible bundles and their meanings.
- repository
The CTAN repository to set. By default, it is the repository automatically chosen by
https://mirror.ctan.org(which is usually the fastest one to your location). You can find available repositories athttps://ctan.org/mirrors), e.g.,'http://mirrors.tuna.tsinghua.edu.cn/CTAN/', or'https://mirror.las.iastate.edu/tex-archive/'. In theory, this argument should end with the path/systems/texlive/tlnet, and if it does not, the path will be automatically appended. You can get a full list of CTAN mirrors viatinytex:::ctan_mirrors().- extra_packages
A character vector of extra LaTeX packages to be installed. By default, a vector of all currently installed LaTeX packages if an existing installation of TinyTeX is found. If you want a fresh installation, you may use
extra_packages = NULL.- add_path
Whether to run the command
tlmgr path addto add the bin path of TeX Live to the system environment variable PATH.- packages
Whether to reinstall all currently installed packages.
- ...
Other arguments to be passed to
install_tinytex()(note that theextra_packagesargument will be set totl_pkgs()ifpackages = TRUE).- error
Whether to signal an error if TinyTeX is not found.
Note
If you really want to disable the installation, you may set the
environment variable TINYTEX_PREVENT_INSTALL to true. Then
install_tinytex() will fail immediately. This can be useful to
sysadmins who want to prevent the accidental installation of TinyTeX.
Installing TinyTeX requires perl (on Linux, perl-base is insufficient).
References
See the TinyTeX documentation (https://yihui.org/tinytex/) for the default installation directories on different platforms.