@@ -101,14 +101,9 @@ const DOCUMENT_STRUCTURE = (
101
101
" subparagraph" ,
102
102
)
103
103
104
- # https://github.com/JuliaLang/julia/pull/32851
105
- function mktempdir (args... ; kwargs... )
106
- return Base. mktempdir (args... ; cleanup= false , kwargs... )
107
- end
108
-
109
104
function render (doc:: Documents.Document , settings:: LaTeX = LaTeX ())
110
105
@info " LaTeXWriter: creating the LaTeX file."
111
- Base . mktempdir () do path
106
+ mktempdir () do path
112
107
cp (joinpath (doc. user. root, doc. user. build), joinpath (path, " build" ))
113
108
cd (joinpath (path, " build" )) do
114
109
fileprefix = doc. user. sitename
@@ -150,7 +145,7 @@ function render(doc::Documents.Document, settings::LaTeX=LaTeX())
150
145
# Debug: if DOCUMENTER_LATEX_DEBUG environment variable is set, copy the LaTeX
151
146
# source files over to a directory under doc.user.root.
152
147
if haskey (ENV , " DOCUMENTER_LATEX_DEBUG" )
153
- dst = isempty (ENV [" DOCUMENTER_LATEX_DEBUG" ]) ? mktempdir (doc. user. root) :
148
+ dst = isempty (ENV [" DOCUMENTER_LATEX_DEBUG" ]) ? mktempdir (doc. user. root; cleanup = false ) :
154
149
joinpath (doc. user. root, ENV [" DOCUMENTER_LATEX_DEBUG" ])
155
150
sources = cp (pwd (), dst, force= true )
156
151
@info " LaTeX sources copied for debugging to $(sources) "
@@ -179,7 +174,7 @@ function compile_tex(doc::Documents.Document, settings::LaTeX, fileprefix::Strin
179
174
piperun (` latexmk -f -interaction=nonstopmode -view=none -lualatex -shell-escape $(fileprefix) .tex` , clearlogs = true )
180
175
return true
181
176
catch err
182
- logs = cp (pwd (), mktempdir (); force= true )
177
+ logs = cp (pwd (), mktempdir (; cleanup = false ); force= true )
183
178
@error " LaTeXWriter: failed to compile tex with latexmk. " *
184
179
" Logs and partial output can be found in $(Utilities. locrepr (logs)) ." exception = err
185
180
return false
@@ -192,7 +187,7 @@ function compile_tex(doc::Documents.Document, settings::LaTeX, fileprefix::Strin
192
187
piperun (` $(tectonic) -X compile --keep-logs -Z shell-escape $(fileprefix) .tex` , clearlogs = true )
193
188
return true
194
189
catch err
195
- logs = cp (pwd (), mktempdir (); force= true )
190
+ logs = cp (pwd (), mktempdir (; cleanup = false ); force= true )
196
191
@error " LaTeXWriter: failed to compile tex with tectonic. " *
197
192
" Logs and partial output can be found in $(Utilities. locrepr (logs)) ." exception = err
198
193
return false
@@ -212,7 +207,7 @@ function compile_tex(doc::Documents.Document, settings::LaTeX, fileprefix::Strin
212
207
piperun (` docker cp latex-container:/home/zeptodoctor/build/$(fileprefix) .pdf .` )
213
208
return true
214
209
catch err
215
- logs = cp (pwd (), mktempdir (); force= true )
210
+ logs = cp (pwd (), mktempdir (; cleanup = false ); force= true )
216
211
@error " LaTeXWriter: failed to compile tex with docker. " *
217
212
" Logs and partial output can be found in $(Utilities. locrepr (logs)) ." exception = err
218
213
return false
0 commit comments