Skip to content

Run pdflatex three times during PDF build #1583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions readthedocs/doc_builder/backends/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions readthedocs/rtd_tests/tests/test_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down Expand Up @@ -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)
Expand All @@ -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)