LaTeX for tabletop
vladar.bearblog.dev
vladar.bearblog.dev
I’ve recently been working on a book using Typst after hacking LaTeX for many years. Through some examples and the docs I’ve already been able to accomplish much more customization on my own, rather than cargo-culting 20-year old snippets and packages, and the results are readable and maintainable. I don’t know if Typst will completely supersede LaTeX, but this point I think it is capable of doing so and I will be upset if it doesn’t.
If these guys are for the money, Microsoft and Google have them covered. If they're for Open Source, Latex lets you do it locally.
In my experience, these attempts to provide some open-source-yet-somewhat-vendor-dependent solutions don't work.
::: {.concurrent title="Hacker News Thread 1"}
I'm writing in an HN thread.
:::
::: {.concurrent title="Hacker News Thread 2"}
This is a separate thread.
:::
This gets styled in the PDF as:https://i.ibb.co/ZfZXmDn/output.png
Later, I could opt to format the concurrent threads as two-column text ... without changing the Markdown source file.
Various styles are packed in themes, which the user can select when exporting to PDF. At present, there are only three themes:
https://github.com/DaveJarvis/keenwrite-themes/tree/main/exa...
There other styles in the Boschet theme, such as speech bubbles, TODOs, and so forth:
::: bubbletx
Speech sent from the device.
:::
::: bubblerx
Speech received by the device.
:::
Here's a video showing how they appear in the preview window:https://youtu.be/7icc4oZB2I4?list=PLB-WIt1cZYLm1MMx2FBG9KWzP...
Creating a theme for tabletop role-playing games would take some elbow grease. When finished, it'd mean people could write their documents in Markdown and reuse the same theme, without having to know how TeX commands work. Knowing TeX commands is a barrier to entry for a lot of people.
\begin{conccurrent}{Hacker News Thread} I'm writing in an HN thread. \end{concurrent}
is not so different from the markdown source. All the benefits you mention are simply from using semantic markup.
XML, for all its human-unfriendliness, is very good for declarative document layout that you can later feed into some random process.
``` diagram-plantuml
@startmindmap
...
@endmindmap
```
See: https://kroki.io/examples.html#mind-mapThe SVG output is written to a local file. KeenWrite converts Markdown to XHTML (XML), which references the local file. ConTeXt then typesets the XML, importing the local vector graphics file and formats it according to the setups defined by the theme.
Kroki has other text-based formats for flow charts, Gantt charts, UML diagrams, packet diagrams, network diagrams, etc.
To be concrete, create a file named "example.md":
Mind Map:
``` diagram-plantuml
@startmindmap
skinparam monochrome true
+ OS
++ Ubuntu
+++ Linux Mint
+++ Kubuntu
+++ Lubuntu
+++ KDE Neon
++ LMDE
++ SolydXK
++ SteamOS
++ Raspbian
-- Windows 95
-- Windows 98
-- Windows NT
--- Windows 8
--- Windows 10
@endmindmap
```
Then run: ./keenwrite.sh -i example.md --theme-dir=themes/boschet -o output.pdf
That outputs a PDF file with the following vector graphic (on page 3):The article links to several, including a convincing reproduction of basic Wizards of the Coast house style for D&D 5E:
https://github.com/rpgtex/DND-5e-LaTeX-Template
Here's another 5E one with additional sidebar styles:
https://github.com/anoderay/DND-5e-LaTeX-Template/
Also 5E-inspired, with a template for card accessories:
https://github.com/Krozark/RPG-LaTeX-Template
A 5E-compatible character sheet:
https://github.com/matsavage/DND-5e-LaTeX-Character-Sheet-Te...
CTAN also has packages for Basic D&D-inspired typesetting (rpg-module, also linked from the article), GURPS (gurps), generic hex boards (hexboard), and wargame hex boards with counters (wargame).
There are also indie TTRPGs that've shipped using custom LaTeX templates; this one has CC-BY licensed source: https://github.com/ludus-leonis/nipajin
And the blog author's own, with a more restrictive CC-NC-SA license: https://github.com/Vladar4/itdr
From personal experience, the biggest struggle is non-rectangular text wrapping around images.
"But, my Str, it is only 6!"
"Doesn't matter. Everyone goes down to the mines. Down to the mines!"
Overleaf (which a recommended as a latex tool) has a (5e style template)[https://www.overleaf.com/latex/templates/d-and-d-5e-latex-te...] too.
The Overleaf package, however, comes very close if you ask me.
https://github.com/xeals/emacs-org-dnd
Written around the same DND-5e-LaTeX-Template as the OP article:
It is the gold standard for collaborative scientific publishing with distributed teams, which has become the norm in the sciences and engineering, if not yet in the humanities (where emailing *.doc file drafts around has not yet died the death the bad habit deserves).
But if your organization pays for Overleaf, you can sync Overleaf projects to local Git repos - and just pull / push as you would any other Git repo.
This is the best of both worlds IMO, since collaborators that don’t know Git can use the web editor without prior knowledge, while collaborators with strong opinions about editors usually know Git (or are willing to learn it).
There is also a Dropbox sync option, but I don’t recommend it. I’ve experienced bugs several times where TeX files suddenly become empty when using it.
https://wealdham.timvdalen.nl/mitsp https://wealdham.timvdalen.nl/aawp https://wealdham.timvdalen.nl/eee
[1] https://www.ctan.org/pkg/rpg-module - click the PDF link to the package documentation to see the style
[2] https://github.com/rpgtex/DND-5e-LaTeX-Template -- with great looking preview in readme
Or you can use its beautiful defaults.
Since \write in a page is only valid if the page is shipped out, and the references of pages will need to be known before they are printed, so instead I used insertions for this, and the insertion contains altnerating marks and penalties, which are then using \vsplit in the output routine to extract the marks and execute them without shipping out the page during the first pass.
Another use of insertions is tables that span multiple pages, that it may automatically add "(continued on next page)" and repeat the table headings on the top of the next page.
And, it is also helpful to include mathematical equations in the text; in my opinion that is one of the problems with many other RPG systems that doesn't have enough mathematical equations.
It is not yet completed, but it is (and will continue to be) 100% public domain.
Where can it be found?
Ideally I'd like something where I could both place the image itself (e.g. left/right/upper/lower half of page), and the content within it ("150% zoom, centered on x:431 y:200")
Thing is... while it's good for consistency and tracking changes, it's horrible for the creative process, layout-wise. Visual editors like Affinity Publisher are much better for other-than-trivial layout concerns.