Skip to content

Commit

Permalink
Pass limit_to and include_preamble to TIKZ as well.
Browse files Browse the repository at this point in the history
The TIKZ constructor supports setting limit_to and include_preamble now
too.
  • Loading branch information
H-M-H committed Jan 9, 2021
1 parent 2b5537d commit 6349750
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/PGFPlots.jl
Expand Up @@ -896,7 +896,16 @@ function save(filename::AbstractString, o::Plottable; include_preamble::Bool=tru
save(TEX(filename, include_preamble=include_preamble), plot(o))
end
elseif ext == ".tikz"
save(TIKZ(filename), plot(o))
# limit_to and include_preamble require TikzPictures v3.3.2; only use if not default
if limit_to != :default
save(TIKZ(filename; limit_to=limit_to), plot(o))
else
if !include_preamble
save(TIKZ(filename; include_preamble=include_preamble), plot(o))
else
save(TIKZ(filename), plot(o))
end
end
elseif ext == "." || ext == ""
error("You must specify a file extension.")
else
Expand Down

0 comments on commit 6349750

Please sign in to comment.