\documentclass[12pt]{article}
\usepackage{fancyvrb, hyperref, mymacros}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    urlcolor=blue
}

\begin{document}
    \title{The \texttt{mymacros} package}
    \author{1.0 \ 2021/04/06 \\ (written 2018 -- April 2021)}
    \date{Andrew Lounsbury}
    \maketitle

    \section{Description}
    This package serves as a set of examples of user-defined \LaTeX\ commands. Everything here is something that I used or experimented with during my time as an undergraduate student. Some of the commands may not be useful at all. \p
    The primary purpose of most commands in this package is to reduce the amount of typing required. 

    \section{Writing Your Own Commands}
    If you're reading this, you're presumably an undergraduate student who might be interested in using \LaTeX. In general, I think the best way to start using \LaTeX\ and then form a habit of it is to start early and to learn things little by little. \p
    That being said, one of the most useful things you can do is to write commands that make things easier. I would recommend accumulating these commands in one file (package) as you go along, similarly to what I've done here with \texttt{mymacros}. 
    \begin{example*}
        In Advanced Calculus I found that I was having to type $\mathscr{R}(\alpha)$ (\texttt{\textbackslash mathscr\{R\}(\textbackslash alpha)}) over and over again. So, I wrote the command 
        \begin{verbatim}
            \newcommand{\ara}{\mathscr{R}(\alpha)}
        \end{verbatim}
        to avoid this. `\texttt{ar}' is an onomatopoeic rendition of the letter `R' spoken aloud, and the second `\texttt{a}' stands for ``alpha.'' You have to get creative with naming these things. 
    \end{example*}
    
    \section{Some Actual Documentation}
    Some of this information is similar to the formalities you might see in the documentation of other packages. 

    \subsection{License}
    This software is contributed to the public domain. In other words, I don't care what you do with it. Add things to it, remove things from it, copy things from it to your own set of macros, distribute it, whatever. 

    \subsection{Acknowledgements}
    Most of the \texttt{LINEAR ALGEBRA} section---and perhaps a few commands elsewhere---were provided to me in my freshman year by Dr.\ R.\ Ablamowicz, emeritus. I'm just going to leave them there. 

    \subsection{Dependencies}
    The \texttt{mymacros} package loads \texttt{forloop, mathrsfs, mathtools, nicefrac, xcolor, amsmath, amsfonts, amssymb, amsthm, cancel, graphicx}, and \texttt{verbatim}. Most packages will rely on nowhere near as many packages as this. It only loads this many because \texttt{mymacros} is essentially my personal preamble file, so I put whatever I wanted there. \p
    These dependencies may require or include other packages. For instance, the \texttt{nicefrac} package includes the \texttt{units} package. If you require one of these packages to be loaded with some option, consider loading it yourself before the \texttt{mymacros} package or use, e.g., 
    \begin{Verbatim}
        \PassOptionToPackage[tight]{units}
    \end{Verbatim}

    \subsection{Commands from \texttt{mathtools}}
    The commands \texttt{\textbackslash Mid} and \texttt{\textbackslash set} are created (and respectively renamed from \texttt{\textbackslash given} and \texttt{\textbackslash Set}) from the documentation of the \href{https://ctan.org/pkg/mathtools}{\texttt{mathtools}} package as follows: 
    \begin{verbatim}
    \providecommand\Mid{}
    \newcommand\SetSymbol[1][]{%
        \nonscript\:#1\vert%
        \allowbreak%
        \nonscript\:%
        \mathopen{}%
    }
    \DeclarePairedDelimiterX{\set}[1]\{\}{%
        \renewcommand\Mid{\SetSymbol[\delimsize]}%
        #1%
    }
    \end{verbatim}
    The command \texttt{\textbackslash set} is invoked as \texttt{\textbackslash set\{}$\langle$\textit{argument}$\rangle$\texttt{\}}: 
    \[
        2\Z = \set{x \in \Z \mid x \bmod 2 = 0}, 
    \]
    but adding a \texttt{*} makes everything extensible, in which case we use \texttt{\textbackslash Mid} rather than \texttt{\textbackslash mid}: 
    \[
        \Q = \set*{\f{x}{y} \Mid x,y \in \Z}. 
    \]

    \subsection{For Whom it May Interest}
    There are a couple of things in \texttt{mymacros} that you will likely never use but may be curious about. 
    \subsubsection{Conditionals}
    At the end of \texttt{mymacros.sty} there are some experimental commands for typing ditto marks:\dit. They are underdeveloped and not very useful, but I'm leaving them as an example of the more advanced things we can do with \LaTeX, such as for-from-to loops, for-each-in loops, while loops, etc. \p
    One applications of conditionals is in drawing with Ti\textit{k}Z. For examples of \texttt{\textbackslash foreach}, refer to \href{https://stuff.mit.edu/afs/athena/contrib/tex-contrib/beamer/pgf-1.01/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse15.html}{this page}. \p
    I've also used the conditional \texttt{\textbackslash ifdim} \dots \texttt{\textbackslash fi} in my \href{https://ctan.org/pkg/suppose}{\texttt{suppose}} package. 

    \subsubsection{Math Space}
    The command \texttt{\textbackslash mspace\{\}}, or math space, is a more precise way of inserting horizontal space in math mode. It accepts rational values of the unit \texttt{mu}. The conversion is \\
    
    \noindent
    18 \texttt{mu} = 1 \texttt{\textbackslash quad} = 1 \texttt{em} = the width of `M' in the current font. 
    \begin{gather*}
        x \mspace{18mu} y \\
        x \quad y \\
        xMy
    \end{gather*}
    1 \texttt{\textbackslash qquad} is the width of `MM'.
    \begin{gather*}
        x \mspace{36mu} y \\
        x \qquad y \\
        xMMy
    \end{gather*}
    Other spaces are defined to be a certain number of \texttt{mu}. \\
    For instance, the thin space \texttt{\textbackslash ,} is 3 \texttt{mu}: 
    \begin{gather*}
        x \mspace{3mu} y \\
        x\,y
    \end{gather*}
    The thick space \texttt{\textbackslash ;} is 6 \texttt{mu}: \\
    \begin{gather*}
        x \mspace{6mu} y \\
        x\;y
    \end{gather*}
    The negative thin space \texttt{\textbackslash !} is $-3$ \texttt{mu}:
    \begin{gather*}
        x \mspace{-3mu} y \\
        x\!y
    \end{gather*}
\end{document}