Created
March 25, 2021 21:17
-
-
Save jtpaasch/4c0f4a905f8dcf18ffa497be3c2c4835 to your computer and use it in GitHub Desktop.
A latex class for books
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % ---------------------------------------------------------- | |
| % Custom document class | |
| % | |
| % Name: toyl | |
| % Author: JT Paasch | |
| % ---------------------------------------------------------- | |
| \NeedsTeXFormat{LaTeX2e} | |
| \ProvidesClass{bizboy}[2021/03/01 v.1 A demo LaTeX document class] | |
| % Base this on the book class. | |
| % Put equation numbers on the left rather than the right. | |
| \LoadClass[leqno]{book} | |
| % Ragged right | |
| % \RequirePackage{ragged2e} | |
| % \setlength{\RaggedRightParindent}{\parindent} | |
| % Font styling | |
| \RequirePackage{lettrine} | |
| % \RequirePackage{lmodern} | |
| % \RequirePackage{tgschola} | |
| % \RequirePackage{fourier} | |
| \RequirePackage{palatino} | |
| % ---------------------------------------------------------- | |
| % Layout | |
| % ---------------------------------------------------------- | |
| \renewcommand{\normalsize}{\fontsize{13}{15}\selectfont} | |
| \pagenumbering{arabic} | |
| \RequirePackage[ | |
| letterpaper, | |
| twoside, | |
| headheight=24pt, | |
| headsep=24pt, | |
| footskip=60pt, | |
| textwidth=348pt, | |
| lmargin=48pt, | |
| marginparwidth=172pt, | |
| marginparsep=12pt, | |
| includehead,includemp]{geometry} | |
| \setlength{\skip\footins}{18pt} | |
| % ---------------------------------------------------------- | |
| % Page styles | |
| % ---------------------------------------------------------- | |
| \RequirePackage{fancyhdr} | |
| \pagestyle{fancy} | |
| \fancyhead{} | |
| \fancyhead[RO,LE]{\normalfont\leftmark} | |
| \fancyfoot{} | |
| \fancyfoot[C]{\thepage} | |
| \renewcommand\headrulewidth{2pt} | |
| \RequirePackage{emptypage} | |
| % ---------------------------------------------------------- | |
| % Custom commmands | |
| % ---------------------------------------------------------- | |
| \newcommand\emrule{\noindent\rule[0pt]{\linewidth}{1em}} | |
| \newcommand{\highlight}[1]{\textbf{#1}} | |
| \newcommand{\newthought}[1]{\noindent\textsc{#1}} | |
| \newcommand{\newtopic}[2]{\lettrine{#1}{#2}} | |
| \newcommand{\blank}{\underline{\hspace{1cm}}} | |
| % ---------------------------------------------------------- | |
| % Title | |
| % ---------------------------------------------------------- | |
| \renewcommand{\maketitle}{ | |
| \pagestyle{empty} | |
| \newgeometry{top=1in,left=1.25in,bottom=1in,right=1.25in} | |
| \makeatletter\CROP@center\makeatother | |
| \begin{center} | |
| \vspace*{72pt} | |
| \hrule | |
| \vskip 24pt | |
| {\Large \bfseries \@title} | |
| \vskip 36pt | |
| {\large \@author} | |
| \vskip 24pt | |
| \emrule | |
| \vfill | |
| Rough Draft - Last compiled \today | |
| \end{center} | |
| \restoregeometry | |
| \makeatletter\CROP@center\makeatother | |
| \pagestyle{fancy} | |
| } | |
| % ---------------------------------------------------------- | |
| % Parts, Chapters, Sections | |
| % ---------------------------------------------------------- | |
| \RequirePackage{titlesec} | |
| % For the part headings. | |
| \renewcommand{\thepart}{\arabic{part}} | |
| \titleformat{\part}[display] | |
| {\bfseries\large} | |
| {{\Huge Part [~\thepart~]} \vskip 1em \hrule} | |
| {1em} | |
| {} | |
| \titlespacing*{\part}{0pt}{0pt}{0pt} | |
| % Make a part with some text underneath it. | |
| \newcommand{\partwithtext}[2]{% | |
| \part[#1]{% | |
| \MakeUppercase{#1}% | |
| \vskip 1em% | |
| % \hrule% | |
| \vskip 3em% | |
| {\normalfont #2}% | |
| }% | |
| } | |
| % For numberless chapters, like the TOC. | |
| \titleformat{name=\chapter,numberless}[hang] | |
| {\bfseries\large} | |
| {} | |
| {0pt} | |
| {\MakeUppercase} | |
| % For numbered chapters. | |
| \titleformat{\chapter}[display] | |
| {\bfseries\large} | |
| {\Huge [~\thechapter~]} | |
| {1em} | |
| {\MakeUppercase} | |
| \titlespacing*{\chapter}{0pt}{4em}{12em} | |
| % For numbered sections. | |
| \titleformat{\section}[hang] | |
| {\bfseries} | |
| {\thesection} | |
| {1em} | |
| {} | |
| [\dotfill] | |
| \titlespacing*{\section}{0pt}{24pt}{18pt} | |
| % ---------------------------------------------------------- | |
| % TOC | |
| % ---------------------------------------------------------- | |
| \RequirePackage{titletoc} | |
| \RequirePackage[nottoc]{tocbibind} | |
| \titlecontents{part}[0pt] | |
| {} | |
| {} | |
| {\vskip 0.5em \bfseries Part } | |
| {\titlerule*{}\contentspage} | |
| [\vskip 0.5em \hrule \vskip 0.5em] | |
| \dottedcontents{chapter}[2em] | |
| {\vskip 1em \bfseries} | |
| {2em} | |
| {1pc} | |
| \dottedcontents{section}[4em] | |
| {} | |
| {2em} | |
| {1pc} | |
| % ---------------------------------------------------------- | |
| % Footnotes, margin notes, etc | |
| % ---------------------------------------------------------- | |
| % Use the manyfoot package to create footnote streams | |
| \RequirePackage[para]{manyfoot} | |
| \DeclareNewFootnote[para]{Alpha}[alph] | |
| % For margin notes | |
| \RequirePackage{sidenotes} | |
| \RequirePackage{marginfix} | |
| % Shortcut for a floating aside. | |
| \newenvironment{aside} | |
| {\begin{marginfigure} \raggedright \fontsize{11}{13}\selectfont} | |
| {\vskip 1em \end{marginfigure}} | |
| % ---------------------------------------------------------- | |
| % Showing camera ready crop marks | |
| % ---------------------------------------------------------- | |
| \RequirePackage[cross,a3,center]{crop} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment