Enable the limit_to argument from TikzPictures v3.2.0. #152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The latest release of TikzPictures.jl offers the possibility to optionally omit the
document
andtikzpicture
environments. The first of these environments could already be omitted in earlier versions of TikzPictures, by settingìnclude_preamble=false
. Omitting thetikzpicture
is a new feature, which can be useful when embedding the generated TEX files in a larger document: JuliaTeX/TikzPictures.jl#56This PR is bringing the new feature of TikzPictures to PGFPlots.jl. Backwards compatibility to earlier versions of TikzPictures is maintained.
Having the new TikzPictures v3.2.0
TEX files can omit the
document
environment by setting eitherinclude_preamble=false
(like in earlier versions) or by equivalently settinglimit_to=:picture
. If thetikzpicture
environment should also be omitted, you can setlimit_to=:data
.Let us pin TikzPictures.jl to the new version and test the new feature:
Having TikzPictures v3.1.0 (or older)
With earlier versions of TikzPictures,
PGFPlots.save
works just like before if no keyword argument is given, or if onlyinclude_preamble
is specified.This behaviour is achieved by only delegating the new
limit_to
argument if it is actually specified by the user.Let us pin TikzPictures to an earlier version (don't forget to
] free TikzPictures
afterwards).If
PGFPlots.save
breaks from alimit_to
specification, it tells the user that the correspondingTikzPictures
function does not exist. The message thus hints to the version problem and suggests to useinclude_preamble
instead.Due to this behaviour, we do not need to make TikzPictures >= v3.2.0 a hard requirement in the
Project.toml
. If a later version of TikzPictures is installed in the user environment (e.g. by] up
), the new feature will work. If it is not, it won't, butinclude_preamble
is a working fallback solution.