\documentclass[draft]{ltugboat}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}  % needed for \XeLaTeX command
\usepackage{microtype}
\usepackage{ifpdf}
\ifpdf
\usepackage[breaklinks,hidelinks,pdfa]{hyperref}
\else
\usepackage{url}
\fi

\title{A First Set of \LaTeX\ Packages}
\author{Jim Hef{}feron}
\address{Saint Michael's College}
\netaddress{jhefferon@smcvt.edu}  
\personalURL{https://hefferon.net/}

% ? This worked for a while and then it didn't, so I wrapped \url{..}
\newcommand{\tbsurl}[1]{\url{#1}}

% \usepackage{texlogos}
\newcommand\PDFLaTeX{pdf\LaTeX}
\newcommand\LuaLaTeX{Lua\LaTeX}
\newcommand{\Asymptote}{\texttt{Asymptote}} % as per the manual


\begin{document}
\maketitle
\begin{abstract}
This describes a curated list of packages that covers most of what
beginners want to do.
It seeks to name one package in each area that is capable and reliable.
\end{abstract}



% ==============================
\section{Overview}
% A goal of the \TeX{} Users Group is helping users.
At TUG 2019 I reported on using social media to help understand
the needs of today's beginners, \cite{JHnewcomers}.
Often they just need a pointer to the right package. 
This describes a package list suited to those users.
% It expands and updates an earlier list, from \cite{JHresources},
% by including social media experience.

A list that is exhaustive wouldn't help here;
I have kept the document to two sides of a page.
% Where possible, the most helpful thing is to  name just one package.
Of course that involved making choices. 
I am sorry that this leaves off some first-quality work, but
in any event, the packages named are capable and basically bug-free.

Beyond solving problems, 
the criteria for inclusion in the list
is that a package should be
in the distributions and popular.
I also value documentation, particularly if it has helpful examples.

Part of the reason for this article is to solicit feedback.
I have already made improvements in 
response to comments on a draft from social media, in~\cite{reddit}.
The end product will be a document in \PDF{}, \HTML{}, and video.
The \PDF{} will be on \CTAN.

Below I will go over the choices.
The document core consists of a few sections classifying areas,  
intended to help a user find packages,
which is reproduced below.
Each package name is a hyperlink, with a terse description.
(There are a few extra comments in parentheses that
come up in conjunction with the recommendations.)

Before those is an introduction.
It mentions
\CTAN{},\footnote{\protect\tbsurl{ctan.org}}
the target of the links.
It also mentions using 
\verb!texdoc! to read local documentation.
Finally, it notes that 
if a person is  writing for a journal or 
institution then they should ask if there is a house package.



% ===================================
\section{Every document}
To change page size, margins, and orientation, use 
\texttt{geometry}.\footnote{\protect\tbsurl{ctan.org/pkg/geometry}}
Get multiple columns with 
\texttt{multicol}.\footnote{\protect\tbsurl{ctan.org/pkg/multicol}}

Any document containing significant amounts of mathematics should use 
the American Mathematical Society's packages
\texttt{amsmath}\footnote{\protect\tbsurl{ctan.org/pkg/amsmath}}
and 
\texttt{amssymb}.\footnote{\protect\tbsurl{ctan.org/pkg/amssymb}} 
I also use 
\texttt{amsthm}\footnote{\protect\tbsurl{ctan.org/pkg/amsthm}}
for producing theorem environments.
Notes: (1)~\texttt{amssymb} inputs \texttt{amsfonts} so you don't
need to load the latter, 
(2)~load \texttt{amsthm} after \texttt{amsmath},
(3)~don't load \texttt{amsmath} directly, instead get it by loading 
\texttt{mathtools},\footnote{\protect\tbsurl{ctan.org/pkg/mathtools}} 
which adds some useful improvements. 

You can toss in 
\texttt{microtype}.\footnote{\protect\tbsurl{ctan.org/pkg/microtype}} 
My eye can't spot the improvements but I appreciate that
it means that there are fewer awkward lines.


% ===================================
\section{Inside a document}
To tweak lists, use 
\texttt{enumitem}.\footnote{\protect\tbsurl{ctan.org/pkg/enumitem}}

Enhance captions with 
\texttt{caption}\footnote{\protect\tbsurl{ctan.org/pkg/caption}}
and control floating environments with 
\texttt{float}.\footnote{\protect\tbsurl{ctan.org/pkg/float}} 
(In particular,  if you want an option that overrides automatic 
float placement and puts something
exactly where you ask, this package provides the option `\texttt{H}'.)

Get hyperlinks and turn references into links with 
\texttt{hyperref}\footnote{\protect\tbsurl{ctan.org/pkg/hyperref}} 
(this should be the last or next to last package
that you load).
Make cross-references say `Theorem~1.2' instead of just `1.2'
with the one-r-ed 
\texttt{cleveref}\footnote{\protect\tbsurl{ctan.org/pkg/cleveref}} 
(load it after \texttt{hyperref}).
Have \acro{URL}'s and file paths that can linebreak with 
\texttt{url}\footnote{\protect\tbsurl{ctan.org/pkg/url}}
(but \texttt{hyperref} has its own facility, 
so if you are using \texttt{hyperref} just go with that).

I do code listings with 
\texttt{listings},\footnote{\protect\tbsurl{ctan.org/pkg/listings}}
(although 
\texttt{minted}\footnote{\protect\tbsurl{ctan.org/pkg/minted}} 
also has a lot going for it). 
Make single quotes inside verbatim text come out correctly with 
\texttt{upquote}.\footnote{\protect\tbsurl{ctan.org/pkg/upquote}}

(A tangent:~copy and paste for computer code listings would be especially 
convenient.
This is a start for the \texttt{listings} package.
\begin{verbatim}[\small]
\lstset{basicstyle = \ttfamily,
        columns=fullflexible}
\end{verbatim}
But it is not a full solution.  
For one thing, the result depend on the \PDF{} viewer. 
Worse, it loses initial spaces in a line\Dash if your code line begins with
four blank spaces then after a copy and paste those spaces are gone.) 
% My understanding is that the issue is with \PDF{}.  
% You can instead attach the code file with 
% \texttt{attachfile2}\footnote{\protect\tbsurl{ctan.org/pkg/attachfile2}}
% although this depends on the reader and is awkward if you have lots of
% snippets.)

For code in Python have a look at 
\texttt{pythontex},\footnote{\protect\tbsurl{ctan.org/pkg/pythontex}}
which, besides showing the code listings, also allows you to execute
Python and put the results in your output.
Do the same for 
the \textit{Sage} mathematics software suite with
\texttt{sagetex},\footnote{\protect\tbsurl{ctan.org/pkg/sagetex}}
and similar systems exist for R, Haskell, and Scheme.

There are many packages that add table capabilities such as
multirow entries and breaking across pages.
I most often use 
\texttt{array},\footnote{\protect\tbsurl{ctan.org/pkg/array}} 
which lets you define custom column types.
For units, 
use 
\texttt{siunitx}\footnote{\protect\tbsurl{ctan.org/pkg/siunitx}} 
(which also has a table column type for aligning on a decimal point).

To make boxes that are colored or framed, such as boxes for theorems,
I use 
\texttt{mdframed}.\footnote{\protect\tbsurl{ctan.org/pkg/mdframed}} 

Finally, when developing a document I often want some filler text.
I use 
\texttt{lipsum}.\footnote{\protect\tbsurl{ctan.org/pkg/lipsum}}


% ===================================
\section{Graphics and color}
To include graphics in files and to do simple manipulation such as resizing, 
use
\texttt{graphicx}.\footnote{\protect\tbsurl{ctan.org/pkg/graphicx}}
Use the \acro{JPG} format for photos,
\acro{PNG} for other kinds of raster graphics,
and \PDF{} for vector graphics.
If your graphic is in another format then convert it to one of the three.
(Usually you give the file name without the extension,
as with \verb!\includegraphics{graph}!.)
Include parts of a \PDF{} document with
\texttt{pdfpages}.\footnote{\protect\tbsurl{ctan.org/pkg/pdfpages}}
Include video or sound using
\texttt{media9}.\footnote{\protect\tbsurl{ctan.org/pkg/media9}}

To get colors, use 
\texttt{xcolor}\footnote{\protect\tbsurl{ctan.org/pkg/xcolor}} 
(although the documentation can be hard to make out).

For plots and graphics I use 
\Asymptote,\footnote{\protect\tbsurl{https://asymptote.sourceforge.io/}}
a development of \MP{} with three dimensional
features.
However, many people instead use  
\TikZ\footnote{\protect\tbsurl{ctan.org/pkg/pgf}}
to draw graphics inside the document.

\section{Front and back matter, headers, footers}
To style chapter and section titles, use
\texttt{titlesec}.\footnote{\protect\tbsurl{ctan.org/pkg/titlesec}}
For page headers and footers, reach for 
\texttt{fancyhdr}.\footnote{\protect\tbsurl{ctan.org/pkg/fancyhdr}}
You can tweak the format of tables of contents, lists of figures, etc., 
with
\texttt{tocloft}.\footnote{\protect\tbsurl{ctan.org/pkg/tocloft}}

Write answers to exercises to an external file so you can read them in 
later with 
\texttt{answers}.\footnote{\protect\tbsurl{ctan.org/pkg/answers}}
I like footnotes at the page bottom, so I use 
\texttt{footmisc}\footnote{\protect\tbsurl{ctan.org/pkg/footmisc}} 
(but I had to hack to change the space between a footnote mark and 
the footnote).
Make an index with 
\texttt{makeindex}.\footnote{\protect\tbsurl{ctan.org/pkg/makeindex}}
Bibliographies are thorny area, with lots of strict requirements.
\CTAN{} is a big help here since it has many styles for both
\BibTeX\footnote{\protect\tbsurl{ctan.org/topic/bibtex-sty}}
and
\BibLaTeX.\footnote{\protect\tbsurl{ctan.org/topic/biblatex}}




\section{Special documents}
Make exams and problem sets with the 
\texttt{exam}\footnote{\protect\tbsurl{ctan.org/pkg/exam}}
class.

There are many, many resume and CV packages.
Have a look at \acro{CTAN}'s
\textit{cv} tag.\footnote{\protect\tbsurl{ctan.org/topic/cv}}

To make presentations use the
\texttt{beamer}\footnote{\protect\tbsurl{ctan.org/pkg/beamer}}
class.
(But with this package you are entering another world, where many of the
packages discussed here do not work.
For example, section title styling happens via a completely
different mechanism.)



\section{Fonts and engines}
To see options besides the default Computer Modern fonts,
visit the \LaTeX\ Font 
Catalogue,\footnote{\protect\tbsurl{https://www.tug.org/FontCatalogue/}}
which includes copy and paste code to make each one work.

Beyond that list, you can also use any font that your computer has 
(which usually works well only if you document 
does not have much mathematics).
To convert \LaTeX{} source to \PDF{} there are
three programs, called engines.
Most people use \PDFLaTeX.
The \XeLaTeX{} engine and the \LuaLaTeX{} engine can leverage
the \texttt{fontspec}\footnote{\protect\tbsurl{ctan.org/pkg/fontspec}}
package to use your system's fonts.
(A word about the preprint site \url{arXiv.org}.
If your document was produced with \XeLaTeX{} or \LuaLaTeX{} then 
you can only submit a \PDF, not the document source.)



\section{What's missing?}
Again, I would be glad to hear suggestions for making this list better.


% \SetBibJustification{\raggedright \advance\itemsep by 1pt plus1pt minus1pt }
\bibliographystyle{plain}
\bibliography{hefferonpackages}


\advance\signaturewidth by 25pt
\makesignature
\end{document}
