diff --git a/layout.sty b/layout.sty index c25814b472114a6684b8714eb106b28beeb0d046..e4911cab4bc7f09572fce2eb80ce9ee1e54f1930 100644 --- a/layout.sty +++ b/layout.sty @@ -973,6 +973,12 @@ Roll & Result \\ %%%%% Side Quests +\newcommand\declareSQareas[1]{ + \foreach \area in {sq,#1}% + {\startcontents[\area] + \stopcontents[\area]} +} + % the first side quest gets a ticked box in the toc. % the rest get an empty box, so the GM can tick it once it's ready. @@ -998,20 +1004,27 @@ Roll & Result \\ \newcounter{sqNo} \newcommand{\sqName}{} -\newcommand{\sidequest}[1]{% - \renewcommand{\sqName}{#1} +\newcommand{\sidequest}[2][]{% + \stopcontents[sq] + \foreach \area in {#1}% + {\resumecontents[\area]} + %%%%%%%%%%%%% + \renewcommand{\sqName}{#2} \resumecontents[\sqarea] \subsection{\sqName} \stopcontents[\sqarea] \settoggle{firstsq}{true} \setcounter{sqNo}{0} + \foreach \area in {#1}% + {\stopcontents[\area]} + \startcontents[sq] } \newcommand{\sqpart}[3]{ \refstepcounter{sqNo} \resumecontents[#1] \subsubsection[% - \arabic{sqNo} -- % + \hspace{-4em}\arabic{sqNo} -- % \iftoggle{firstsq}{\sqr}{\sqn}% #2 -- #3]% {(#1) #2} @@ -1019,6 +1032,14 @@ Roll & Result \\ \vspace{3em} } +\newcommand\printAllSideQuests[1]{ + \foreach \x in {#1}{ + \center\subsection*{\x} + \printcontents[\x]{l}{2}{\setcounter{tocdepth}{3}} + } + +} + \newcommand\hint[1]{% \iftoggle{examplecharacter}{}% {\small\textcolor{gray}{(#1)}} diff --git a/test.tex b/test.tex index 8e80b945d9416827b08f6fa455c0ef167f9da2a9..37cc04fbd9259dd526785413afc01fba7967ed3e 100644 --- a/test.tex +++ b/test.tex @@ -76,6 +76,44 @@ Roll & Result \\\hline \mainmatter +\chapter{Side Quests} + +\declareSQareas{Slums,Artgate} + +\renewcommand\sqarea{Slums} + +\sidequest{Cleaning Up} + +\sqminitoc + +\begin{multicols}{2} + +\lipsum[2] + +\sqpart{Slums}% AREA +{Noisy Neighbours}% NAME +{who celebrate their new baby all week}% SUMMARY + +\lipsum[3] + +\sqpart{Slums}% AREA +{The Rally}% NAME +{for equal rights for squirrels}% SUMMARY + +\lipsum[3] + +\sqpart{Artgate}% AREA +{The Proposal}% NAME +{Countess Bleachclaw wants a quieter town}% SUMMARY + +\lipsum[3] + +\stopcontents[sq] + +\end{multicols} + +\printAllSideQuests{Slums,Artgate} + \chapter{Stat Blocks} \section{Humanoids}