Bookmark and Share
  • Last verified as of
    • macOS: 2020-5-14 and macOS 10.14.6 and MacTex 2020.0407;
    • Linux: 2015-9 and Ubuntu.

Linux

Tested on Ubuntu Linux 14 as of 2015-9.

sudo apt-get install texlive-full

Install extensions using apt-get

How to search the package that contains file standalone.sty and install it:

$ sudo apt-get install apt-file
$ apt-file update
$ apt-file search standalone.sty
texlive-latex-extra: /usr/share/texlive/texmf-dist/tex/latex/standalone/standalone.sty
$ sudo apt-get install texlive-latex-extra

macOS

Veify if you already have LaTeX and needs an update

As of May 14, 2020, the latest 'tex-live' release is 'Tex Live 2020'.

I verified on my computer that I have an older version installed:

$ which latex
/Library/TeX/texbin/latex

$ latex --version
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015)
kpathsea version 6.2.1
Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.17; using libpng 1.6.17
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with xpdf version 3.04

I no longer remember how I installed it or if I used homebrew or 'MacTeX'. But I will just re-install it using Homebrew assuming I don't really need to carefully uninstall the current files.

Uninstalling previous versions of MacTeX

Uninstall previous versions of MacTeX[^mactexuninstalling]:

$ ls -la /usr/local/texlive/                                                                     drwxr-xr-x  20 root  wheel   640B May  8  2019 2015/
drwxr-xr-x  20 root  wheel   640B May  8  2019 2017/
drwxr-xr-x  20 root  wheel   640B May  8  2019 2019/
drwxr-xr-x   9 meng  admin   288B Oct 27  2017 texmf-local/
$ du -hs /usr/local/texlive/2015
4.3G
$ du -hs /usr/local/texlive/2017
5G
$ du -hs /usr/local/texlive/2019
6.3G
$ sudo rm -rf /usr/local/texlive/2015 /usr/local/texlive/2017 /usr/local/texlive/2019
  • Remove the GUI application

      rm -rf /Applications/TeX
    
  • Re-install MacTeX

      brew cask install mactex
    

Installing MacTex using homebrew

Homebrew tells you to install MacTeX if you simply search for the keyword 'tex':

$ brew search tex
asciitex        blahtexml       itex2mml        latexila        libtextcat      rtf2latex2e     texinfo         vilistextum
bibtex2html     gettext ✔       latex2html      latexml         opendetex       texapp          texmath
bibtexconv      html2text       latex2rtf       libdrawtext     ptex            texi2html ✔     textql
caskroom/cask/tex-live-utility             caskroom/fonts/font-tex-gyre-adventor      caskroom/fonts/font-tex-gyre-heros
caskroom/fonts/font-tex-gyre-cursor        caskroom/fonts/font-tex-gyre-termes        caskroom/fonts/font-tex-gyre-pagella-math
caskroom/fonts/font-tex-gyre-chorus        caskroom/fonts/font-tex-gyre-schola
caskroom/fonts/font-tex-gyre-bonum         caskroom/fonts/font-tex-gyre-pagella

If you meant "tex" specifically:
Installing TeX from source is weird and gross, requires a lot of patches,
and only builds 32-bit (and thus can't use Homebrew dependencies)

We recommend using a MacTeX distribution: https://www.tug.org/mactex/

You can install it with Homebrew-Cask:
  brew cask install mactex

I will just install using

$ brew cask install mactex
==> Downloading http://mirror.ctan.org/systems/mac/mactex/mactex-20170524.pkg
Already downloaded: /Users/meng/Library/Caches/Homebrew/Cask/mactex--20170524.pkg
==> Verifying checksum for Cask mactex
==> Installing Cask mactex
==> Running installer for mactex; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
==> installer: Package name is MacTeX-2017
==> installer: Upgrading at base path /
==> installer: The upgrade was successful.
🍺  mactex was successfully installed!
>>> elapsed time 9m39s

$ which latex                                                                        
/Library/TeX/texbin/latex

$ latex --version                                                                        
pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.29; using libpng 1.6.29
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 3.04

Installing extensions using tlmgr

Alternatively, if the TeX system is not installed via Ubuntu Linux's package management system and apt-get, one can use tlmgr to install and update the TeX extensions:

tlmgr update --self --all
tlmgr install standalone
tlmgr update standalone

Linux

The TeX package management tool tlmgr itself is part of texlive-base and can be installed via

sudo apt-get install texlive-base

macOS

On macOS, installing MacTeX using homebrew will install tlmgr as well.

References

[^mactexuninstalling] tug.org/mactex. "Uninstalling". https://www.tug.org/mactex/uninstalling.html.

blog comments powered by Disqus