Closed Painkilla closed 2 years ago
Hey, this seems like a complex setup. Can you please provide a full example that demonstrates the problem?
execute make cld-exm-thr-hyb-cmp-one-max-emce within the ./templates directory from this repo https://gitlab.com/omn-dev-team/conf/-/tree/painkilla/templates
the graphicscache package needs to be activated at /conf/main/common/package.tex first (Uncomment right at the top) The graphicscache.sty is at /conf/main/graphicscache.sty with my first attempts to hard code the directory and to remove the dependency from tikz by changing the renewcommand to something new. The current state is NOT working.
It is maybe a slightly confusing setup to understand. This is only a "conf" repo used within many other repos to achieve homogeneous output files. The templates directory is only a "sneak peak" what is possible and certainly not a productive file. The confusing command from the make is explained (in german) in Build.md. It is used to build different versions of the same file according to the needs of the student. Some repos currently contain more than 200 questions and many pictures (and increasing) and the buildtime and filesize totally exploded.
Yeah, it would be helpful if you could reduce it down to a single .tex
file, maybe including a single .tikz
file to demonstrate the problem. Otherwise I have to drill down into your build process, which looks quite complicated ;)
okay, i try to make a mwe.
I created a mwe on the graphicscache branch on the conf repo: https://gitlab.com/omn-dev-team/conf/-/tree/graphicscache
Steps to reproduce:
Steps to generate only with tikzexternalize
Steps to generate only with graphicscache
Is it possible to add something like a compatible to tikz option where the includegraphics command is not overwritten, maybe rather a new command, maybe includecachedgraphics is defined. Looking into the logs it seams there is a problem with exactly this command. It is very easy to change in al repos the includegraphics command against the new includecachedgraphics command with search and replace.
As mentioned in the other thread a path=/conf/tmp Option to change the temporary path would be really helpful to keep the repo clean.
I am sorry, but unfortunately i could not reduce it any further since including files from different locations and using it in combination with make and latexmk is crucial for this repo.
I followed your steps to reproduce the problem and for me everything works. So probably it's an issue that is version-specific. What kind of Linux distribution are you using?
ah sorry, I was using the wrong branch. Now I could reproduce it.
Ok, I managed to track the problem down.
\tikzsetexternalprefix{tikz/}
, which results in pdflatex
being called for each figure XYZ with the -jobname tikz/XYZ
option.-output-directory="conf/tmp"
, it creates the output pdf, log, aux files for the figure in conf/tmp/tikz/
.ifplatform
package to decide whether we are on Windows or Linux. On Linux, it tries to execute uname -s > \jobname.w18
, which expands to uname -s > tikz/XYZ.w18
. Since shell commands are run in the current directory, not conf/tmp
, this fails since there is no tikz
directory to create the XYZ.w18
file in.Possible solutions:
tikz
directory in the place where pdflatex
is executed. That fixes the problem for me.\tikzsetexternalprefix{tikz/}
. Also fixes the problem for me.\tikzsetexternalprefix{tikz/}
with -output-directory="conf/tmp/tikz"
in tikz.tex
). I couldn't make that work right now for some reason.\usepackage{graphicscache}
, set \jobname
to something without slashes. After the \usepackage
, reset it to the initial value. Haven't tried this.Anyway, this is a problem with the way you patched TikZ to output its files to another directory and the ifplatform
package. I cannot think of a good way to deal with this inside graphicscache
. If you have a suggestion, please comment. Otherwise I'm going to close this issue.
(Global suggestion: It might be better to think of a way to avoid the -output-directory
option altogether. Maybe you can symlink your main tex file into the conf/tmp
directory and run pdflatex
there? With TEXINPUTS
set to the main directory it could work...)
Hi, thank you for your help!
with your help i managed to get everything to work. graphicscache is now at /conf/tmp/graphicscache tikz is now at /conf/tmp/tikz
I used this super dirty symlink hack: i placed at /conf/tmp/tikz/conf/tmp/tikz a symlink to ./../../../tikz So in the first run the images are placed at /conf/tmp/tikz/conf/tmp/tikz which is due to the symlink equal to /conf/tmp/tikz. The \tikzsetexternalprefix{conf/tmp/tikz/} command then looks then only in the lower path and everything is fine.
This is not very clean but who will look into a tmp folder if everything is super clean? Whereas a tikz folder in the main repo makes me uncomfortable.
I use tikzexternalize to reduce buildtime for TikZ, now i want to use graphicscache to reduce file size and build time of pictures as well. I dont´t know how this may interfere with #12 , so i started a different issue. It may be merged if necessary. My execution command:
latexmk -f -pdf -synctex=1 -interaction=nonstopmode -output-directory='./conf/tmp/' '$./conf/main/main.tex'
From my /conf/main/main.tex i use this configuration to achieve that tikz uses a directory within my output-directory.
My latexmkrc is custom to be able to achieve this and located in the top directory
the last lines from the log /conf/tmp/tikz/main-figure0.log say
The figures are not build correctly.
Whereas here is the output from the Build without graphicscache say:
The figures are build correct again.