-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
It doesn't seem to be the case, opening it is nice but when you run a script you rather want to write the pdf somewhere silently. I would do something like that:
function makepdf(latex)
dirname = "$(tempname()).d"
mkdir(dirname)
texname = joinpath(dirname, "document.tex")
pdfname = joinpath(dirname,"document.pdf")
open(texname, "w") do file
write(file, latex)
end
cd(dirname) do
for i in 1:2
output = readall(`pdflatex -shell-escape -halt-on-error $texname`)
contains("Error:", output) && println(output)
end
end
pdfname
end
function writepdf(latex,filename)
pdfname = makepdf(latex)
cp(pdfname,filename,remove_destination=true)
nothing
end
function openpdf(latex)
pdfname = makepdf(latex)
if OS_NAME == :Windows
command = "cmd /K start \"\" $pdfname"
CreateProcess(command)
else
spawn(`open $pdfname`)
end
pdfname
endI can do a PR if you want.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels