Hacker News new | past | comments | ask | show | jobs | submit login
LaTeX for tabletop (vladar.bearblog.dev)
148 points by gaws on Sept 17, 2023 | hide | past | favorite | 59 comments



This is the kind of thing that is ripe for Typst (https://typst.app/home). There is a CLI interface as well as a web app.

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.


I’ve been doing LaTeX for some major portion of its life and I’ve see so many “LaTeX killers” come and go. But my documents from 25 years ago still compile and render.


Yeah, remember Lout? That was all the rage, briefly, about twenty years ago.


Wow, I was initially very enthusiastic about lout, and I still think it had some good ideas. I just remember the templates not being as easily hacked/tweaked as (La)TeX, and the advice was generally "accept how it already works" when people asked how to adjust things. Not a good sign. Also I remember--at least I think I do--that the source files had arbitrary f01.c f02.c f03.c names, so it was hard to guess where anything was. That was strange.


That's been my experience; either it's a beautiful template that does almost everything you ever wanted, but if you want that last 1-5%, you're doomed, or it's just another LaTeX-style tool that may be objectively better in some way, but it's fighting against 25+ years of experience getting LaTeX to do exactly what I want it to do (and providing quite sane defaults when I don't care).


And so will be in next century.


Every time I see typist, I see offline support is “coming soon”, and immediately move on.


Web app is not needed. You can write using any editor and compile locally using the typist cli.


Then it seems pretty misleading to put "offline support" under the "Coming soon" header.


Maybe it is the offline support for the web app


PDF support is also coming soon.


what do you mean ? It is possible to save as pdf


A web app? That won't work.

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.


It has a web app and a CLI. LaTeX also has both - it's just that the Typst web app has better integration with the actual engine than the various LaTeX web apps.


I can't predict the future by I really liked typst. I really hope they will find their market. And I almost wish I was still using latex to replace it with typst


For my novel, I wanted to have a different style for conversations (or events) that are happening simultaneously. And I wanted to use Markdown. Rather than sprinkling TeX commands throughout the document, I use annotations, which were introduced by pandoc. Annotations resemble:

    ::: {.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.


> Creating a theme for tabletop role-playing games would take some elbow grease

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.


I think the parent means that RPG styling in his KeenWrite system would take some elbow grease, not LaTeX


I often wonder, if one is going to add such tags anyways, why not directly use LaTeX, ConTeXt, XML, ... for example

\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.


I understand the desire to use Markdown - if you’re not using an editor that will dump the “begin/end” for you with a keystroke or two it feels faster.


The problem with TeX is that it's a write-only imperative language. Good luck performing meaningful operations on the data.

XML, for all its human-unfriendliness, is very good for declarative document layout that you can later feed into some random process.


I use ConTeXt, and it is relatively simple to get each environment to whatever you want (plus you can code everything in Lua).


how do you use Context to make graphs or mind maps or flow charts? I have a hard time setting it up


KeenWrite integrates https://kroki.io/. A mind map in Markdown would be:

    ``` diagram-plantuml
    @startmindmap
    ...
    @endmindmap
    ```
See: https://kroki.io/examples.html#mind-map

The 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):

https://i.ibb.co/SJzzYRN/output.png


The same way that one would use markdown :-) (you JS libs or TikZ or Metapost packages).


I kinda want to publish a CV now that looks like the standard 5e definition of a monster manual creature.


I love this idea so much. It’s a shame that it would all get lost when passing through a recruiter or when needing to re-enter all the info on applications.


Don't you think that needing to re-enter your information on a job application basically guarantees that nobody will read your CV? It seems to me that situations like that are when the potential employer is going to use automated analysis rather than discretion, and are getting you to do the data entry for it!


Easy solution: Don't use recruiters.


Markdown based 5e theme exists: https://homebrewery.naturalcrit.com/


"Str 6, Dex 8, Int 18..."


"Down to the mines!"

"But, my Str, it is only 6!"

"Doesn't matter. Everyone goes down to the mines. Down to the mines!"


Let's normalize this.


If you are after a D&D feeling document check out (Homebrewery)[https://homebrewery.naturalcrit.com/]

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 one is really good, IMO. Most links I've clicked on in this comment section are close, but still feel a little off in terms of the final PDF. It's small things like spaces and fonts, but enough to give the result an uncanny valley kind of feel: you know you're supposed to look at a 5e document, but it's just not quite the same.

The Overleaf package, however, comes very close if you ask me.


I used https://www.ctan.org/pkg/rpg-module for our 1e (AD&D from the 80's) campaign and enjoy it quite a bit. I've also very slooooowly been putting in stats from 1e's monster manual (https://github.com/slithy/rpg_module), to help with macros, but it's very slow-going.


And here's an Emacs org-mode compatibility layer to make writing your own D&D-style campaigns or handbooks even easier (if you grok Emacs):

https://github.com/xeals/emacs-org-dnd

Written around the same DND-5e-LaTeX-Template as the OP article:

https://github.com/rpgtex/DND-5e-LaTeX-Template


https://www.overleaf.com/ is the result of the merger of two startups, Overleaf proper and ShareLaTeX, and is a Web-based, zero-install way of using LaTeX.

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).


Personally, I find the Overleaf web editor to be worse than a local editor (even with Vim keybindings, dark theme, etc.)

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.


I've been doing this for a while now. Initially, it was an easy way to generate good-looking screen PDFs, but I've even branched into print-ready files now.

https://wealdham.timvdalen.nl/mitsp https://wealdham.timvdalen.nl/aawp https://wealdham.timvdalen.nl/eee


Sadly very light on the subject matter of the title, mostly just a very brief LaTeX introduction page. The interesting content is the outlinks in the intro, existing templates that mimic D&D, either old school 2e style[1] or modern 5e aesthetics[2].

[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


Man for a second I thought that that first package on ctan actually included defining the map as well - looks like it’s just a static image though. They really did nail the design.


I seem to remember a dungeon map generator, but I can't recall if it abused LaTeX to do so.


Yeah, article disappointingly doesn't have much related to title. Was expecting something that would lead creating something like the linked template.


Would have been nice if they started with an example pdf of what the output would look like, rather than just give a bunch of code and ask us to compile it ourselves.


Here's the resulted pdf: https://files.catbox.moe/r7sarc.pdf


If you're looking for a GUI editor for your LaTex content, personally I like Lyx [1]. It's featuresome, easy to use, and also includes outline navigation.

[1] https://www.lyx.org/


I used Lyx to write my thesis way too many years ago and loved every minute of using it (especially compared to just writing LaTeX)


I love the way LaTeX output looks and so I've dabbled. I've been very happy with the results using templates written by others. But I occasionally need something slightly customized and I feel a bit hopeless. I've just never taken the time to get comfortable with the details.


There is a LaTeX package called “memoir” which is basically a “modpack” for LaTeX - and it has a detailed manual on how to do various customization things.

Or you can use its beautiful defaults.


I too love the way LaTeX output looks and it blows my mind that I can not make things that look as good with other tools.


I use Plain TeX (I have tried to use LaTeX once and I found Plain TeX easier to work with and get right how I intended). I have written macros to do what I wanted, including headings, automatic table of contents, cross-references, and also black bars on the edge of the page to indicate chapters and sections so that they can easily be found by the edge of the book.

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.


>It is not yet completed, but it is (and will continue to be) 100% public domain.

Where can it be found?


Speaking of RPG layout troubles, does anyone know of a good package/method of easily placing images? LaTeX itself is mostly focused on figures, and the solutions I found (like e.g. D&D 5E layouts) are rather specific.

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")


See also GameTex[1]. It is a LaTeX framework for writing a certain style of LARP common at MIT and Stanford.

[1]: http://web.mit.edu/kenclary/Public/Guild/GameTeX/


I used to use LaTeX for RPG manuscript formatting. I still do, for some small side projects.

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.


Need to write something with Japanese, traditional chinese and simplified chinese. Quite a challenge. Especially clash with some other package. But still it works. Just a bit of learning curve.


I have no idea where this idea that latex allows you to forget about formatting and just focus on the content, but it the greatest lie about latex


You're supposed to write things like `\chapter{the title}` (so focusing on the content) instead of dealing with: font family/size/weight/variant/shape, text color/flushing/decoration, you know all those formatting you're always playing with with text editors for example.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: