diff --git a/readthedocs/doc_builder/backends/sphinx.py b/readthedocs/doc_builder/backends/sphinx.py index ebf1c0260bb..8bf39fb894b 100644 --- a/readthedocs/doc_builder/backends/sphinx.py +++ b/readthedocs/doc_builder/backends/sphinx.py @@ -287,6 +287,10 @@ def build(self, **kwargs): cmd_ret = self.build_env.run_command_class( cls=LatexBuildCommand, cmd=cmd, cwd=latex_cwd, warn_only=True) pdf_commands.append(cmd_ret) + for cmd in pdflatex_cmds: + cmd_ret = self.build_env.run_command_class( + cls=LatexBuildCommand, cmd=cmd, cwd=latex_cwd, warn_only=True) + pdf_commands.append(cmd_ret) for cmd in pdflatex_cmds: cmd_ret = self.build_env.run_command_class( cls=LatexBuildCommand, cmd=cmd, cwd=latex_cwd, warn_only=True) diff --git a/readthedocs/rtd_tests/tests/test_builds.py b/readthedocs/rtd_tests/tests/test_builds.py index b47ca877436..692641ea113 100644 --- a/readthedocs/rtd_tests/tests/test_builds.py +++ b/readthedocs/rtd_tests/tests/test_builds.py @@ -143,6 +143,7 @@ def test_build_pdf_latex_failures(self): (('', ''), 1), # latex (('', ''), 0), # makeindex (('', ''), 0), # latex + (('', ''), 0), # latex ] mock_obj = mock.Mock() mock_obj.communicate.side_effect = [output for (output, status) @@ -153,7 +154,7 @@ def test_build_pdf_latex_failures(self): with build_env: built_docs = task.build_docs() - self.assertEqual(self.mocks.popen.call_count, 5) + self.assertEqual(self.mocks.popen.call_count, 6) self.assertTrue(build_env.failed) def test_build_pdf_latex_not_failure(self): @@ -182,6 +183,7 @@ def test_build_pdf_latex_not_failure(self): (('Output written on foo.pdf', ''), 1), # latex (('', ''), 0), # makeindex (('', ''), 0), # latex + (('', ''), 0), # latex ] mock_obj = mock.Mock() mock_obj.communicate.side_effect = [output for (output, status) @@ -192,5 +194,5 @@ def test_build_pdf_latex_not_failure(self): with build_env: built_docs = task.build_docs() - self.assertEqual(self.mocks.popen.call_count, 5) + self.assertEqual(self.mocks.popen.call_count, 6) self.assertTrue(build_env.successful)