-
Notifications
You must be signed in to change notification settings - Fork 12
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
Including multiple svg files with equal file names but stored in different folders #11
Comments
ah I guess I could use the option |
although .. having the generated pdf(_tex) files in a single directory is quite elegant since this directory can then later be deleted to save storage. |
That's a very charming idea. I will try to implement that in the next version. |
In my workflow, I often replace svg files (that are auto generated with my own tools). Edit. I just noticed, that it is unnecessary to delete the svg-inkscape folder because of updated svgs: The detection is already done via the modified date 😍 . |
The thing is that one can have identical svg files in different locations each referencing external image files via relative paths. In this case, the svg files can produce different-looking images even though their hashes are identical. So, one would need to preprocess the svg files by replacing relative paths with absolute ones before computing the hashes, or compute hashes of these linked files as well. I would say it's not worth the extra trouble. |
You're right, I was not thinking about referencing external files! |
This would mean that old versions in One workflow that has not been mentioned here before is editing the However, just using the file path hash as the file name in |
That's exactly how I would implement it, appending the path hash to the file name. As I said before, however, I unfortunately lack the time to work on it right now. |
As temporary workaround (not that flexible) I am using the passed image file path. \makeatletter
\newcommand{\includesvggraphics}[2][\textwidth]{%
\filename@parse{#2}%
\includesvg[inkscapepath=svg-inkscape/\filename@area,width=#1]{#2}%
}
\makeatother Usage: \includesvggraphics{experiments/datasets/mnist.svg}
% or
\includesvggraphics[.5\textwidth]{experiments/datasets/mnist.svg} Output:
Maybe it will help someone until the hash solution is implemented. |
A useful workaround though I won't implement this variant, since this wouldn't work with absolute or relative paths---pointing to folders outside the project directory. |
How about just appending a number to the end of the file counting its usage by path since the paths are unique for different images? |
The following snippet
produces one single file pair
which is then embedded twice.
Is there a way of preventing this behavior?
The text was updated successfully, but these errors were encountered: