\documentclass{microstructure}

\author{DistressNetwork°}

\newcommand{\cmd}[1]{\mono{\textbackslash #1}}

\begin{document}

\resetv{-3\unit}\section{Microstructure Documentation}

\hr

\mono{microstructure} is a document class for the XeLaTeX typesetting software system. It aims to provide a well-defined and consistent visual and typographical style, as a print-oriented adaptation of the graphical style of the DistressNetwork° website.\footnote{DistressNetwork. ``Style Template.'' \url{https://distress.network/meta/styletest}.} This document describes its defined features, usage, and annotated implementation.

\subsection{Class Options}
\begin{description} \addfontfeature{Fractions=On}
	\item[debug] Prints a 1/2-unit (1/12 in) square grid on every page of output, for monitoring the positioning of document elements.
	\item[fleqn] Aligns math block elements to the left, as in the \mono{article} class.
	\item[nohf] Suppresses page header and footer generation.
\end{description}

\subsection{Commands}

\begin{itemize}
	\item Preamble: \cmd{author\{\}} defines the author name in the page header.
\end{itemize}

\subsubsection{Inline Elements}
\begin{table}{x x}
\bold{Command}				& \bold{Output/Description} \\
\cline{1-2}
\cmd{bold\{\}}		& \bold{Bold Weight} \\
\cmd{italic\{\}}	& \italic{Italic Style} \\
\cmd{sout\{\}}		& \sout{Strikethrough} \\
\cmd{mono\{\}}		& \mono{Monospace Font} \\
\cmd{inmath\{\}}	& \inmath{\mathrm{Inline\ Math}} \\
\cmd{link\{\}\{\}}	& \link{https://en.wikipedia.org/wiki/Hyperlink}{Link} \\
\cmd{footnote\{\}}	& Footnote Reference \\
\cmd{case}		& Enable Case-Sensitive Forms
\end{table}

\newpage

\resetv{-2.5\unit}\subsubsection{Block Elements}
\begin{table}{x x}
\bold{Command}					& \bold{Output/Description} \\
\cline{1-2}
\cmd{section\{\}}		& Header Level One \\
\cmd{subsection\{\}}		& Header Level Two \\
\cmd{subsubsection\{\}}		& Header Level Three \\
\cmd{hr}			& Horizontal Rule \\
\cmd{inputblock\{\}}		& Code block from external file \\
\cmd{inputblockenum\{\}}	& Code block from external file with line numbering \\
\cmd{reset}, (\cmd{resetv\{\}})	& Reset baseline grid alignment (with vertical offset height) \\
\end{table}

\reset
\subsection{Environments}
\begin{description}[labelwidth=\dimexpr1.5in-\labelsep]
	\item[itemize] Unordered list (three levels)
	\item[enumerate] Ordered list (three levels)
	\item[description] Description list (arbitrary levels)
	\item[codeblock] Verbatim code block
	\item[codeblockenum] Verbatim code block with line numbering
	\item[math] Math mode alignment block, equivalent to \mono{amsmath}'s \mono{align*}
\end{description}

\subsubsection{Tables}
The \mono{table} environment's column specification parameter has two defined symbols: `\mono{x}' for left-aligned paragraphs, and `\mono{X}' for justified paragraphs. Horizontal separators should be specified using \cmd{cline\{\}} rather than \cmd{hline}.

\subsubsection{Figures}
The \mono{figure} environment may contain one or more instances of \cmd{includegraphics\{\}} and zero or more instances of \cmd{caption\{\}}.

\newpage

\resetv{-3\unit}\section{Usage Notes}

\reset
\subsection{Dependencies}

\begin{itemize}
	\item The XeLaTeX typesetting software system
	\item The following typefaces:
	\begin{itemize}
		\item Neue Haas Grotesk Display
		\item Neue Haas Grotesk Text
		\item JetBrains Mono
	\end{itemize}
	\item The following packages which are included in the \mono{texlive} distribution:
	\begin{itemize}
		\item \mono{amsmath, amssymb, datetime2, enumitem, eso-pic, fancyhdr,\\
		footmisc, geometry, graphicx, hyperref, lastpage, listings,\\
		mathspec, microtype, realscripts, returntogrid, tabularx, \\
		tikz, ulem}
	\end{itemize}
\end{itemize}

\subsection{Grid Alignment}

\addfontfeature{Fractions=On} The positioning and spacing of all document elements are strictly defined in terms of a length of 1/6 of an inch, referred to internally as the \italic{unit}. Document elements are to remain aligned with an implicit 1/2-unit grid spanning the entire page. In order to ensure that this alignment is preserved surrounding elements of variable height, it is possible to issue a \cmd{reset} command immediately preceding paragraphs or block elements to be realigned. It is recommended to temporarily enable the \mono{debug} class option in order to verify consistent alignment during the document preparation process.

\subsection{Caveats}

\begin{itemize}
	\item Correct realignment of document elements via the \cmd{reset} command may require multiple recompilations.
	\item Correct typesetting of page numbers and the debug grid may require multiple recompilations.
	\item Grid alignments of tables are not well-defined and must be corrected manually.
\end{itemize}

\newpage

\resetv{-3\unit}\section{Implementation}

\reset (In progress.)

%\inputblockenum{microstructure.cls}[firstline=x,lastline=x]

\end{document}



