As I'm writing this small tutorial, I assume you've read my previous one about setting up macOS, so if for any tool I'll use without explanation, look to that other article.
The full version IS NOT MANDATORY, as in the tutorial that follows I installed the smaller version of MacTeX and proceded installing every needed dependency. Installing the complete package is about ~3.5GB of download and ~5GB on disk, the smaller one is just about 80MBs.
Click here to download the complete version or here to download the smaller version.
GnuPlot is a small library for drawing some kind of plots, I use it all the time.
brew install gnuplotbrew update && brew install imagemagickSkim is a pdf viewer that syncs nicely with sublime text.
brew cask install skimWhat follows is a list of packages that are commonly needed (they are needed in our main project), they come installed with the ginormous package from MacTex, but I prefer a granular approach to avoid useless software. They can be installed all with the following command:
sudo tlmgr update --self
sudo tlmgr install latexmk subfiles ctablestack luacode luatex85 silence emptypage framed biblatex logreq xstring chngcntr sectsty minted fvextra ifplatform ifoddpage relsize relsize csquotes pgfplots circuitikz paralist enumitem glossaries datatool glossaries-english glossaries-italian glossaries-german mfirstuc xfor substr imakeidx fourier utopia quotchap soul collection-fontsrecommended algorithm2e xargs stanli preview standalone tikz-qtreeHere you can read to have an idea on the usage of each package:
First of all, we update the package manager as follows:
sudo tlmgr update --selfLatexmk is a tool used to build latex documents.
sudo tlmgr install latexmkSubfiles is a package that allows to compile subfiles.
sudo tlmgr install subfilesCtablestack is a package that allows to render tables.
sudo tlmgr install ctablestackLuacode is a package that allows to compile luacode in luatex.
sudo tlmgr install luacode luatex85Silence is a package that allows to shush noise and useless warnings.
sudo tlmgr install silenceEmptypage is a package that allows to leave empty pages to separate topics.
sudo tlmgr install emptypageFrames is a package that allows to frame theorems, definitions etc..
sudo tlmgr install framedBiblatex is a package that allows to load bibliographies.
sudo tlmgr install biblatexLogreq is a package that allows to automate some workflows.
sudo tlmgr install logreqXstring is a package that allows to automate workflows on string editing.
sudo tlmgr install xstringChngcntr is a package that allows to reset counters for images, equations etc...
sudo tlmgr install chngcntrSectsty is a package that allows you to apply custom styles to chapters and sections.
sudo tlmgr install sectstyMinted is a package that allows you to highlight code.
sudo tlmgr install mintedFvextra is a package that automates line breaks.
sudo tlmgr install fvextraIfplatform is a package that allows for if statements in latex for the various compilers (pdflatex, latex, lualatex...).
sudo tlmgr install ifplatformifoddpage is a package that allows to check if the current page is odd or even.
sudo tlmgr install ifoddpageRelsize sets relative font size.
sudo tlmgr install relsizeCsquotes allows for automatic smart quotes.
sudo tlmgr install csquotesPgfplots allows compiling cool graphs.
sudo tlmgr install pgfplotsCircuitikz allows to draw circuits.
sudo tlmgr install circuitikzParalist allows for advanced lists.
sudo tlmgr install paralist enumitemGlossaries allows to automate glossaries.
sudo tlmgr install glossaries datatool glossaries-english glossaries-italian glossaries-germanMfirstuc allows to make first letter upper case.
sudo tlmgr install mfirstucMfirstuc reimplements stronger latex "for" cycles implementation.
sudo tlmgr install xforSubstr enables commands to check substring relationships.
sudo tlmgr install substrSubstr enables you to get info about the current language from babel or polyglossia.
sudo tlmgr install tracklangImakeidx builds automatically the index.
sudo tlmgr install imakeidxFourier extends the fonts enabled in amsmath.
sudo tlmgr install fourier utopiaQuotchap enables nice style for chapters.
sudo tlmgr install quotchapQuotchap enables nice style for chapters.
sudo tlmgr install quotchapSoul enables Hyphenation for letterspacing, underlining, and more.
sudo tlmgr install soulFontsrecommended is a collection of fonts commonly used.
sudo tlmgr install collection-fontsrecommended(https://ctan.org/pkg/algorithm2e?lang=en)[algorithm2e] Algorithm2e is a package to write pseudocode.
sudo tlmgr install algorithm2e(https://ctan.org/pkg/xargs?lang=en)[Xargs] is a package that provides extended versions of \newcommand
sudo tlmgr install stanli(https://ctan.org/pkg/stanli?lang=en)[Stanli] is a package to draw 2d and 3d structural analysis.
sudo tlmgr install stanli(https://ctan.org/pkg/preview?lang=en)[Preview] and (https://ctan.org/pkg/preview?lang=en)[Standalone] are packages used to run math preview in latextools in sublime text.
sudo tlmgr install preview standalone(https://ctan.org/pkg/tikz-qtree?lang=enn)[Tikz-qtree] is a package to easily draw trees.
sudo tlmgr install tikz-qtreeLatexindent come with MacTex but can also be downloaded separately, when installed with the lightweight plugin, with the following commands:
sudo tlmgr option repository ctan
sudo tlmgr update --self
sudo tlmgr install latexindentJust execute the command cpan in the terminal and follow its instruction. Then exit from the cpan ambient and install the following dependencies as follow:
sudo cpan -fi Log::Dispatch Log::Log4perl YAML::Tiny Getopt::Long File::HomeDir Unicode::GCStringNow exit from cpan and try running the command latexindent. Make sure that it runs.
After following my guide over here we can continue here. Add to your package control settings these packages:
{
"installed_packages":
[
"LaTeX-cwl",
"LaTeXTools",
"LaTeXYZ"
]
}With packages such as minted you will need to enable shell escape. Just open up the package specific settings for LaTeXTools and add in the builder settings the following options:
"builder_settings" : {
"display_log" : false,
"options": [
"--shell-escape"
],
"osx" : {},
"windows" : {},
"linux" : {}
},Pygments script is necessary for stuff like code highlight. You might have already this installed.
pip install pygmentizeIf you have already installed it with Anaconda and your Tex editor does not find it, probably you need to create a link to the usr folder as follows:
sudo ln -s /anaconda3/bin/pygmentize /usr/local/bin/pygmentizeIf the command fails you might need to look up for the current file position and create a link from there.
BeautifyLatex is a a package for sublime text that help format the latex code using latexindent. You need to add this by hitting super+maiusc+p and search for "Add Repository". Then you can add the package as usual, with super+maiusc+p and "Add Package".
Dictionaries adds multilanguage dictionaries for your latex projects. You need to add this by hitting super+maiusc+p and search for "Add Repository". Then you can add the package as usual, with super+maiusc+p and "Add Package".
Log4perl no longer required for latexindent :)