support tex in pgfplots; closes #637
This commit is contained in:
parent
57840a37d0
commit
7d66c502f4
@ -314,12 +314,18 @@ function _show(io::IO, mime::MIME"application/pdf", plt::Plot{PGFPlotsBackend})
|
|||||||
PGFPlots.save(PGFPlots.PDF(fn), pgfplt)
|
PGFPlots.save(PGFPlots.PDF(fn), pgfplt)
|
||||||
|
|
||||||
# read it into io
|
# read it into io
|
||||||
write(io, readall(open(fn)))
|
write(io, readstring(open(fn)))
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
PGFPlots.cleanup(plt.o)
|
PGFPlots.cleanup(plt.o)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _show(io::IO, mime::MIME"application/x-tex", plt::Plot{PGFPlotsBackend})
|
||||||
|
fn = tempname()*".tex"
|
||||||
|
PGFPlots.save(fn, backend_object(plt), include_preamble=false)
|
||||||
|
write(io, readstring(open(fn)))
|
||||||
|
end
|
||||||
|
|
||||||
function _display(plt::Plot{PGFPlotsBackend})
|
function _display(plt::Plot{PGFPlotsBackend})
|
||||||
# prepare the object
|
# prepare the object
|
||||||
pgfplt = PGFPlots.plot(plt.o)
|
pgfplt = PGFPlots.plot(plt.o)
|
||||||
|
|||||||
@ -154,6 +154,7 @@ const _mimeformats = Dict(
|
|||||||
"application/postscript" => "ps",
|
"application/postscript" => "ps",
|
||||||
"image/svg+xml" => "svg",
|
"image/svg+xml" => "svg",
|
||||||
"text/plain" => "txt",
|
"text/plain" => "txt",
|
||||||
|
"application/x-tex" => "tex",
|
||||||
)
|
)
|
||||||
|
|
||||||
const _best_html_output_type = KW(
|
const _best_html_output_type = KW(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user