New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bounding box used by tikzexternalize doesn't include drop shadows #1296
Comments
Actually to enlarge bounding box you only need an invisible coordinate, so
If in your real document the scale and shifting of shadow is more dynamic or marking pictures using shadows may take too much effort, I can try to provide an automatic workaround. |
Thanks for the quick reply. Now I understand that the limitation is stated in the shadows doc (I hadn't found it so far). However, I still believe that from the point of view of a user of tikzexternalize, it is a bug: the pdf output with externalization is different from the pdf without. Even with the fix, the figures are now slightly larger when we switch off externalization, so the book layout may change. But if you know how to do it automatically I think it is worth it. |
Brief outline of the bug
When using drop shadows, Tikzexternalize doesn't seem to include the shadow in the bounding box used to externalize a picture: in the MWE some shadows disappear.
If you uncomment the \tikzexternalize line, you get a different (and correct) figure, so I assume it is a bug (either of shadows, or of tikzexternalize, or of whatever machinery that computes current bounding box).
For potential other victims: a temporary workaround is to manually add an invisible line that extends the current bounding box by the size of the drop shadow. See the MWE, too.
Our use case for tikzexternalize: we wrote a full book with several hundred beautiful tikz figures, and then the publisher demanded separate files for each figures... In this case tikzexternalize takes several hours to run but it saved the day.
Thanks for TikZ at large.
Minimal working example (MWE)
The text was updated successfully, but these errors were encountered: