-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
639f276
commit 6f6de2b
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module PGFPlotsXPlots | ||
|
||
using ..Weave, ..PGFPlotsX | ||
|
||
Base.showable(m::MIME"text/latex", plot::PGFPlotsX.AxisLike) = true | ||
Base.showable(m::MIME"text/tikz", plot::PGFPlotsX.AxisLike) = true | ||
|
||
function Base.display(report::Weave.Report, m::MIME"text/latex", figure::PGFPlotsX.AxisLike) | ||
|
||
chunk = report.cur_chunk | ||
|
||
ext = chunk.options[:fig_ext] | ||
dpi = chunk.options[:dpi] | ||
|
||
full_name, rel_name = Weave.get_figname(report, chunk, ext = ext) | ||
|
||
pgfsave(full_name, figure; include_preamble = true, dpi = dpi) | ||
|
||
push!(report.figures, rel_name) | ||
report.fignum += 1 | ||
return full_name | ||
end | ||
|
||
function Base.display(report::Weave.Report, m::MIME"text/tikz", figure::PGFPlotsX.AxisLike) | ||
|
||
chunk = report.cur_chunk | ||
|
||
ext = chunk.options[:fig_ext] | ||
dpi = chunk.options[:dpi] | ||
|
||
full_name, rel_name = Weave.get_figname(report, chunk, ext = ext) | ||
|
||
pgfsave(full_name, figure; include_preamble = false, dpi = dpi) | ||
|
||
push!(report.figures, rel_name) | ||
report.fignum += 1 | ||
return full_name | ||
end | ||
|
||
end # PGFPlotsXPlots |