diff options
Diffstat (limited to 'projdoc.cls')
-rw-r--r-- | projdoc.cls | 108 |
1 files changed, 65 insertions, 43 deletions
diff --git a/projdoc.cls b/projdoc.cls index c1865ec..4d4f3b8 100644 --- a/projdoc.cls +++ b/projdoc.cls @@ -10,6 +10,8 @@ % confusing to acrobat/firefox users \PassOptionsToPackage{hidelinks}{hyperref} \PassOptionsToPackage{english}{babel} +\PassOptionsToPackage{noabbrev}{cleveref} +\PassOptionsToPackage{nosort}{cleveref} % frequently used packages \RequirePackage{geometry} @@ -24,10 +26,16 @@ \RequirePackage{needspace} \RequirePackage{hyperref} \RequirePackage{microtype} -\RequirePackage{smartref} +\RequirePackage{xcolor} +\RequirePackage{etoolbox} +\RequirePackage{graphicx} +\RequirePackage{unicode-math} +\RequirePackage{amsmath} +\RequirePackage{cleveref} % font style \setmainfont{TeX Gyre Schola} +\setmathfont{TeX Gyre Schola Math} \setmonofont[Scale=0.85]{JetBrainsMono Nerd Font} % fix fonts w/ siunitx @@ -46,51 +54,49 @@ \def\organization#1{\def\@organization{#1}} \let\@version\relax \def\version#1{\def\@version{#1}} -\def\@maketitle{ - \centering - \vspace*{2in} - { - { - \bfseries\Huge - \strut\@title\strut - }\\% no parskip - { - \Large - \strut\@project\strut - } - } - - \vspace{1in} - - { - { - \def\and{\par} - \parskip=0.5ex - \strut\@author\strut - } - - \vspace{2em} - - {\strut\@organization\strut} - } - - \vfill - \flushright - - { - { - \strut{}Version \@version\strut - } - - { - \strut\@date\strut - } - } - - \vspace*{2in} +\def\@maketitle{% + \centering% + \parskip=0pt% + \vspace*{2in}% + \par{% + \par{% + \bfseries\Huge% + \strut\@title\strut% + }% + \par{% + \Large% + \strut\@project\strut% + }% + }% + \vspace{1in}% + \par{% + \par{% + \def\and{\par}% + \parskip=0.5ex% + \strut\@author\strut% + }% + \vspace{2em}% + \par{% + \footnotesize\itshape% + \strut\@organization\strut% + }% + }% + \vfill\flushright% + \par{% + \par{\strut{}Version \@version\strut}% + \par{\strut\@date\strut}% + }% + \par\vspace*{2in}% } \makeatother +% float here by default +\usepackage{float} +\makeatletter +\def\fps@figure{H} +\def\fps@table{H} +\makeatother + % always start with title page \AtBeginDocument{ \clearpage @@ -100,3 +106,19 @@ \end{titlepage} } +% store figure/table count in macros +\makeatletter +\AtEndDocument{ + \immediate\write\@mainaux{\string\global\string\def\string\figurecount{\the\value{figure}}} + \immediate\write\@mainaux{\string\global\string\def\string\tablecount{\the\value{table}}} + \immediate\write\@mainaux{\string\global\string\def\string\pagecount{\thepage}} +} +\makeatother + +% generate table of contents, figures, tables +\def\tablestables{% + \tableofcontents% + \ifnumgreater{\figurecount}{0}{\listoffigures}{}% + \ifnumgreater{\tablecount}{0}{\listoftables}{}% +} + |