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 @@ -49,6 +49,11 @@ Bugs fixed
49
49
Patch by Hugo van Kemenade.
50
50
* #12645: Correctly support custom gettext output templates.
51
51
Patch by Jeremy Bowman.
52
+ * #12717: LaTeX: let :option: `-q <sphinx-build -q> ` (quiet) option for
53
+ :program: `sphinx-build -M latexpdf ` or :program: `make latexpdf ` (``O=-q ``)
54
+ get passed to :program: `latexmk `. Let :option: `-Q <sphinx-build -Q> `
55
+ (silent) apply as well to the PDF build phase.
56
+ Patch by Jean-François B.
52
57
53
58
Testing
54
59
-------
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