Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-Template into chapters
  • Loading branch information
Vladar4 committed Jan 17, 2017
2 parents 5bfe640 + 4d657df commit 47b2f4b
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 19 deletions.
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Evan Bergeron

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -4,15 +4,15 @@ This is an attempt at a D&D 5e LaTeX template. The color scheme is close to the

The template compiles with pdflatex.

![Preview](https://github.com/anoderay/DND-5e-LaTeX-Template/raw/master/scrot.png)
![Preview](https://github.com/evanbergeron/DND-5e-LaTeX-Template/raw/master/scrot.png)


### Installation

Just clone the repo. From terminal:

```sh
$ git clone https://github.com/anoderay/DND-5e-LaTeX-Template.git 5e-template
$ git clone https://github.com/evanbergeron/DND-5e-LaTeX-Template.git 5e-template
$ cd 5e-template
$ pdflatex example.tex
```
Expand Down
8 changes: 4 additions & 4 deletions dnd.sty
Expand Up @@ -104,13 +104,13 @@

\fancyfoot[LE]{
\textcolor{uppergold}{\thepage}
\hspace*{0.8cm}
\raisebox{-10pt}{\textcolor{uppergold}{\leftmark}}
\hspace*{0.9cm}
\raisebox{12pt}{\textsc{\textcolor{uppergold}{\nouppercase\leftmark}}}
}

\fancyfoot[RO]{
\raisebox{-10pt}{\textcolor{uppergold}{\rightmark}}
\hspace*{0.8cm}
\raisebox{12pt}{\textsc{\textcolor{uppergold}{\nouppercase\rightmark}}}
\hspace*{1cm}
\textcolor{uppergold}{\thepage}
}

Expand Down
Binary file modified example.pdf
Binary file not shown.
15 changes: 11 additions & 4 deletions example.tex
Expand Up @@ -25,7 +25,12 @@ \subsubsection{Even more fun!}

\newpage % Acts as columbreak because of twocolumn option; for pagebreak use \clearpage

\begin{dndtable}{XX} % XX defines there will be two columns, add more to get more columns
% For more columns, you can say \begin{dndtable}[your options here}.
% For instance, if you wanted three columns, you could say
% \begin{dndtable}{XXX}. The usual host of tabular parameters are
% aailable as well.
\header{Nice table}
\begin{dndtable}
\textbf{Table head} & \textbf{Table head} \\
Some value & Some value \\
Some value & Some value \\
Expand All @@ -36,8 +41,10 @@ \subsubsection{Even more fun!}
\lipsum[1]
\end{paperbox}

% You can optionally not include the background by saying
% begin{monsterboxnobg}
\begin{monsterbox}{Monster Foo}
\textit{Small metasyntatic variable (golbinoid), neutral evil}\\
\textit{Small metasyntactic variable (goblinoid), neutral evil}\\
\hline
\basics[%
armorclass = 12,
Expand All @@ -46,8 +53,8 @@ \subsubsection{Even more fun!}
]
\hline
\stats[
STR = 12 (+1),
DEX = 14 (+2)
STR = \stat{12}, % This stat command will autocomplete the modifier for you
DEX = \stat{7}
]
\hline
\details[%
Expand Down
51 changes: 42 additions & 9 deletions lib/dndmonster.sty
@@ -1,6 +1,39 @@
% Monster environment sty file
\usepackage{fp}

%new Monterbox
% Macro to print stats with autocomputed modifier
% e.g. \stat{12} prints "12 (+1)"
\newcommand{\stat}[1]{%
\FPeval{\mod}{(#1 - 10)/2}%
\FPifpos\mod%
\FPeval{\mod}{clip(trunc(mod,0))}#1 (+\mod)%
\else%
\FPeval{\mod}{clip(trunc(mod-0.5,0))}#1 (\mod)%
\fi%
}

% Monster box made to look like the Monster Manual NPC definitions
\newtcolorbox{monsterboxnobg}[2][]{
enhanced,
frame hidden,
before skip=7pt plus2pt,
boxrule=0pt,
breakable,
boxsep=0.25ex,
toptitle=3mm,
left=2.5mm,
right=2.15mm,
arc=0mm,
opacityback=0,
colframe=titlered,
fonttitle=\scshape\bfseries\color{titlered}\Large,
fontupper=\fontfamily{lmss}\selectfont,
title=#2,
after={\vspace{7pt plus 1pt}\noindent},
#1
}

% new Monsterbox
\newtcolorbox{monsterbox}[2][]{
enhanced,
frame hidden,
Expand Down Expand Up @@ -52,20 +85,20 @@
}

% Taubular enviornment for stats-block
\newkeycommand\stats[STR=10 (+0),
DEX=10 (+0),
CON=10 (+0),
INT=10 (+0),
WIS=10 (+0),
CHA=10 (+0)]{
\newkeycommand\stats[STR=\stat{10},
DEX=\stat{10},
CON=\stat{10},
INT=\stat{10},
WIS=\stat{10},
CHA=\stat{10}]{
{\footnotesize
\hspace*{-3.5pt}
\resizebox{0.97\linewidth}{\height}{
\begin{tabularx}{\linewidth}{cccccc}
\begin{tabular}{cccccc}
\rule{0pt}{3.7mm} %adds space between hline and table
\textbf{STR} & \textbf{DEX} & \textbf{CON} & \textbf{INT} & \textbf{WIS} & \textbf{CHA}\\
\commandkey{STR} & \commandkey{DEX} & \commandkey{CON} & \commandkey{INT} & \commandkey{WIS} & \commandkey{CHA}
\end{tabularx}
\end{tabular}
}
\\[0.4em] %adds space after table
}
Expand Down
Binary file modified scrot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 47b2f4b

Please sign in to comment.