From 85677fc30b49e411234d828c387445e9928b3fd1 Mon Sep 17 00:00:00 2001 From: PJ Beers Date: Sat, 17 Feb 2024 13:54:01 +0100 Subject: [PATCH 1/7] dungeonsheets/modules: Add MSavage latex template 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 https://github.com/canismarko/dungeon-sheets/issues/92 --- .github/workflows/python-ci.yml | 4 ++-- .gitmodules | 3 +++ dungeonsheets/forms/MSavage_template.tex | 2 -- dungeonsheets/latex.py | 13 ++++++++++--- dungeonsheets/make_sheets.py | 1 + .../modules/DND-5e-LaTeX-Character-Sheet-Template | 1 + pyproject.toml | 7 +++++++ 7 files changed, 24 insertions(+), 7 deletions(-) create mode 160000 dungeonsheets/modules/DND-5e-LaTeX-Character-Sheet-Template diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index c4a1b71b..ef961fe8 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -21,7 +21,7 @@ jobs: - name: Set up required system dependencies run: | sudo apt-get update - sudo apt-get -y install pdftk texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra + sudo apt-get -y install pdftk texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-pstricks - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -37,7 +37,7 @@ jobs: run: > cd examples/; makesheets --debug; - makesheets --debug --fancy; + makesheets --debug --fancy --tex-template; makesheets --debug --output-format=epub; cd ../; pytest --cov=dungeonsheets tests/ diff --git a/.gitmodules b/.gitmodules index 5bd8ab31..807489d4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "dungeonsheets/modules/DND-5e-LaTeX-Template"] path = dungeonsheets/modules/DND-5e-LaTeX-Template url = https://github.com/rpgtex/DND-5e-LaTeX-Template.git +[submodule "dungeonsheets/modules/DND-5e-LaTeX-Character-Sheet-Template"] + path = dungeonsheets/modules/DND-5e-LaTeX-Character-Sheet-Template + url = https://github.com/matsavage/DND-5e-LaTeX-Character-Sheet-Template diff --git a/dungeonsheets/forms/MSavage_template.tex b/dungeonsheets/forms/MSavage_template.tex index 35d3e427..cd378eae 100644 --- a/dungeonsheets/forms/MSavage_template.tex +++ b/dungeonsheets/forms/MSavage_template.tex @@ -5,8 +5,6 @@ \usepackage{ifthen} \usepackage{pstricks} -\usepackage[UKenglish]{babel} - \usepackage{dndtemplate} \usepackage{bookmark} diff --git a/dungeonsheets/latex.py b/dungeonsheets/latex.py index 124aa407..b1d95e73 100644 --- a/dungeonsheets/latex.py +++ b/dungeonsheets/latex.py @@ -50,7 +50,8 @@ def create_latex_pdf( basename: str, keep_temp_files: bool = False, use_dnd_decorations: bool = False, - comm1: str = "pdflatex" + use_tex_template: bool = False, + comm1: str = "pdflatex", ): # Create tex document tex_file = f"{basename}.tex" @@ -69,14 +70,20 @@ def create_latex_pdf( str(tex_file), ] + # Deal with TEXINPUTS and add paths to latex modules environment = os.environ tex_env = environment.get('TEXINPUTS', '') module_root = Path(__file__).parent / "modules/" - module_dirs = [module_root / mdir for mdir in ["DND-5e-LaTeX-Template"]] + module_dirs = [module_root / mdir for mdir in ["DND-5e-LaTeX-Template", "DND-5e-LaTeX-Character-Sheet-Template"]] log.debug(f"Loading additional modules from {module_dirs}.") texinputs = ['.', *module_dirs, module_root, tex_env] - separator = ';' if isinstance(module_root, pathlib.WindowsPath) else ':' + # Two (back-)slashes at the end of each path to recursively add all subdirectories + separator = '\\;' if isinstance(module_root, pathlib.WindowsPath) else '//:' environment['TEXINPUTS'] = separator.join(str(path) for path in texinputs) + if use_tex_template: + environment['TTFONTS'] = environment['TEXINPUTS'] + + # Prepare the latex subprocess passes = 2 if use_dnd_decorations else 1 log.debug(tex_command_line) log.debug("LaTeX command: %s" % " ".join(tex_command_line)) diff --git a/dungeonsheets/make_sheets.py b/dungeonsheets/make_sheets.py index 623c8207..38fbec5c 100644 --- a/dungeonsheets/make_sheets.py +++ b/dungeonsheets/make_sheets.py @@ -542,6 +542,7 @@ def msavage_sheet(character, basename, debug=False): keep_temp_files=debug, use_dnd_decorations=True, comm1="xelatex", + use_tex_template=True, ) diff --git a/dungeonsheets/modules/DND-5e-LaTeX-Character-Sheet-Template b/dungeonsheets/modules/DND-5e-LaTeX-Character-Sheet-Template new file mode 160000 index 00000000..ab3b0417 --- /dev/null +++ b/dungeonsheets/modules/DND-5e-LaTeX-Character-Sheet-Template @@ -0,0 +1 @@ +Subproject commit ab3b041769dfbd42c0fb50cc42f50363cdab07c6 diff --git a/pyproject.toml b/pyproject.toml index 86f20669..5ca5e1c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,13 @@ dungeonsheets = [ "modules/DND-5e-LaTeX-Template/*", "modules/DND-5e-LaTeX-Template/lib/*", "modules/DND-5e-LaTeX-Template/img/*", + "modules/DND-5e-LaTeX-Character-Sheet-Template/*", + "modules/DND-5e-LaTeX-Character-Sheet-Template/template/*", + "modules/DND-5e-LaTeX-Character-Sheet-Template/template/fonts/*", + "modules/DND-5e-LaTeX-Character-Sheet-Template/template/character-sheet/*", + "modules/DND-5e-LaTeX-Character-Sheet-Template/template/background-sheet/*", + "modules/DND-5e-LaTeX-Character-Sheet-Template/template/half-spell-sheet/*", + "modules/DND-5e-LaTeX-Character-Sheet-Template/template/spell-sheet/*", ] [tool.setuptools_scm] From fc8a2c077f0342bf1c25823004b658d2792da26b Mon Sep 17 00:00:00 2001 From: PJ Beers Date: Thu, 14 Mar 2024 20:58:09 +0100 Subject: [PATCH 2/7] MSavage latex template: Switch to lualatex 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. --- dungeonsheets/make_sheets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dungeonsheets/make_sheets.py b/dungeonsheets/make_sheets.py index 38fbec5c..59f7f246 100644 --- a/dungeonsheets/make_sheets.py +++ b/dungeonsheets/make_sheets.py @@ -541,7 +541,7 @@ def msavage_sheet(character, basename, debug=False): basename=basename, keep_temp_files=debug, use_dnd_decorations=True, - comm1="xelatex", + comm1="lualatex", use_tex_template=True, ) From 10772c1e1d7e5d6a453eeca1de11c879fb36a947 Mon Sep 17 00:00:00 2001 From: PJ Beers Date: Fri, 5 Apr 2024 13:13:23 +0200 Subject: [PATCH 3/7] MSavage latex template: Rename 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. --- ...{MSavage_template.tex => character_sheet_template.tex} | 0 dungeonsheets/latex.py | 4 ++-- dungeonsheets/make_sheets.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename dungeonsheets/forms/{MSavage_template.tex => character_sheet_template.tex} (100%) diff --git a/dungeonsheets/forms/MSavage_template.tex b/dungeonsheets/forms/character_sheet_template.tex similarity index 100% rename from dungeonsheets/forms/MSavage_template.tex rename to dungeonsheets/forms/character_sheet_template.tex diff --git a/dungeonsheets/latex.py b/dungeonsheets/latex.py index b1d95e73..90fccc05 100644 --- a/dungeonsheets/latex.py +++ b/dungeonsheets/latex.py @@ -271,8 +271,8 @@ def rst_to_boxlatex(rst): return tex -def msavage_spell_info(char): - """Generates the spellsheet for msavage template.""" +def latex_character_spell_info(char): + """Generates the spellsheet for the latex character template.""" headinfo = char.spell_casting_info["head"] font_options = {1:"", 2:r"\Large ", 3:r"\large "} selector = min(len(char.spellcasting_classes), 3) diff --git a/dungeonsheets/make_sheets.py b/dungeonsheets/make_sheets.py index 59f7f246..a1ad8c15 100644 --- a/dungeonsheets/make_sheets.py +++ b/dungeonsheets/make_sheets.py @@ -56,7 +56,7 @@ jinja_env.filters["rst_to_html"] = epub.rst_to_html jinja_env.filters["to_heading_id"] = epub.to_heading_id jinja_env.filters["boxed"] = latex.rst_to_boxlatex -jinja_env.filters["spellsheetparser"] = latex.msavage_spell_info +jinja_env.filters["spellsheetparser"] = latex.latex_character_spell_info jinja_env.filters["monsterdoc"] = latex.RPGtex_monster_info # Custom types @@ -512,7 +512,7 @@ def make_character_content( return content -def msavage_sheet(character, basename, debug=False): +def latex_character_sheet(character, basename, debug=False): """Another adaption. All changes can be easily included as options in the orignal functions, though.""" @@ -533,7 +533,7 @@ def msavage_sheet(character, basename, debug=False): character.images = [(character.symbol, 1, 488, 564, 145, 112)] + character.images break - tex = jinja_env.get_template("MSavage_template.tex").render( + tex = jinja_env.get_template("character_sheet_template.tex").render( char=character, portrait=portrait_command ) latex.create_latex_pdf( @@ -599,7 +599,7 @@ def make_character_sheet( # Typeset combined LaTeX file if output_format == "pdf": if use_tex_template: - msavage_sheet( + latex_character_sheet( character=character, basename=char_base, debug=debug, From 7d87fa32e964edecec084bdb63f160983ea8c7c2 Mon Sep 17 00:00:00 2001 From: PJ Beers Date: Sun, 9 Jun 2024 23:01:35 +0200 Subject: [PATCH 4/7] README.rst: Document the latex character sheet This patch adds the makesheets commandline option to build the latex character sheet to the README. --- README.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.rst b/README.rst index 2de2a927..b9143e34 100644 --- a/README.rst +++ b/README.rst @@ -111,6 +111,12 @@ Consider using the ``-F`` option to include the excellent D&D 5e template for rendering spellbooks, druid wild forms and features pages (https://github.com/rpgtex/DND-5e-LaTeX-Template). +Consider using the ``-T`` option to use the beautiful latex character +sheet +(https://github.com/matsavage/DND-5e-LaTeX-Character-Sheet-Template). +This does require lualatex as well as a fairly recent version of +texlive. + By default, your character's spells are ordered alphabetically. If you would like your spellbook to be ordered by level, you can use the ``-S`` option to do so. From ecf7553f704f72ac8e0c2da913fd10f473375de2 Mon Sep 17 00:00:00 2001 From: PJ Beers Date: Fri, 22 Mar 2024 19:48:46 +0100 Subject: [PATCH 5/7] latex.py: Add local dnd.sty and dndntemplate.sty if installed 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. --- README.rst | 7 +++++-- dungeonsheets/latex.py | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index b9143e34..e353b4fe 100644 --- a/README.rst +++ b/README.rst @@ -109,13 +109,16 @@ so attack bonuses and damage can be calculated automatically. Consider using the ``-F`` option to include the excellent D&D 5e template for rendering spellbooks, druid wild forms and features -pages (https://github.com/rpgtex/DND-5e-LaTeX-Template). +pages (https://github.com/rpgtex/DND-5e-LaTeX-Template). dungeon- +sheets includes its own version of the template, but will use a +local one if it is installed. Consider using the ``-T`` option to use the beautiful latex character sheet (https://github.com/matsavage/DND-5e-LaTeX-Character-Sheet-Template). This does require lualatex as well as a fairly recent version of -texlive. +texlive. dungeon-sheets includes its own version of the latex character +template, but will use a local one if it is installed. By default, your character's spells are ordered alphabetically. If you would like your spellbook to be ordered by level, you can use the ``-S`` diff --git a/dungeonsheets/latex.py b/dungeonsheets/latex.py index 90fccc05..51102503 100644 --- a/dungeonsheets/latex.py +++ b/dungeonsheets/latex.py @@ -4,6 +4,7 @@ import re import subprocess import logging +import warnings from docutils import core from docutils.writers.latex2e import Writer, Table, LaTeXTranslator @@ -74,11 +75,30 @@ def create_latex_pdf( environment = os.environ tex_env = environment.get('TEXINPUTS', '') module_root = Path(__file__).parent / "modules/" - module_dirs = [module_root / mdir for mdir in ["DND-5e-LaTeX-Template", "DND-5e-LaTeX-Character-Sheet-Template"]] + module_dirs = [] + + # Load locally installed latex packages if they exist, to allow for + # local latex customisation + for module in ["dnd.sty", "dndtemplate.sty"]: + kpsewhich_command = [ + "kpsewhich", + module, + ] + try: + module_check = subprocess.run(kpsewhich_command, capture_output=True, env=environment, text=True) + if module in module_check.stdout: + module_dirs.append(Path(module_check.stdout).parent) + except FileNotFoundError: + msg = ('Could not run kpsewhich. Something seems strange with your latex installation.') + warnings.warn(msg) + + module_dirs.extend( + [module_root / mdir for mdir in ["DND-5e-LaTeX-Template", "DND-5e-LaTeX-Character-Sheet-Template"]] + ) log.debug(f"Loading additional modules from {module_dirs}.") texinputs = ['.', *module_dirs, module_root, tex_env] # Two (back-)slashes at the end of each path to recursively add all subdirectories - separator = '\\;' if isinstance(module_root, pathlib.WindowsPath) else '//:' + separator = '\\\\;' if isinstance(module_root, pathlib.WindowsPath) else '//:' environment['TEXINPUTS'] = separator.join(str(path) for path in texinputs) if use_tex_template: environment['TTFONTS'] = environment['TEXINPUTS'] From c23bfd3e7d498643ec6ec4f47776c9f5a7d12538 Mon Sep 17 00:00:00 2001 From: Mathew Savage Date: Sun, 7 Apr 2024 13:36:44 +0100 Subject: [PATCH 6/7] Updates Dockerfile and test pipelines 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". --- .github/workflows/docker.yml | 86 ++++++++++++++++++++++++++++++--- .github/workflows/python-ci.yml | 43 ----------------- .github/workflows/python_ci.yml | 84 ++++++++++++++++++++++++++++++++ Dockerfile | 2 +- README.rst | 2 +- 5 files changed, 166 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/python-ci.yml create mode 100644 .github/workflows/python_ci.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0b1a680f..6329e25e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,15 +1,22 @@ -name: Docker +name: Deploy Docker image on: - push: - branches: [ "master" ] + workflow_run: + workflows: ["Python package"] + branches: ["master"] + types: + - completed + + workflow_dispatch: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} + VERSION: latest jobs: - build_publish: + build: + name: Build Docker image runs-on: ubuntu-latest permissions: contents: read @@ -29,7 +36,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login against Container registry + - name: Login to container registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -42,7 +49,7 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build and push Docker image + - name: Build Docker image uses: docker/build-push-action@v5 with: context: . @@ -50,3 +57,70 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64, linux/arm64 + + test: + name: Test Docker image + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + strategy: + matrix: + build-command: ["", "--fancy --tex-template --feats-by-type --spells-by-level", "--output-format=epub"] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Run Tests + run: | + docker run -v ${{ github.workspace }}/examples:/build ${{ steps.meta.outputs.tags }} ${{ matrix.build-command }} + + push: + name: Deploy Docker image + needs: [build, test] + if: ${{ github.ref == 'refs/heads/master' }} + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + + - name: Login to container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Pull Docker image from GHCR + run: docker pull ${{ steps.meta.outputs.tags }} + + - name: Lowercase reponame + run: echo "IMAGE_NAME_LC=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}" + + - name: Tag and push Docker image to GHCR (final) + run: | + docker tag ${{ steps.meta.outputs.tags }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}:${{ env.VERSION }} + docker push ${{ steps.meta.outputs.tags }} + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}:${{ env.VERSION }} diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml deleted file mode 100644 index ef961fe8..00000000 --- a/.github/workflows/python-ci.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Python package - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python-version: ['3.9', '3.10', '3.11', '3.12'] - - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Set up required system dependencies - run: | - sudo apt-get update - sudo apt-get -y install pdftk texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-pstricks - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: Install dependencies and do a local pip install - run: | - python -m pip install --upgrade pip - pip install -e ".[dev]" - - name: Run flake - run: flake8 dungeonsheets/ --exit-zero - - name: Run tests - run: > - cd examples/; - makesheets --debug; - makesheets --debug --fancy --tex-template; - makesheets --debug --output-format=epub; - cd ../; - pytest --cov=dungeonsheets tests/ diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml new file mode 100644 index 00000000..06d04b2d --- /dev/null +++ b/.github/workflows/python_ci.yml @@ -0,0 +1,84 @@ +name: Python package + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + name: "Run test suite" + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: ['3.9', '3.10', '3.11'] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up required system dependencies + run: | + sudo apt-get update + sudo apt-get -y install pdftk texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-luatex texlive-pstricks + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + + - name: Install dependencies and do a local pip install + run: | + python -m pip install --upgrade pip + pip install -e ".[dev]" + + - name: Run flake + run: flake8 dungeonsheets/ --exit-zero + + - name: Run tests + run: pytest --cov=dungeonsheets tests/ + + render_examples: + name: "Test python-3.12, render all examples" + runs-on: ubuntu-latest + needs: [build] + strategy: + matrix: + build-command: ["", "--fancy --tex-template --spells-by-level --feats-by-type", "--output-format=epub"] + + steps: + - uses: actions/checkout@v4 + name: Checkout Repo + with: + submodules: recursive + + - name: Set up required system dependencies + run: | + sudo apt-get update + sudo apt-get -y install pdftk texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-luatex texlive-pstricks + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: pip + + - name: Install dependencies and do a local pip install + run: | + python -m pip install --upgrade pip + pip install -e ".[dev]" + + - name: Run flake + run: flake8 dungeonsheets/ --exit-zero + + - name: Run tests + run: pytest --cov=dungeonsheets tests/ + + - name: Render examples with ${{ matrix.build-command }} + run: | + cd examples + makesheets --debug ${{ matrix.build-command }} diff --git a/Dockerfile b/Dockerfile index 38ac0bd2..c0d3aee6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:latest -RUN apt-get update && apt-get install -y pdftk texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra +RUN apt-get update && apt-get install -y pdftk texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-luatex texlive-pstricks WORKDIR /app diff --git a/README.rst b/README.rst index e353b4fe..4ec0c09e 100644 --- a/README.rst +++ b/README.rst @@ -36,7 +36,7 @@ Run the following in a directory with valid character files (such as the example .. code:: bash - $ docker run -it -v $(pwd):/build ghcr.io/canismarko/dungeon-sheets:master + $ docker run -it -v $(pwd):/build ghcr.io/canismarko/dungeon-sheets:latest Installation From 12271ad703ba20b95bc8f1ec378d8e9526918eb7 Mon Sep 17 00:00:00 2001 From: James Rennison <22213990+stiffneckjim@users.noreply.github.com> Date: Sat, 4 Apr 2026 10:37:14 +0100 Subject: [PATCH 7/7] Update dungeonsheets/latex.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dungeonsheets/latex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dungeonsheets/latex.py b/dungeonsheets/latex.py index 51102503..e74be676 100644 --- a/dungeonsheets/latex.py +++ b/dungeonsheets/latex.py @@ -72,7 +72,7 @@ def create_latex_pdf( ] # Deal with TEXINPUTS and add paths to latex modules - environment = os.environ + environment = os.environ.copy() tex_env = environment.get('TEXINPUTS', '') module_root = Path(__file__).parent / "modules/" module_dirs = []