summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreudoxia <uplink@distress.network>2021-09-25 21:58:12 -0400
committereudoxia <uplink@distress.network>2021-09-25 21:58:12 -0400
commit10bc200ff63d2929e65857be39acb122864580a4 (patch)
tree47500e1376538c81e352d6ad657e69ce484a69ab
initial
-rwxr-xr-xclean.sh3
-rwxr-xr-xdoc.pdfbin0 -> 32549 bytes
-rwxr-xr-xdoc.tex127
-rwxr-xr-ximage.pngbin0 -> 17969 bytes
-rwxr-xr-xmicrostructure.cls196
-rwxr-xr-xtemplate.pdfbin0 -> 53510 bytes
-rwxr-xr-xtemplate.tex109
7 files changed, 435 insertions, 0 deletions
diff --git a/clean.sh b/clean.sh
new file mode 100755
index 0000000..935d96b
--- /dev/null
+++ b/clean.sh
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+rm *.aux *.log *.out *.gz
diff --git a/doc.pdf b/doc.pdf
new file mode 100755
index 0000000..9e63ceb
--- /dev/null
+++ b/doc.pdf
Binary files differ
diff --git a/doc.tex b/doc.tex
new file mode 100755
index 0000000..14b63d0
--- /dev/null
+++ b/doc.tex
@@ -0,0 +1,127 @@
+\documentclass{microstructure}
+
+\author{DistressNetwork°}
+
+\begin{document}
+
+\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: \mono{\textbackslash 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}
+\mono{\textbackslash bold\{\}} & \bold{Bold Weight} \\
+\mono{\textbackslash italic\{\}} & \italic{Italic Style} \\
+\mono{\textbackslash sout\{\}} & \sout{Strikethrough} \\
+\mono{\textbackslash mono\{\}} & \mono{Monospace Font} \\
+\mono{\textbackslash inmath\{\}} & \inmath{\mathrm{Inline\ Math}} \\
+\mono{\textbackslash link\{\}\{\}} & \link{https://en.wikipedia.org/wiki/Hyperlink}{Link} \\
+\mono{\textbackslash footnote\{\}} & Footnote Reference \\
+\mono{\textbackslash case} & Enable Case-Sensitive Forms
+\end{table}
+
+\newpage
+
+\subsubsection{Block Elements}
+\begin{table}{x x}
+\bold{Command} & \bold{Output/Description} \\
+\cline{1-2}
+\mono{\textbackslash section\{\}} & Header Level One \\
+\mono{\textbackslash subsection\{\}} & Header Level Two \\
+\mono{\textbackslash subsubsection\{\}} & Header Level Three \\
+\mono{\textbackslash hr} & Horizontal Rule \\
+\mono{\textbackslash inputblock\{\}} & Code block from external file \\
+\mono{\textbackslash inputblockenum\{\}} & Code block from external file with line numbering \\
+\mono{\textbackslash reset} & Reset baseline grid alignment
+\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[mathblock] Math mode alignment block, similar 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 \mono{\textbackslash cline\{\}} rather than \mono{\textbackslash hline}.
+
+\subsubsection{Figures}
+The \mono{figure} environment may contain:
+\begin{itemize}
+ \item One or more instances of \mono{\textbackslash includegraphics\{\}},
+ \item Zero or more instances of \mono{\textbackslash caption\{\}}.
+\end{itemize}
+
+\newpage
+
+\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, tabularx, tikz, ulem}
+ \end{itemize}
+ \item The following packages which are not included in the \mono{texlive} distribution:
+ \begin{itemize}
+ \item \mono{returntogrid}
+ \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 this alignment is preserved surrounding elements of variable height, it is possible to issue a \mono{\textbackslash 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 \mono{\textbackslash 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.
+ \item Grid alignments of the uppermost element of each page are as of yet unable to be corrected.
+\end{itemize}
+
+\newpage
+
+\section{Implementation}
+
+\reset (In progress.)
+
+%\inputblockenum{microstructure.cls}[firstline=x,lastline=x]
+
+\end{document}
+
+
+
diff --git a/image.png b/image.png
new file mode 100755
index 0000000..9be33bc
--- /dev/null
+++ b/image.png
Binary files differ
diff --git a/microstructure.cls b/microstructure.cls
new file mode 100755
index 0000000..1f3674f
--- /dev/null
+++ b/microstructure.cls
@@ -0,0 +1,196 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{microstructure}
+
+\RequirePackage[letterpaper]{geometry}
+\geometry{
+ top = 1in,
+ bottom = 1in,
+ left = 1in,
+ right = 1in
+}
+
+\RequirePackage{graphicx,amsmath,amssymb,ulem}
+
+\newlength{\unit}
+\setlength{\unit}{12bp}
+
+\setlength{\parindent}{0bp}
+\setlength{\parskip}{\unit}
+
+\renewcommand{\normalsize}{\fontsize{12bp}{18bp}\selectfont}
+\newcommand{\footnotesize}{\fontsize{9bp}{12bp}\selectfont}
+
+\RequirePackage[quiet]{mathspec}
+\RequirePackage{realscripts}
+\RequirePackage{microtype}
+\defaultfontfeatures{
+ Language = English,
+ Script = Latin
+}
+\newcommand{\case}{\addfontfeature{Letters=Uppercase}}
+\setmainfont{Neue Haas Grotesk Text Pro 55 Roman}[
+ BoldFont = Neue Haas Grotesk Text Pro 75 Bold,
+ ItalicFont = Neue Haas Grotesk Text Pro 56 Italic,
+ Mapping = tex-text,
+ StylisticSet = {1,3},
+ Contextuals = Alternate
+]
+\newfontfamily\display{Neue Haas Grotesk Display Pro 75 Bold}[
+ Mapping = tex-text,
+ StylisticSet = {1,3},
+ Contextuals = Alternate
+]
+\setmonofont{JetBrains Mono}
+\setmathfont(Latin)[Uppercase=Plain,Lowercase=Plain,Arabic=Plain]{Times New Roman}
+\renewcommand{\bold}[1]{{\bfseries #1}}
+\newcommand{\italic}[1]{{\itshape #1}}
+\newcommand{\mono}[1]{{\ttfamily #1}}
+
+\RequirePackage{returntogrid}
+\returntogridsetup{
+ step = 0.5\unit,
+ offset = 0bp
+}
+\newcommand{\reset}{\returntogrid}
+
+\renewcommand{\ULthickness}{1bp}
+
+\newcommand{\inmath}[1]{{\fontsize{15bp}{12bp}\selectfont $#1$}}
+
+\newcommand{\section}[1]{{\fontsize{32bp}{36bp}\selectfont \display #1 \par}}
+\newcommand{\subsection}[1]{{\fontsize{24bp}{24bp}\selectfont \display #1 \par}}
+\newcommand{\subsubsection}[1]{{\fontsize{16bp}{18bp}\selectfont \display #1 \par}}
+
+\newcommand{\hr}{\vspace{-1.5\unit}\reset\rule{\textwidth}{0.5bp}\vspace{-0.5\unit}\par}
+
+\@ifundefined{thepage}{\def\thepage{\arabic{page}}}{}
+\RequirePackage[hidelinks]{hyperref}
+\newcommand{\link}[2]{{\bfseries\href{#1}{#2}}{{\ttfamily\textsuperscript ↗}}}
+
+\RequirePackage[hang,multiple]{footmisc}
+\renewcommand\footnoterule{\smash{\rule[4bp]{2in}{0.5bp}}}
+\renewcommand{\hangfootparskip}{\unit}
+\renewcommand{\footnotemargin}{\unit}
+\setlength{\skip\footins}{\unit}
+
+\newenvironment{description}{}{}
+\RequirePackage{enumitem}
+\setlist[itemize,enumerate]{
+ align = parleft,
+ labelsep = 1.5\unit,
+ leftmargin = \labelsep
+}
+\setlist[itemize,1]{label=\raisebox{1bp}{$\bullet$}}
+\setlist[itemize,2]{label=\raisebox{1bp}{$\circ$}}
+\setlist[itemize,3]{label=\raisebox{1bp}{$\diamond$}}
+\newcommand{\labelenumi}{\theenumi.}
+\newcommand{\labelenumii}{\theenumii.}
+\newcommand{\labelenumiii}{\theenumiii.}
+\renewcommand{\theenumi}{\@arabic\c@enumi}
+\renewcommand{\theenumii}{\@Alph\c@enumii}
+\renewcommand{\theenumiii}{\@Roman\c@enumiii}
+\setlist[description]{
+ align = left,
+ labelsep = \unit,
+ labelwidth = \dimexpr1in-\labelsep,
+ leftmargin = \labelsep
+}
+
+\RequirePackage{listings}
+\lstdefinestyle{code}{
+ basicstyle = \ttfamily,
+ tabsize = 4,
+ breaklines, breakatwhitespace,
+ breakindent = 0bp,
+ aboveskip = \dimexpr1.5\unit-1.5bp,
+ belowskip = 0bp,
+ frame = single,
+ xleftmargin = \unit,
+ xrightmargin = \unit,
+ framesep = 0bp,
+ framextopmargin = \dimexpr\unit-0.5bp,
+ framexbottommargin = \dimexpr0.5\unit+0.5bp,
+ framexleftmargin = \unit,
+ framexrightmargin = \unit,
+ framerule = 0.5bp
+}
+\lstdefinestyle{enum}{
+ numbers = right,
+ numbersep = -0.5\unit,
+ numberstyle = {\textsuperscript}
+}
+\lstnewenvironment{codeblock}[1][]{\lstset{style=code,#1}}{}
+\lstnewenvironment{codeblockenum}[1][]{\lstset{style=code,style=enum,#1}}{}
+\newcommand{\inputblock}[2][]{\lstinputlisting[style=code,#1]{#2}}
+\newcommand{\inputblockenum}[2][]{\lstinputlisting[style=code,style=enum,#1]{#2}}
+
+\setlength{\abovedisplayskip}{0bp}
+\setlength{\belowdisplayskip}{0bp}
+\newenvironment{mathblock}{
+ \begingroup
+ \fontsize{15bp}{12bp}\selectfont
+ \setlength{\jot}{\unit}
+ \nonumber\align
+}{
+ \endalign\endgroup
+}
+
+\RequirePackage{tabularx}
+\setlength{\arrayrulewidth}{0.5bp}
+\setlength{\tabcolsep}{6bp}
+\renewcommand{\arraystretch}{1.666667}
+\newcolumntype{x}{>{\raggedright\arraybackslash}X}
+\newenvironment{table}[1]{
+ \vspace{-0.5\unit}\hspace{\unit}\tabularx{\dimexpr\textwidth-2\unit}{#1}
+}{
+ \endtabularx\par
+}
+
+\newcommand{\aligntwo}{\hspace{0.5\textwidth}\=\kill}
+\newcommand{\alignthree}{\hspace{0.333333\textwidth}\=\hspace{0.333333\textwidth}\=\kill}
+\newcommand{\alignfour}{\hspace{0.25\textwidth}\=\hspace{0.25\textwidth}\=\hspace{0.25\textwidth}\=\kill}
+
+\setkeys{Gin}{
+ width = \textwidth,
+ height = \dimexpr\textheight-6\unit,
+ keepaspectratio
+}
+\renewcommand{\caption}[1]{{\footnotesize\italic{#1}}\vspace{1.5\unit}}
+\newenvironment{figure}{
+ \setlength{\parskip}{1.5\unit}\centering
+}{
+ \par
+}
+
+\RequirePackage{lastpage,datetime2}
+\RequirePackage{fancyhdr}
+\pagestyle{fancy}
+\DTMnewdatestyle{yyyymmdd}{\renewcommand{\DTMdisplaydate}[4]{\number##1\DTMtwodigits{##2}\DTMtwodigits{##3}}}
+\DTMsetdatestyle{yyyymmdd}
+\fancyhead[R]{\case\footnotesize \today--\hspace{0bp}--\hspace{0bp}--\hspace{0bp}--\@author}
+\fancyfoot[C]{}
+\fancyfoot[R]{\case\footnotesize \thepage/\pageref{LastPage}}
+\renewcommand{\headrule}{}
+\renewcommand{\footrule}{}
+\setlength{\headheight}{1.5\unit}
+\setlength{\headsep}{\unit}
+\setlength{\topmargin}{\dimexpr -1\headsep-\headheight}
+\setlength{\footskip}{\dimexpr \headsep+0.5\unit}
+
+\RequirePackage{tikz,eso-pic}
+\DeclareOption{debug}{
+ \AddToShipoutPicture{
+ \begin{tikzpicture}[overlay,remember picture]
+ \draw[black!30!white,thin,shift={(current page.north west)}]
+ (current page.north west) grid[step=0.5\unit]
+ (current page.south east);
+ \end{tikzpicture}
+} }
+\DeclareOption{fleqn}{
+ \AtBeginDocument{\@mathmargin1.5\unit\relax}
+}
+\DeclareOption{nohf}{
+ \fancyhead[L,C,R]{}
+ \fancyfoot[L,C,R]{}
+}
+\ProcessOptions\relax \ No newline at end of file
diff --git a/template.pdf b/template.pdf
new file mode 100755
index 0000000..c871a12
--- /dev/null
+++ b/template.pdf
Binary files differ
diff --git a/template.tex b/template.tex
new file mode 100755
index 0000000..6469ad4
--- /dev/null
+++ b/template.tex
@@ -0,0 +1,109 @@
+\documentclass[fleqn,debug]{microstructure}
+
+\author{DistressNetwork°}
+
+\begin{document}
+
+\section{Header Level One}
+
+\reset\subsection{Header Level Two}
+
+\subsubsection{Header Level Three}
+
+\hr
+
+Paragraph \bold{(Bold)} \italic{(Italic)} \sout{(Strikethrough)} \mono{(Monospace)} \inmath{\mathrm{(Inline\ Math)}}
+
+\link{https://en.wikipedia.org/wiki/Hyperlink}{Link} \hspace{\unit}
+Footnote/Citation Reference\footnote{Footnote/Citation Content (With \link{https://en.wikipedia.org/wiki/Hyperlink}{Link} To Resource)}
+
+\begin{itemize}
+ \item Unordered List Level One
+ \begin{itemize}
+ \item Unordered List Level Two
+ \begin{itemize}
+ \item Unordered List Level Three
+ \end{itemize}
+ \end{itemize}
+\end{itemize}
+
+\begin{enumerate}
+ \item Ordered List Level One
+ \begin{enumerate}
+ \item Ordered List Level Two
+ \begin{enumerate}
+ \item Ordered List Level Three
+ \end{enumerate}
+ \end{enumerate}
+\end{enumerate}
+
+\begin{description}
+ \item[Description] Level One
+ \begin{description}
+ \item[Description] Level Two
+ \begin{description}
+ \item[Description] Level Three
+ \end{description}
+ \end{description}
+\end{description}
+
+%\begin{quote}
+% Block Quote
+%\end{quote}
+
+\begin{codeblock}
+int main() {
+ printf("Code Block\n");
+ printf("Line inside the same code block which is much longer than the line preceding it");
+ exit(0);
+}
+\end{codeblock}
+
+\begin{mathblock}
+f(s) = \int_{0}^{\infty}\left[\mathrm{Math\ Block}\right]\, e^{-st}\end{mathblock}
+
+\newpage
+
+\section{Paragraph Test}
+
+\reset
+In mathematics, computer science, and linguistics, a \bold{formal language} consists of words whose letters are taken from an alphabet and are well-formed according to a specific set of rules. The alphabet of a formal language consist of symbols, letters, or tokens that concatenate into strings of the language. Each string concatenated from symbols of this alphabet is called a word, and the words that belong to a particular formal language are sometimes called \italic{well-formed words} or \italic{well-formed formulas}. A formal language is often defined by means of a formal grammar such as a regular grammar or context-free grammar, which consists of its formation rules.
+
+The field of \bold{formal language theory} studies primarily the purely syntactical aspects of such languages---that is, their internal structural patterns. Formal language theory sprang out of linguistics, as a way of understanding the syntactic regularities of natural languages. In computer science, formal languages are used among others as the basis for defining the grammar of programming languages and formalized versions of subsets of natural languages in which the words of the language represent concepts that are associated with particular meanings or semantics.
+
+\section{Table Test}
+
+\begin{table}{x x x}
+\bold{Header 1} & \bold{Header 2} & \bold{Header 3} \\
+\cline{1-3}
+And blood-black nothingness began to spin, & A system of cells interlinked within & Cells interlinked within cells interlinked \\
+Within one stem; and dreadfully distinct & Against the dark, a tall white fountain played. & \italic{(Nabokov, 1962)}
+\end{table}
+
+\reset\section{Tab Alignment Test}
+
+\begin{tabbing}
+\aligntwo
+One \> Two
+\end{tabbing}
+
+\begin{tabbing}
+\alignthree
+One \> Two \> Three
+\end{tabbing}
+
+\begin{tabbing}
+\alignfour
+One \> Two \> Three \> Four
+\end{tabbing}
+
+\newpage
+
+\section{Image Test}
+
+\begin{figure}
+\reset\includegraphics{image.png}
+\caption{Image Caption}
+\end{figure}
+
+\end{document} \ No newline at end of file