Install LaTeX for GMT LaTeX Integration - GenericMappingTools/gmt GitHub Wiki

Ubuntu:

sudo apt-get install texlive-latex-base texlive-binaries texlive-fonts-recommended

macOS with Homebrew:

brew install --cask mactex-no-gui

macOS with MacPort:

sudo port install texlive-basic texlive-latex texlive-fonts-recommended