I'm going to start writing my D&D (Dungeons and Dragons) campaigns in latex because I'm more comfortable with it than Microsoft Word. I also want to use biblatex to make references for monsters used throughout, like this:

@monster{ skeleton,
    name = {Skeleton},
    size = {medium},
    alignment = {lawful evil},
    ac = {13},
    hp = {13 (2d8+4)},
    speed = {30ft},
    blah blah blah...

So that I could say Something something skeleton\cite{skeleton} and click on citation to quickly see a stat block. Yes I am a genius.

Is there a way to put something in some files somewhere so that would enable latex to understand what I'm trying to do?


Rather than biblatex, perhaps you want the glossaries package.





    name = Skeleton,
    description = {size: medium,\\
    alignment: lawful evil,
    ac: 13,
    hp: 13 (2d8+4),
    speed: 30ft}
    name = King Knuth,
    description = {Ruler of the realm},
    type = npc


A \gls{monster:skeleton} attacks \gls{npc:king}



enter image description here


It is possible to do this with biblatex (people have done all sorts already: https://www.tug.org/TUGboat/tb35-3/tb111fischer.pdf), but this might not be the most comfortable way to deal with this. biblatex offers a lot of things you won't need and it might be complicated to redefine and opt out of certain things you don't want and get the things you'd like to have instead. In particular it could be painful to obtain a tabular stats block.

There are other tools that can read in data and display it according to your wishes. datatool comes to mind, but Lua (of LuaLaTeX fame) could also offer you some possibilities.

Have a look at How can I create entirely new data types with BibLaTeX/Biber? for the details of defining a new entry type and its driver.

  name      = {Gazebo},
  size      = {large},
  alignment = {lawful evil},
  ac        = {13},
  hp        = {13 (2d8+4)},
  speed     = {5ft},


\DeclareFieldFormat{hp}{#1\addspace HP}



Then Eric was attacked by a \cite{gazebo}


Then Eric was attacked by a Gazebo//(Heading)Monsters//Gazebo (lawful evil). large. AC 13. 13 (2d8+4) HP. Speed: 5ft.

Depending on how interactive you'd like your document to be maybe PDF is not the right medium and you want a more dynamic HTML page instead? Markdown might be a lighter alternative to LaTeX markup when you don't need most of LaTeX's advanced (especially mathematical and general typographic) features.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.