Skip to content

Commit bbee0c7

Browse files
authored
Merge pull request readthedocs#5744 from rtfd/hotfix-latexmx
Hotfix latexmx builder to ignore error codes
2 parents b89c5a8 + ada0133 commit bbee0c7

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

readthedocs/doc_builder/backends/sphinx.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -467,25 +467,35 @@ def _build_latexmk(self, cwd, latex_cwd):
467467
cwd=latex_cwd,
468468
)
469469

470-
cmd = self.run(
470+
if self.build_env.command_class == DockerBuildCommand:
471+
latex_class = DockerLatexBuildCommand
472+
else:
473+
latex_class = LatexBuildCommand
474+
475+
cmd = [
471476
'latexmk',
472477
'-r',
473478
rcfile,
474-
475479
# FIXME: check for platex here as well
476480
'-pdfdvi' if self.project.language == 'ja' else '-pdf',
477-
481+
# Ignore error codes because they often lie
482+
'-f',
478483
'-dvi-',
479484
'-ps-',
480485
f'-jobname={self.project.slug}',
481486
'-interaction=nonstopmode',
487+
]
488+
489+
cmd_ret = self.build_env.run_command_class(
490+
cls=latex_class,
491+
cmd=cmd,
482492
warn_only=True,
483493
cwd=latex_cwd,
484494
)
485495

486496
self.pdf_file_name = f'{self.project.slug}.pdf'
487497

488-
return cmd.successful
498+
return cmd_ret.successful
489499

490500
def _build_pdflatex(self, tex_files, latex_cwd):
491501
pdflatex_cmds = [

0 commit comments

Comments
 (0)