diff options
Diffstat (limited to 'microstructure.cls')
-rwxr-xr-x | microstructure.cls | 196 |
1 files changed, 196 insertions, 0 deletions
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 |