Browse Source

Refactor common code into prelude

Getty Ritter 5 years ago
parent
commit
212e8402dc
2 changed files with 147 additions and 134 deletions
  1. 38 134
      bard.tex
  2. 109 0
      prelude.tex

+ 38 - 134
bard.tex

@@ -1,75 +1,6 @@
 \documentclass[8pt]{extarticle}
-\usepackage{color}
-\usepackage{lmodern}
-\usepackage{amssymb,amsmath}
-\usepackage{ifxetex,ifluatex}
-\usepackage{anyfontsize}
-\usepackage[percent]{overpic}
-\usepackage[margin=0.5in]{geometry}
-\usepackage{multicol}
-\setlength{\columnsep}{0.05cm}
-\usepackage[T1]{fontenc}
-\usepackage[utf8]{inputenc}
-\usepackage{fontspec} % For loading fonts
-\usepackage{titlesec}
-\setmainfont{PT Serif}
-\newfontfamily\headingfont[]{Metamorphous}
-\titleformat*{\section}{\LARGE\headingfont}
-\titleformat*{\subsection}{\Large\headingfont}
-
-\newenvironment{amove}[1]
-{\Checkbox{6pt}\ {\headingfont #1}\begin{quote}
-}
-{\end{quote}
-}
-
-\pagestyle{empty}
-\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
-% use microtype if available
-\IfFileExists{microtype.sty}{%
-\usepackage[]{microtype}
-\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
-}{}
-\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
-
-\makeatother
-% Scale images if necessary, so that they will not overflow the page
-% margins by default, and it is still possible to overwrite the defaults
-% using explicit options in \includegraphics[width, height, ...]{}
-\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
-\IfFileExists{parskip.sty}{%
-\usepackage{parskip}
-}{% else
-\setlength{\parindent}{0pt}
-\setlength{\parskip}{6pt plus 2pt minus 1pt}
-}
-\setlength{\emergencystretch}{3em}  % prevent overfull lines
-\providecommand{\tightlist}{%
-  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
-\setcounter{secnumdepth}{0}
-% Redefines (sub)paragraphs to behave more like sections
-\ifx\paragraph\undefined\else
-\let\oldparagraph\paragraph
-\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
-\fi
-\ifx\subparagraph\undefined\else
-\let\oldsubparagraph\subparagraph
-\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
-\fi
-
-% set default figure placement to htbp
-\makeatletter
-\def\fps@figure{htbp}
-\makeatother
-
-
-\date{}
-
-\usepackage{etoolbox}
-\patchcmd{\quote}{\rightmargin}{\leftmargin 1em \rightmargin}{}{}
-
-\usepackage{tikz}
-\newcommand{\Checkbox}[1]{\tikz{\path[draw=black] (0,0) rectangle (#1,#1);}}
+
+\input{prelude.tex}
 
 % Modify this commands to define Class name, Base HP, Base Load and Damage Dice (only number)
 \newcommand{\Class}{Bard}
@@ -77,55 +8,43 @@
 \newcommand{\BaseLoad}{9}
 \newcommand{\Damage}{6}
 
-% Don't replace here, replace before every section
-\newcommand{\SectionTitle}{4}
-
-
-
 
 \begin{document}
 \openup -0.3em
 
 \input{figuras/TopBanner}
-%\input{figuras/TopBanner10Plus} %Use this instead when damage dice has 10 or more faces
 
 \begin{multicols}{2}
-\renewcommand{\SectionTitle}{\headingfont Folk}
-\input{figuras/LeftBanner}
+  \leftbanner{Folk}
 
 
-\Checkbox{6pt} \textbf{Elf}
-\begin{quote}
+\begin{amove}{Elf}
 When you enter an important location (your call) you can ask the GM for one fact from the history of that location.
-\end{quote}
+\end{amove}
 
-\Checkbox{6pt} \textbf{Human}
-\begin{quote}
+\begin{amove}{Human}
   When you first enter a civilized settlement someone who respects the custom of hospitality to minstrels will take you in as their guest.
-\end{quote}
+\end{amove}
 
-\Checkbox{6pt} \textbf{Rihamm}
-\begin{quote}
+\begin{amove}{Rihamm}
   When you speak frankly and openly with someone, ask them two questions instead of one.
-\end{quote}
+\end{amove}
 
 \ 
 
-\renewcommand{\SectionTitle}{\headingfont Alignment}
-\input{figuras/LeftBanner}
-
+\leftbanner{Alignment}
 
-\Checkbox{6pt} \textbf{Good}
+\choice \textbf{Good}
 \begin{quote}
 Perform your art to aid someone else.
 \end{quote}
 
-\Checkbox{6pt} \textbf{Neutral}
+\choice \textbf{Neutral}
 \begin{quote}
 Avoid a conflict or defuse a tense situation.
 \end{quote}
 
-\Checkbox{6pt} \textbf{Chaotic}
+\choice \textbf{Chaotic}
 \begin{quote}
 Spur others to significant and unplanned decisive action.
 \end{quote}
@@ -133,8 +52,7 @@ Spur others to significant and unplanned decisive action.
 
 \ 
 
-\renewcommand{\SectionTitle}{\headingfont Bonds}
-\input{figuras/LeftBanner}
+\leftbanner{Bonds}
 
 \begin{quote}
 \textbf{V:}\enspace\hrulefill
@@ -163,8 +81,7 @@ Spur others to significant and unplanned decisive action.
 \columnbreak
 
 
-\renewcommand{\SectionTitle}{\headingfont Starting Moves}
-\input{figuras/RightBanner}
+\rightbanner{Starting Moves}
 
 \begin{quote}
 {\headingfont Arcane Art}
@@ -187,10 +104,7 @@ Then roll +CHA.
 \end{quote}
 \end{quote}
 
-\begin{quote}
-  {\headingfont Bardic Lore}
-  \begin{quote}
-
+\begin{basicmove}{Bardic Lore}
 Choose an area of expertise:
 
 • Spells and Magicks
@@ -208,13 +122,9 @@ Choose an area of expertise:
 • Gods and Their Servants
 
 When you \textbf{first encounter an important creature, location, or item (your call) covered by your bardic lore} you can ask the GM any one question about it; the GM will answer truthfully. The GM may then ask you what tale, song, or legend you heard that information in.
-\end{quote}
-\end{quote}
+\end{basicmove}
 
-\begin{quote}
-{\headingfont Charming and Open}
-
-\begin{quote}
+\begin{basicmove}{Charming and Open}
 When you \textbf{speak frankly with someone}, you can ask their player a question from the list below. They must answer it truthfully, then they may ask you a question from the list (which you must answer truthfully).
 
 • Whom do you serve?
@@ -226,40 +136,36 @@ When you \textbf{speak frankly with someone}, you can ask their player a questio
 • What are you really feeling right now?
 
 • What do you most desire?
-\end{quote}\end{quote}
+\end{basicmove}
 
-\begin{quote}
-  {\headingfont A Port in the Storm}
-  \begin{quote}
+\begin{basicmove}{A Port in the Storm}
     When you \textbf{arrive at a civilized settlement spoken of in
       lore or song}, tell the GM something you've heard about the
     place. They’ll tell you how it’s changed since the Shattering.
-  \end{quote}
-\end{quote}
+\end{basicmove}
 
 \vfill\null
 \end{multicols}
 \clearpage
 
-\renewcommand{\SectionTitle}{\headingfont Gear}
-\input{figuras/RightBannerEquipment}
+\gearbanner
 
 \begin{multicols}{2}
 
 \begin{quote}
   Your load is 9+Str. You have dungeon rations (5 uses, 1 weight). Choose one instrument, all are 0 weight for you:
 
-  \Checkbox{6pt} Your father’s mandolin, repaired
+  \choice Your father’s mandolin, repaired
 
-  \Checkbox{6pt} A fine lute, a gift from a noble
+  \choice A fine lute, a gift from a noble
 
-  \Checkbox{6pt} The pipes with which you courted your first love
+  \choice The pipes with which you courted your first love
 
-  \Checkbox{6pt} A stolen horn
+  \choice A stolen horn
 
-  \Checkbox{6pt} A fiddle, never before played
+  \choice A fiddle, never before played
 
-  \Checkbox{6pt} A songbook in a forgotten tongue
+  \choice A songbook in a forgotten tongue
 
 \end{quote}
 
@@ -269,26 +175,26 @@ When you \textbf{speak frankly with someone}, you can ask their player a questio
 \begin{quote}
   Choose your clothing:
 
-  \Checkbox{6pt} Leather armor (1 armor, 1 weight)
+  \choice Leather armor (1 armor, 1 weight)
 
-  \Checkbox{6pt} Ostentatious clothes (0 weight)
+  \choice Ostentatious clothes (0 weight)
 
   Choose your armament:
 
-  \Checkbox{6pt} Dueling rapier (close, precise, 2 weight)
+  \choice Dueling rapier (close, precise, 2 weight)
 
-  \Checkbox{6pt} Worn bow (near, 2 weight), bundle of arrows (3 ammo,
+  \choice Worn bow (near, 2 weight), bundle of arrows (3 ammo,
   1 weight), and short sword (close, 1 weight)
 
   Choose one:
 
-  \Checkbox{6pt} Adventuring gear (1 weight)
+  \choice Adventuring gear (1 weight)
 
-  \Checkbox{6pt} Bandages (0 weight)
+  \choice Bandages (0 weight)
 
-  \Checkbox{6pt} Halfling pipeleaf (0 weight)
+  \choice Halfling pipeleaf (0 weight)
 
-  \Checkbox{6pt} 3 coins
+  \choice 3 coins
 
 
 \end{quote}
@@ -296,8 +202,7 @@ When you \textbf{speak frankly with someone}, you can ask their player a questio
 \end{multicols}
 
 \begin{multicols}{2}
-\renewcommand{\SectionTitle}{\headingfont Advanced Moves (2-5)}
-\input{figuras/LeftBanner}
+\leftbanner{Advanced Moves (2-5)}
 
 When you \textbf{gain a level from 2--5}, choose from these moves.
 
@@ -369,8 +274,7 @@ When you parley with someone, on a 7+ you also take +1 forward with them.
 \vfill\null
 \columnbreak
 
-\renewcommand{\SectionTitle}{\headingfont Advanced Moves (6-10)}
-\input{figuras/RightBanner}
+\rightbanner{Advanced Moves (6-10)}
 
 When you \textbf{gain a level from 6--10}, choose from these moves or
 the level 2--5 moves.

+ 109 - 0
prelude.tex

@@ -0,0 +1,109 @@
+\usepackage{color}
+\usepackage{lmodern}
+\usepackage{amssymb,amsmath}
+\usepackage{ifxetex,ifluatex}
+\usepackage{anyfontsize}
+\usepackage[percent]{overpic}
+\usepackage[margin=0.5in]{geometry}
+\usepackage{multicol}
+\setlength{\columnsep}{0.05cm}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage{fontspec} % For loading fonts
+\usepackage{titlesec}
+\setmainfont{PT Serif}
+\newfontfamily\headingfont[]{Metamorphous}
+\titleformat*{\section}{\LARGE\headingfont}
+\titleformat*{\subsection}{\Large\headingfont}
+
+\newenvironment{amove}[1]
+{\Checkbox{6pt}\ {\headingfont #1}\begin{quote}
+}
+{\end{quote}
+}
+
+\newenvironment{basicmove}[1]
+{\begin{quote}{\headingfont #1}\begin{quote}
+}
+{\end{quote}\end{quote}
+}
+
+\newenvironment{choices}[1]
+{#1
+
+  \begin{quote}
+}
+{\end{quote}
+}
+
+\newcommand{\choice}{\Checkbox{6pt} }
+
+\pagestyle{empty}
+\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
+% use microtype if available
+\IfFileExists{microtype.sty}{%
+\usepackage[]{microtype}
+\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
+}{}
+\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
+
+\makeatother
+% Scale images if necessary, so that they will not overflow the page
+% margins by default, and it is still possible to overwrite the defaults
+% using explicit options in \includegraphics[width, height, ...]{}
+\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
+\IfFileExists{parskip.sty}{%
+\usepackage{parskip}
+}{% else
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{6pt plus 2pt minus 1pt}
+}
+\setlength{\emergencystretch}{3em}  % prevent overfull lines
+\providecommand{\tightlist}{%
+  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
+\setcounter{secnumdepth}{0}
+% Redefines (sub)paragraphs to behave more like sections
+\ifx\paragraph\undefined\else
+\let\oldparagraph\paragraph
+\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
+\fi
+\ifx\subparagraph\undefined\else
+\let\oldsubparagraph\subparagraph
+\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
+\fi
+
+% set default figure placement to htbp
+\makeatletter
+\def\fps@figure{htbp}
+\makeatother
+
+
+\date{}
+
+\usepackage{etoolbox}
+\patchcmd{\quote}{\rightmargin}{\leftmargin 1em \rightmargin}{}{}
+
+\usepackage{tikz}
+\newcommand{\Checkbox}[1]{\tikz{\path[draw=black] (0,0) rectangle (#1,#1);}}
+
+
+% Don't replace here, replace before every section
+\newcommand{\SectionTitle}{4}
+
+\newcommand{\leftbanner}[1]{
+  \begin{overpic}[width=3.71260in,height=0.40945in]{figuras/templateL.png}
+\put (2,4) {\fontsize{16}{40}\selectfont \textcolor{white}{\headingfont #1}}
+\end{overpic}
+}
+
+\newcommand{\rightbanner}[1]{
+  \begin{overpic}[width=3.71260in,height=0.40945in]{figuras/templateR.png}
+\put (5,4) {\fontsize{16}{40}\selectfont \textcolor{white}{\headingfont #1}}
+\end{overpic}
+}
+
+\newcommand{\gearbanner}{
+\begin{overpic}[width=7.47986in,height=0.40945in]{figuras/templateEquip.png}
+\put (3,2) {\fontsize{16}{40}\selectfont \textcolor{white}{\headingfont Gear}}
+\end{overpic}
+}