Skip to content

Latex character template#175

Open
PJBrs wants to merge 7 commits into
canismarko:masterfrom
PJBrs:latex-character-template
Open

Latex character template#175
PJBrs wants to merge 7 commits into
canismarko:masterfrom
PJBrs:latex-character-template

Conversation

@PJBrs

@PJBrs PJBrs commented Apr 2, 2025

Copy link
Copy Markdown
Contributor

This PR introduces @matsavage 's latex character template as a submodule to dungeon-sheets.

  1. The first patch basically just adds the template, with an associated test and adding the associated files to the pyproject.toml file
  2. The second patch switches compilation from xelatex (which requires additional config options) to lualatex (which requires luapstricks and lualatex), which is way, way faster.
  3. The third patch just renames the template as latex character template.
  4. The fourth patch adds the necessary documentation
  5. The fifth adds a call to kpsewhich that checks whether the user already has installed the latex character template or the dnd style as latex modules, and if so, prefers locally installed options over those bundled with dungeonsheets, so that the user can have local changes apply in dungeonsheets output
  6. The sixth and final patch basically is some changes to the testing infrastructure by @matsavage that I reworked just a little bit, with an aim to test everything, but not cost too much time, and end up with a dungeonsheets docker package that is labelled "latest".

@PJBrs

PJBrs commented Apr 2, 2025

Copy link
Copy Markdown
Contributor Author

Tests failed because this PR's tests depends on the featsorting patch.

@PJBrs
PJBrs force-pushed the latex-character-template branch from a24251f to a848795 Compare May 22, 2025 20:16
@PJBrs
PJBrs force-pushed the latex-character-template branch from a848795 to 78485cb Compare August 29, 2025 13:42
PJBrs and others added 6 commits August 31, 2025 21:56
This patch adds the MSavage latex template as a submodule
to dungeonsheets, adds it to the TEXINPUTS environment
and adds TTFONTS environment variable to find the kalam
font.

Furthermore, make the MSavage latex template part of the
tests in the github workflow.

Remove babel support from the MSavage latex template,
otherwise latex will complain about missing languages
(alternatively, we could add the languages directory from
the dnd class to pyproject.toml).

The latest version of the MSavage latex template adds
automatic text scaling so that text fields no longer overflow with
longer inputs.

This fixes canismarko#92
The MSavage latex template was compiled using xelatex. To make this
work, an additional setting had to be used for dvipdfmx.cfg
(-dNOSAFER), which represents a (slight) security risk. Furthermore,
xelatex is very slow.

This patch switches to lualatex instead. It has different dependencies,
the most important one being the presence of luapstrics.lua.  As far as
I can tell, by now luapstricks.lua should be present on your average
system with TexLive. It is on mine, at least, on Slackware-15.0, which
is moderately conservative in many respects.
Rename the MSavage latex template to the more generic
latex_character_sheet_template.tex. I also renamed
associated functions that still had the msavage name
in them to more neutral alternatives.

This on behalf of Mat Savage himself, who created
the Latex 5e Character Sheet Template that we
use in dungeonsheets.
This patch adds the makesheets commandline option to
build the latex character sheet to the README.
Dungeonsheets now packages the dnd latex template and the dnd
latex character sheet template packages as submodules. This
greatly eases using the latex code, but it also takes away
some opportunities for customisation.

This patch checks whether dnd.sty and dndtemplate.sty are
already installed in a local latex directory, and if so,
adds them to the texinputs path used in the latex subprocess
environment.
This is a squashed commit of various changes by
Mat Savage to improve upon the github tests.

First, this patch updates the Docker file so that it is
compatible with lualatex. Furthermore, it adds a test
building all dungeonsheets examples in the docker workflow
file. And it refactors the python_ci workflow by only
testing all examples in python-3.12, to prevent the
test runs from taking so long. Finally, it pushes
the resulting docker image to the registry after tagging
it "latest".
@PJBrs
PJBrs force-pushed the latex-character-template branch from 78485cb to c23bfd3 Compare August 31, 2025 19:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants