dungeon-sheets icon indicating copy to clipboard operation
dungeon-sheets copied to clipboard

More RPGtex dndtemplate options for the fancy feature pages

Open PJBrs opened this issue 11 months ago • 7 comments

This PR aims to make full use of all latex formatting options in the RPGtex latex dnd style. One patch switches the tables in the fancy pages over to the dndtable format. The other adds a jinja filter to format monsters completely according to the rpgtex monster format.

If needed, I can share two pdfs with "before" and "after" that showcase the changes.

PJBrs avatar Mar 13 '24 21:03 PJBrs

Here examples of unpatched and patched monsters.

Unpatched: gm-session-notes-unpatched.pdf

Patched: gm-session-notes-patched.pdf

PJBrs avatar Mar 22 '24 19:03 PJBrs

The latex output for monsters had a small bug (invisible though), and it included loads of spurious newlines. My latest force-push fixes that.

PJBrs avatar Mar 23 '24 13:03 PJBrs

... and before and after examples of some tables, one with and one without table header: image

image

PJBrs avatar Mar 23 '24 13:03 PJBrs

I've reflected some more on these patches. It seems to me that there's one single risk in switching to dndtable, that is, under the hoodit uses the tabularx environment instead of supertabular, and supertabular supports multi-page tables, which tabularx doesn't... @canismarko is that a problem for you here?

In the meantime, I'm going to find out whether I can fix that with the xltabular environment.

========= EDIT ===========

Well, this is very convoluted, I believe. The xltabular format will fail in multicolumn mode. The real solution would be to switch to the tabularray package, format it the way we want it, and not use the RPGtex dndtable at all. Then again, no tables appear to exist in dungeonsheets that exceed an entire page, and to be on the safe side, I could disable the dndtable in the gm-notes... Please let me know!

PJBrs avatar May 20 '24 12:05 PJBrs

I've given this some more reflection. Upon further inspection, I noticed that dungeonsheets doesn't use multipage tables at all, not in fancy pages or in regular latex output. so this PR doesn't not seem to reduce any functionality. Indeed, it might even be possible to enable multipage tables with some further effort

========= EDIT ===========

And I was wrong, the gm-pages don't use multipage tables, but the character files do. Then again, I just found out how to convert DndTable to supertabular, applied it to the gm-pages, and succeeded in generating a huge, multi-page monstertable. In other words, I can improve upon this PR a bit.

PJBrs avatar May 26 '24 11:05 PJBrs

Improved this PR... I took the DndTable environment from the RPGTeX latex style and reimplemented it using supertabular* instead of tabularx. As a consequence, fancy-themed tables now have the same technical characteristics as the non-fancy feature pages (that is, multicolumn, multipage tables), which also use supertabular. As a bonus, I added code to stretch the tables to exactly the width of one column, just as intended.

The last patch is still the same, it uses all monster box styling options available, so that, for instance, the "Actions" title in a monsterbox is a real formatted title, and not just "# Actions," as it was.

In sum, this PR finishes the implementation of all available dnd-style theming to the fancy latex feature pages. I'll admit that the monster formatting patch might look a bit hairy, but the proof of the pudding is in the eating, and above I have included one file with all available monsters, and they all look fine :-)

PJBrs avatar Jun 05 '24 19:06 PJBrs

Did small further tweaks to this PR. I did some regular expression substitutions in python that would have been nicer in latex, but that was beyond my competencies. As far as I'm concerned, this is ready for review.

PJBrs avatar Jun 15 '24 07:06 PJBrs