diff --git a/gramps/gen/plug/docgen/treedoc.py b/gramps/gen/plug/docgen/treedoc.py index e61e61c00..78c778c79 100644 --- a/gramps/gen/plug/docgen/treedoc.py +++ b/gramps/gen/plug/docgen/treedoc.py @@ -25,6 +25,7 @@ #------------------------------------------------------------------------- from abc import ABCMeta, abstractmethod import os +import shutil from subprocess import Popen, PIPE from io import StringIO import tempfile @@ -606,14 +607,16 @@ class TreePdfDoc(TreeDocBase): self._filename += ".pdf" with tempfile.TemporaryDirectory() as tmpdir: + basename = os.path.basename(self._filename) args = ['lualatex', '-output-directory', tmpdir, - '-jobname', self._filename[:-4]] + '-jobname', basename[:-4]] if win(): proc = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, creationflags=DETACHED_PROCESS) else: proc = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) proc.communicate(input=self._tex.getvalue().encode('utf-8')) + shutil.copy(os.path.join(tmpdir, basename), self._filename) #------------------------------------------------------------------------------