rstudio / tinytex

A lightweight, cross-platform, portable, and easy-to-maintain LaTeX distribution based on TeX Live
https://yihui.org/tinytex/
Other
983 stars 116 forks source link

Preserving additionally installed TeXLive packages #413

Closed ondohotola closed 10 months ago

ondohotola commented 1 year ago

I use MacTeX BasicTeX which is also a smaller version of TexLive and as I don't want to lose the additionally installed packages I do something like

tlmgr list --only-installed \
   | awk '{gsub(/:/, ""); print $2}' \
   > ~/Downloads/texlive.$(date +%F).installed.txt

and then after upgrading

tlmgr install $(cat ~/Downloads/texlive.$(date +%F).installed.txt)

ignoring the error (cause by the already installed packages).

That might be useful for TinyTeX upgrades as well.

yihui commented 1 year ago

Thanks for the suggestion! That's exactly what we do in the R function: https://github.com/rstudio/tinytex/blob/a39c87c677446b8555affeefb0c540ad0f8bc9c5/R/install.R#L298-L310

If not (re)installing TinyTeX via the R function, we also tell users how to install previously installed packages: https://github.com/rstudio/tinytex/blob/a39c87c677446b8555affeefb0c540ad0f8bc9c5/tools/install-bin-unix.sh#L7-L13

For Chocolatey users, packages are also automatically reinstalled: https://github.com/rstudio/tinytex-releases/blob/master/choco/tools/chocolateybeforemodify.ps1