I'm trying to replicate DND 4e style creature stat blocks. The plan is first to get something working, then to condense it into a package, then to write a small web-script to generate the latex for stat blocks.

I've been attempting to use fixed width tabular cells for alignment based on the line-width of the page, but this seems to give me some interesting output when cell color is added.

A minimal example of the problem is presented here: enter image description here

There are two issues that I need to fix. The first is the spacing between each cell (both horizontal and vertical), and the second is the stubbed width of certain lines.

The complete code used to generate the stat block is here:

What seems particularly odd here is that a single cell of 0.9*linewidth is nowhere near the length of a (0.6 + 0.3)*linewidth pair. If there's any difference, one would expect it to be in the order of the tab spacing, but it's nowhere close.

Ideally, a package designed for dealing with this issue would be nice (is this an appropriate use for tabu?), but I'll be happy with any solution or suggestion that works. The plan is to hide most of the messy bits in command definitions anyway.


1 Answer 1


I managed to do this in a rather hacky way by dunking individual sections of the table into colorboxes (eliminates the backing lines).

Additionally, the full width multicol instances needed to have increased length, presumably to make up for some sort of cell padding.

enter image description here

What I have is actually a terrible solution, which is barely made (generally) usable through ~50 lines of definitions, and still requires manual tuning of some numbers. If anyone can produce a better result, I'll mark you as the answer.

Full code



%%Define colors. Precise color does not matter, 
\definecolor{dtangreen}{rgb}{0.80, 0.85, 0.65}
\definecolor{tangreen}{rgb}{0.92, 0.95, 0.8}

%%commands for setting the colors of cells and text

\newcommand{\tHead}{\green \whiteText}

%%left aligned wide cell
%%left aligned and right wide cell
\newcommand{\lrcell}[2]{\multicolumn{2}{L{0.60\linewidth}}{#1} & \multicolumn{1}{R{0.30\linewidth}}{#2}}
%%left aligned and left wide cell
\newcommand{\llwcell}[2]{\multicolumn{1}{L{0.30\linewidth}}{#1} & \multicolumn{2}{L{0.60\linewidth}}{#2}}
%%3x left aligned cells
\newcommand{\lllcell}[3]{\multicolumn{1}{L{0.30\linewidth}}{#1} & \multicolumn{1}{L{0.30\linewidth}}{#2} & #3}

%%creature stat rows:
\newcommand{\statrowA}[3]{\lllcell{\textbf{Str} #1}{\textbf{Dex} #2}{\textbf{Wis} #3}}
\newcommand{\statrowB}[3]{\lllcell{\textbf{Con} #1}{\textbf{Int} #2}{\textbf{Cha} #3}}

%%function for putting tables in colored boxes (hacky). Needs a reverse indent set.
\newcommand{\boxtab}[2]{\vspace{\boxtablen} \noindent \colorbox{#1}{\begin{tabular}{lll} #2 \end{tabular}}}

%%creature equipment block:
\newcommand{\equipblock}[1]{\boxtab{tangreen}{\lwcell{\lCell \textbf{Equipment} #1}}}

%Single attack for a creature. Use: (attack name/type) (attack properties)
\newcommand{\creatureattackblock}[2]{\boxtab{dtangreen}{\lwcell{\dCell #1}} \par \boxtab{tangreen}{\lwcell{\lCell \hangpara{0.30cm}{0}#2}}}

Another approach: Try to put everything inside of boxes!

\lrcell{\tHead \textbf{Angel of Valor Cohort}}{\tHead \textbf{Level 8 Soldier}}\\
\lrcell{\tHead \small Medium immortal humanoid (angel)}{\tHead \textbf{XP 350}}\\

\llwcell{\lCell \textbf{Initiative} +9}{\lCell \textbf{Senses} Perception +7}\\
\lwcell{\lCell \textbf{HP} 1; a missed attack never damages a minion.}\\
\lwcell{\lCell \textbf{Immune} fear; \textbf{Resist} 10 fire, 10 radiant}\\
\lwcell{\lCell \textbf{Speed} 6, fly 9 (hover)}\\

%TODO: rip those icons from the DND books, or find replacement ones!
\creatureattackblock{\textbf{$\bullet$ Slam} (standard; at-will)}{+13 vs. AC; 1d8 + 6 damage}

\boxtab{dtangreen} {
\llwcell{\dCell \textbf{Alignment} Any}{\dCell \textbf{Languages} Common, Goblin}\\
\statrowA{18 (+7)}{18 (+7)}{14 (+5)}\\
\statrowB{16 (+6)}{10 (+3)}{10 (+3)}\\

\equipblock{leather armor, morningstar, rope garrote}

One additional thing that may be required is removing paragraph spacing, ie { \parskip 0pt (content) }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .