Newer
Older
\RequirePackage{xr-hyper}
\RequirePackage[
pdfstartpage=1,
hidelinks=true,
bookmarks=true]%
{hyperref}
stylemods={mcols,topic,tree},
\RequirePackage{starfont} % for creature symbols
\RequirePackage{wasysym} % for sq checkboxes
\RequirePackage{appendix}
\RequirePackage{geometry} % changes page borders
\RequirePackage{tabularx}
\RequirePackage{wrapfig}
\RequirePackage{float}
\RequirePackage{epigraph} % part quotes
\RequirePackage{microtype} % more precise word-placement
\RequirePackage{makeidx}
\RequirePackage[english]{babel}
\RequirePackage{multicol}
\RequirePackage{graphicx}
\RequirePackage{etoolbox}
\RequirePackage[explicit]{titlesec}
\RequirePackage{titletoc}
\RequirePackage{adforn}% for fancy headrules
\usetikzlibrary{calc,mindmap,trees}% calc for fancy borders
\usetikzlibrary{intersections}% for very fancy borders with intersecting lines
\usetikzlibrary{decorations.text}% for text along circle paths in cs
\usetikzlibrary{shapes.callouts}% for labels on the cs
\usetikzlibrary{shapes.geometric, intersections}% for pentacle intersections in map
\usetikzlibrary{patterns}% for the pattern 'gridspecks'
\RequirePackage{colortbl}
\RequirePackage[poster]{tcolorbox}
\pgfdeclarepatternformonly{gridspecks}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{1pt}{1pt}}{\pgfqpoint{26pt}{26pt}}
{%
\pgfpathcircle{\pgfqpoint{0pt}{0pt}}{.5pt}%
\pgfusepath{fill}%
}%
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
%%%%% Common Commands %%%%%
% make repeating function
\newcommand{\Repeat}[1]{%
\expandafter\@Repeat\expandafter{\the\numexpr #1\relax}%
}
\def\@Repeat#1{%
\ifnum#1>0
\expandafter\@@Repeat\expandafter{\the\numexpr #1-1\expandafter\relax\expandafter}%
\else
\expandafter\@gobble
\fi
}
\def\@@Repeat#1#2{%
\@Repeat{#1}{#2}#2%
}
% This allows us to compare two strings. What other wonders will LaTeX bring in the future? Perhaps subtraction syntax one day.
\ExplSyntaxOn
\NewExpandableDocumentCommand{\ifStrSame}{mmmm}
{
\str_if_eq:eeTF { #1 } { #2 } { #3 } { #4 }
}
\ExplSyntaxOff
% This function divides a number by two, and rounds it up.
\newcommand\roundUp[1]{%
\ifodd\value{#1}%
\stepcounter{#1}%
\fi%
\divide\value{#1} by 2%
\addtocounter{#1}{0}% Think this line's pointless? Try removing it and seeing what happens - I dare you.
}
\newcounter{chapshift}
\addtocounter{chapshift}{-1}
\vspace{-6pt}%
\textcolor{\pageSideColor}{\hrulefill}%
\raisebox{-2.1pt}%
{\textcolor{\pageSideColor}{\quad\adfdoubleflourishleft\npcsymbol\adfdoubleflourishright\quad}}%
%% Redefine plain page style, and use it for every page.
\fancypagestyle{plain}{
\fancyhf{}% clear all header and footer fields
\fancyfoot[LE]{\hspace{-2em}\titleFont{\large\thepage\if@mainmatter\randomfourB\hspace{1em}\textcolor{\pageSideColor}{\Repeat{\value{r4b}}{\flourish\hspace{-.2em}}}\fi}}
\fancyfoot[RO]{\hspace{-2em}\titleFont{\randomfour\large\if@mainmatter\textcolor{\pageSideColor}{\Repeat{\value{r4}}{\flourish\hspace{-.2em}}}\hspace{1em}\fi\thepage}}
}
\pagestyle{plain}
%\fancyfoot{}
\newcounter{pageDarkness}
\setcounter{pageDarkness}{20}
\newcounter{pageAlt}
\setcounter{pageAlt}{100}
\newcommand\pageSideColor{black!\arabic{pageDarkness}!white}
\newcommand\pageOppositeColor{black!\arabic{pageAlt}}
\newtoggle{countedPage}
\toggletrue{countedPage}
\ifnum\value{chapter}<14
\pgfmathsetmacro{\BGvadjust}{ -2 * (\value{chapter} - 1)}
\else
\pgfmathsetmacro{\BGvadjust}{ -1 * (\value{chapter} - 1)}
\fi
\ifodd\value{page}
\def\BGpageanchor{current page.north east}
\def\BGanchor{north west}
\def\BGmark{\textcolor{\pageOppositeColor}{\rightmark}}
\def\BGrotate{-90}
\else
\def\BGpageanchor{current page.north west}
\def\BGanchor{north east}
\def\BGmark{\textcolor{\pageOppositeColor}{\leftmark}}
\def\BGrotate{90}
\fi\typeout{Underfed goblins (badness \thepage0000)}
\begin{tikzpicture}[overlay,remember picture]
\path
++(\BGpageanchor)
+(0cm, \BGvadjust cm)
node[
text centered,
inner sep=4pt,
text height=4ex,
text depth=2.5ex,
text width=14em,
text=white,
fill=\pageSideColor,
anchor=\BGanchor,
rotate=\BGrotate,
font=\titleFont,
] {\BGmark};
\end{tikzpicture}%
\fi
}{}
% redefinition of \chaptermark to contain only the number and title (no 'Chapter 1: Pogs', just '1: Pogs')
\renewcommand\chaptermark[1]{\markboth{\thechapter.~#1}{}}
\newcommand\flwr{\textcolor{\pageSideColor}{\ifodd\thepage\adfflowerright\else\adfflowerleft\fi}}
\newcommand\failStar{\textcolor{\pageSideColor}{\Fortune}}
%%%%%%%%%% Allow for external referencing
\newcommand*{\externalReferent}[1]{
\IfFileExists{../rubbish/#1.aux}{
\externaldocument{../rubbish/#1}%
Loading
Loading full blame...