diff --git a/config/autocompile.sh b/config/autocompile.sh index f79b03d2760d43ea5c152ccff7053f949c66e1f0..cb580ace3d2ab7dfc8c492274b1adf99a7fc8c22 100755 --- a/config/autocompile.sh +++ b/config/autocompile.sh @@ -8,6 +8,7 @@ [ ! -e main.tex ] && [ -e config/main.tex ] && \ cp config/main.tex . && \ ln -s config/autocompile.sh . && \ + ln -s config/latexmkrc . && \ ln -s config/.gitignore . git gc --auto diff --git a/config/bind.sty b/config/bind.sty index 6bfeaa27c41df07b8d38262432e6dfb28fdd16c8..77f3efe53c8c5a9b6043d1c4d7a8a3b11b2aff91 100644 --- a/config/bind.sty +++ b/config/bind.sty @@ -2,6 +2,9 @@ \RequirePackage{glossaries} \RequirePackage{glossary-mcols} \RequirePackage[latin1]{inputenc} +\RequirePackage{chancery} % fancy fonts +\RequirePackage{gfsartemisia-euler} % fancy fonts +\RequirePackage[T1]{fontenc} % \RequirePackage{stmaryrd} % For boxy Maths symbols \RequirePackage{wasysym} % for circly Maths symbols \RequirePackage{epsdice} % for dice symbols @@ -46,11 +49,29 @@ interior code={ \path[tcb fill interior] ([xshift=-2mm]interior.west) } } +\RequirePackage{xr-hyper} \RequirePackage[ pdfstartpage=2, bookmarks=true]% {hyperref} +%%%%%%%%%% Allow for external referencing + +\newcommand*{\externalReferent}[1]{ + \newtoggle{#1} + \IfFileExists{../#1/main.tex}{ + \makeatletter + \@addtofilelist{../#1/main.tex} + \@addtofilelist{../#1/main.aux}% + \makeatother + \externaldocument{../#1/main}% + \settoggle{#1}{true} + }% + {\typeout{No file #1.} + \settoggle{#1}{false} + } +} + %%%%%%%%%% Section Headers %%%%%%%%%% @@ -90,8 +111,8 @@ bookmarks=true]% \newcommand{\chapnumfont}{ - \fontsize{144}{0} - \selectfont + \fontsize{40}{0} + \selectfont } % change bullet points @@ -127,23 +148,26 @@ bookmarks=true]% \colorlet{chapnumcol}{black!55} +\newcommand{\FancyFont}{} +\newcommand{\fancyfont}{} + \titleformat{\chapter}[display] {\bfseries} {\begin{tikzpicture} \node[minimum width=\textwidth, text=black!25, fill=black!25, inner sep=1, outer sep=0, anchor=south] (rectinit) {\huge CHAPTER}; - \node[minimum width=.8\textwidth, text=white, inner sep=1, outer sep=0, anchor=south west, text width=.8\textwidth, align=right] at (rectinit.south west) (chapname) {\huge \headingtype~~}; - \node[minimum width=.2\textwidth, inner sep=0, outer sep=0, anchor=south west, text width=.2\textwidth, align=left] at (chapname.south east) {\chapnumfont\textcolor{chapnumcol}{\thechapter}}; + \node[minimum width=.8\textwidth, text=white, inner sep=1, outer sep=0, anchor=south west, text width=.8\textwidth, align=right] at (rectinit.south west) (chapname) {\FancyFont\headingtype~~}; + \node[minimum width=.2\textwidth, inner sep=0, outer sep=0, anchor=south west, text width=.2\textwidth, align=left] at (chapname.south east) {\chapnumfont\textcolor{chapnumcol}{\Roman{chapter}}}; \end{tikzpicture}} {0pt} -{\Huge} +{\Huge\FancyFont} \titleformat{\section}[frame] {\needspace{20em}\normalfont} {\filright \footnotesize -\enspace SECTION \thesection\enspace} +\enspace \fancyfont SECTION \thesection\enspace} {8pt} -{\Large\bfseries\filcenter} +{\Large\bfseries\filcenter\fancyfont} \titleformat{\subsection}{\needspace{10em}\center\large\bfseries}{}{1em}{}[\rule{.9\linewidth}{.2pt}] % diff --git a/config/example.tex b/config/example.tex index 3cddbf40934e922633d585440c3dc25b8396193d..770db885adb973a66726aaf0ff04475bbf36f1e8 100644 --- a/config/example.tex +++ b/config/example.tex @@ -1,6 +1,7 @@ \documentclass[a4paper,openany]{book} \usepackage{bind} \usepackage{monsters} +\usepackage{lipsum} \date{\today} @@ -8,11 +9,15 @@ \chapter{How to Make Monsters} +\section{Introduction} + \begin{multicols}{2} +\subsection{All about Dragons} + \begin{boxtext} -As you embark upon your first adventure, you summon your first monster with a simple backstroke. You write down {\tt \textbackslash dragon}, and behold! +As you embark upon your first adventure, you summon your first monster with a simple backstroke. You write down {\tt {\tt\textbackslash dragon}}, and behold! \end{boxtext} @@ -23,17 +28,25 @@ The next one might look like this: \dragon -If you find it hard to tell the difference between all the dragons, you can give them names in square brackets with the \textbackslash npc command, like this: +If you find it hard to tell the difference between all the dragons, you can give them names in square brackets with the {\tt\textbackslash NPC command}, like this: -\textbackslash dragon[\textbackslash npc\{\textbackslash M\}\{Bob the dragon\}] +{\tt\textbackslash dragon[\textbackslash npc\{\textbackslash M\}\{Bob the dragon\}] } Which then makes a male dragon called ``Bob'': \dragon[\npc{\M}{Bob the Dragon}] -The first field can also indicate a female with an \textbackslash F (\F), a team of people with a \textbackslash T (\T), or undead with \textbackslash D (\D). +The first field can also indicate a female with an {\tt\textbackslash F} (\F), a team of people with a {\tt\textbackslash T} (\T), or undead with \textbackslash D (\D). + +With a little study, you can summon dozens of monsters, including {\tt\textbackslash human fighter}, {\tt\textbackslash basilisk}, and {\tt \textbackslash ghoul}. + +\subsection{Random Text} + +\lipsum[7] -With a little study, you can summon dozens of monsters, including \textbackslash human fighter, \textbackslash basilisk, and \textbackslash ghoul. +\subsection{And further more\ldots} + +\lipsum[10] \end{multicols} @@ -155,8 +168,12 @@ With a little study, you can summon dozens of monsters, including \textbackslash \nurawolf +\end{multicols} + \chapter{Outsiders} +\begin{multicols}{2} + \archmage \archmage @@ -301,4 +318,14 @@ When using a bestiary chapter, the stats appear as dice rolls, rather than fixed \settoggle{bestiarychapter}{false} +\chapter{Lots of Text} + +\begin{multicols}{2} + +\noindent +\lipsum + + +\end{multicols} + \end{document} diff --git a/config/latexmkrc b/config/latexmkrc new file mode 100644 index 0000000000000000000000000000000000000000..755cb5d1b1fc64645a6b0f6ea7fb1beae0eba21a --- /dev/null +++ b/config/latexmkrc @@ -0,0 +1,8 @@ +add_cus_dep( 'tex', 'aux', 0, 'makeexternaldocument' ); + +sub makeexternaldocument { + if (!($root_filename eq $_[0])) + { + system( "latexmk -cd -pdf \"$_[0]\"" ); + } +} diff --git a/config/monsters.sty b/config/monsters.sty index bedfd7d9517636702a1de856187ab7244f776ea1..7c8a8777f85cd594d8e896b159fe9dadf50f23c5 100644 --- a/config/monsters.sty +++ b/config/monsters.sty @@ -298,7 +298,7 @@ \renewcommand{\armourtype}{P} \gdef\armourtype{P} -\begin{tcolorbox}[title={\name},watermark text=\npcsymbol] +\begin{tcolorbox}[title={\name},left=2mm,watermark text=\npcsymbol] \iftoggle{personality}{