Skip to content

Commit

Permalink
Merge branch 'master' into latex_xelatex_math
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu authored Aug 11, 2024
2 parents e0b4789 + 9d3087c commit b7983ae
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ Bugs fixed
* #12714: LaTeX: Let ``\mathbf{\Lambda}`` work as expected if
:confval:`latex_engine` is ``'xelatex'`` or ``'lualatex'``, via usage
of ``unicode-math`` with XITS Math font.
* #12717: LaTeX: let :option:`-q <sphinx-build -q>` (quiet) option for
:program:`sphinx-build -M latexpdf` or :program:`make latexpdf` (``O=-q``)
get passed to :program:`latexmk`. Let :option:`-Q <sphinx-build -Q>`
(silent) apply as well to the PDF build phase.
Patch by Jean-François B.

Testing
-------
Expand Down
29 changes: 28 additions & 1 deletion sphinx/cmd/make_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,34 @@ def build_latexpdf(self) -> int:
raise RuntimeError('Invalid $MAKE command: %r' % makecmd)
try:
with chdir(self.builddir_join('latex')):
return subprocess.call([makecmd, 'all-pdf'])
if '-Q' in self.opts:
with open('__LATEXSTDOUT__', 'w') as outfile:
returncode = subprocess.call([makecmd,
'all-pdf',
'LATEXOPTS=-halt-on-error',
],
stdout=outfile,
stderr=subprocess.STDOUT,
)
if returncode:
print('Latex error: check %s' %
self.builddir_join('latex', '__LATEXSTDOUT__')
)
elif '-q' in self.opts:
returncode = subprocess.call(
[makecmd,
'all-pdf',
'LATEXOPTS=-halt-on-error',
'LATEXMKOPTS=-silent',
],
)
if returncode:
print('Latex error: check .log file in %s' %
self.builddir_join('latex')
)
else:
returncode = subprocess.call([makecmd, 'all-pdf'])
return returncode
except OSError:
print('Error: Failed to run: %s' % makecmd)
return 1
Expand Down

0 comments on commit b7983ae

Please sign in to comment.