File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,11 @@ Bugs fixed
65
65
* #12714: LaTeX: Let ``\mathbf{\Lambda} `` work as expected if
66
66
:confval: `latex_engine ` is ``'xelatex' `` or ``'lualatex' ``, via usage
67
67
of ``unicode-math `` with XITS Math font.
68
+ * #12717: LaTeX: let :option: `-q <sphinx-build -q> ` (quiet) option for
69
+ :program: `sphinx-build -M latexpdf ` or :program: `make latexpdf ` (``O=-q ``)
70
+ get passed to :program: `latexmk `. Let :option: `-Q <sphinx-build -Q> `
71
+ (silent) apply as well to the PDF build phase.
72
+ Patch by Jean-François B.
68
73
69
74
Testing
70
75
-------
Original file line number Diff line number Diff line change @@ -106,7 +106,34 @@ def build_latexpdf(self) -> int:
106
106
raise RuntimeError ('Invalid $MAKE command: %r' % makecmd )
107
107
try :
108
108
with chdir (self .builddir_join ('latex' )):
109
- return subprocess .call ([makecmd , 'all-pdf' ])
109
+ if '-Q' in self .opts :
110
+ with open ('__LATEXSTDOUT__' , 'w' ) as outfile :
111
+ returncode = subprocess .call ([makecmd ,
112
+ 'all-pdf' ,
113
+ 'LATEXOPTS=-halt-on-error' ,
114
+ ],
115
+ stdout = outfile ,
116
+ stderr = subprocess .STDOUT ,
117
+ )
118
+ if returncode :
119
+ print ('Latex error: check %s' %
120
+ self .builddir_join ('latex' , '__LATEXSTDOUT__' )
121
+ )
122
+ elif '-q' in self .opts :
123
+ returncode = subprocess .call (
124
+ [makecmd ,
125
+ 'all-pdf' ,
126
+ 'LATEXOPTS=-halt-on-error' ,
127
+ 'LATEXMKOPTS=-silent' ,
128
+ ],
129
+ )
130
+ if returncode :
131
+ print ('Latex error: check .log file in %s' %
132
+ self .builddir_join ('latex' )
133
+ )
134
+ else :
135
+ returncode = subprocess .call ([makecmd , 'all-pdf' ])
136
+ return returncode
110
137
except OSError :
111
138
print ('Error: Failed to run: %s' % makecmd )
112
139
return 1
You can’t perform that action at this time.
0 commit comments