Open tobiasBora opened 1 year ago
Similar: #565
A more general question: In LaTeX format, should pgf's
\pgfutil@IfFileExists
respect\input@path
as its LaTeX relative\IfFileExists
does? This would affect the loading of library/module,.table
files, and of course images.Originally posted by @muzimuzhi in https://github.com/pgf-tikz/pgf/issues/980#issuecomment-761167615
\input@path
is a LaTeXism and not portable across format.
Then wouldn't it be possible to define another variable for that? Or provide this functionality only for LaTeX?
Perhaps \pgfutil@IfFileExists
can be extended to take a list of directories, for example \pgfinputpath
, into consideration. Then in LaTeX format \pgfinputpath
can be initialized to \input@path
at some early stage in loading pgf
or tikz
package. In formats other than LaTeX \pgfinputpath
can be defined by user before pgf
or tikz
is loaded.
Update: also \pgfutil@InputIfFileExists
.
Brief outline of the bug
As far as I see, there is no way to add a folder to the search path of tikz. This becomes very annoying when importing a file in a subfolder that requires a custom tikz library, or when my custom libraries are not put at the root of my project.
More precisely, I have a structure like this (see below for exact content):
I’d like to compile it using:
However, if
myinput.tex
contains\usetikzlibrary{my.test}
, then I will get an error like:By default, LaTeX will try to search in folders listed in
\input@path
, so\input{tikzlibrarymy.test.code.tex}
would work… unfortunately\usetikzlibrary
gives an error without even trying to run the\input
.Minimal working example (MWE)
MWE