Changelog
A common method is to simply install the full TeXLive distribution for out-of-the-box functionality.
user:~$ sudo apt install texlive-full
and you're done! Takes about 6 GB of space. Can use MikTeX as an alternative distribution, but this will be a tad more hands-on (including installing of additional packages).
user:~$ latexmk -pdf main.tex
Make sure the TeXLive manager directory for usermode is initialized first, and the associated TeX Directory Structure (TDS)-conformant directory for packages.
user:~$ tlmgr init-usertree user:~$ mkdir -p ~/texmf/{tex/latex,source}
Packages cannot be installed using tlmgr directly from CTAN. Instead, we pull from the CTAN source, and compile them. Wikibooks has a partial guide, but does not seem too updated.
% Convenience macros
% Defines \graphic for quick figure entries
\makeatletter
\newcommand*{\graphic@wide}{figure} % default values
% \newcommand*{\graphic@here}{}
\newcommand*{\graphic@squish}{0.9\linewidth}
\newcommand*{\graphic@nosquish}{}
\newcommand*{\graphic@label}{nolabel}
\newcommand*{\graphic@texpath}{}
\define@key{graphic}{wide}[default]{\def\graphic@wide{figure*}} % replace
% \define@key{graphic}{here}[]{\def\graphic@here{h!}}
\define@key{graphic}{squish}{\def\graphic@squish{#1}}
\define@key{graphic}{nosquish}[default]{\def\graphic@nosquish{blah}}
\define@key{graphic}{label}{\def\graphic@label{#1}}
\define@key{graphic}{texpath}{\def\graphic@texpath{#1}}
\newcommand{\graphic}[3][]{{ % avoid propagating options
\setkeys{graphic}{#1}
\begin{\graphic@wide}%[\graphic@here]
\centering
\ifx\graphic@texpath\@empty
\ifx\graphic@nosquish\@empty\includegraphics[width=\graphic@squish]{#2}
\else\includegraphics{#2}\fi
\else
\ifx\graphic@nosquish\@empty
\ifx\graphic@squish\@empty%
\else\def\svgwidth{\graphic@squish}\footnotesize\fi
\fi
\import{figures/\graphic@texpath}{#2}
\fi
\caption{\label{\graphic@label}#3}
\end{\graphic@wide}
}}
\makeatother
├─ build │ └─ main.pdf │ ├─ includes │ ├─ bibliography │ │ └─ *.bib # bibliography data │ ├─ preamble │ │ ├─ base.tex # base package imports │ │ ├─ drafting.tex # shortcuts for temporary scaffolding │ │ └─ shortcuts.tex # additional project-wide shortcuts │ └─ *section.tex # sections to be imported into main.tex │ ├─ static │ ├─ resources │ │ └─ templates/ # journal LaTeX templates │ ├─ data │ │ └─ FIGURE/ # shared data for figure replication │ └─ figures │ ├─ *FIGURE # scripts for figure generation │ │ ├─ generate │ │ │ ├─ FIGURE.py │ │ │ └─ FIGURE.mplstyle │ │ └─ figure.eps │ ├─ base.mplstyle # base style for matplotlib │ ├─ onecol.mplstyle # add figsize for single column diagrams │ └─ twocol.mplstyle │ ├─ .gitignore ├─ .svnignore ├─ main.tex # main text └─ Makefile