Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions latex/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, latexmk='latexmk', pdflatex='pdflatex'):
self.pdflatex = pdflatex

@data('source')
def build_pdf(self, source, texinputs=[]):
def build_pdf(self, source, texinputs=[], **kwargs):
with TempDir() as tmpdir,\
source.temp_saved(suffix='.latex', dir=tmpdir) as tmp:

Expand All @@ -72,7 +72,7 @@ def build_pdf(self, source, texinputs=[]):
latex_cmd = [shlex_quote(self.pdflatex),
'-interaction=batchmode',
'-halt-on-error',
'-no-shell-escape',
'-shell-escape' if kwargs.get('allow_shell_escape') else '-no-shell-escape',
'-file-line-error',
'%O',
'%S',
Expand Down Expand Up @@ -126,7 +126,7 @@ def __init__(self, pdflatex='pdflatex', max_runs=15):
self.max_runs = 15

@data('source')
def build_pdf(self, source, texinputs=[]):
def build_pdf(self, source, texinputs=[], **kwargs):
with TempDir() as tmpdir,\
source.temp_saved(suffix='.latex', dir=tmpdir) as tmp:

Expand All @@ -140,7 +140,7 @@ def build_pdf(self, source, texinputs=[]):
args = [self.pdflatex,
'-interaction=batchmode',
'-halt-on-error',
'-no-shell-escape',
'-shell-escape' if kwargs.get('allow_shell_escape') else '-no-shell-escape',
'-file-line-error',
tmp.name]

Expand Down Expand Up @@ -189,7 +189,7 @@ def is_available(self):
]


def build_pdf(source, texinputs=[]):
def build_pdf(source, texinputs=[], **kwargs):
"""Builds a LaTeX source to PDF.

Will automatically instantiate an available builder (or raise a
Expand All @@ -203,7 +203,7 @@ def build_pdf(source, texinputs=[]):
builder = bld_cls()
if not builder.is_available():
continue
return builder.build_pdf(source, texinputs)
return builder.build_pdf(source, texinputs, **kwargs)
else:
raise RuntimeError('No available builder could be instantiated. '
'Please make sure LaTeX is installed.')