How could I add a folder to the search path of tikz?
More precisely, I have a structure like this (see below for exact content):
mycachedfiles/a.tex
myinput.tex
tikzlibrarymy.test.code.tex
I’d like to compile it using:
cd mycachedfiles
pdflatex a.tex
However, if myinput.tex contains \usetikzlibrary{my.test}, then I will get an error like:
! Package tikz Error: I did not find the tikz library 'my.test'. I looked for f
iles named tikzlibrarymy.test.code.tex and pgflibrarymy.test.code.tex, but neit
her could be found in the current texmf trees..
I tried to play with \subimport, \input@path… without success. Any idea?
MWE
% a.tex:
\documentclass[]{article}
\makeatletter
% Works for \input{} but not for \usetikzlibrary
\def\input@path{{..}}
\makeatother
% Not working:
% \input{../myinput.tex}
% Not better:
\usepackage{import}%
\subimport{../}{myinput.tex}%
\begin{document}
\begin{tikzpicture}
\node[my test style]{A};
\end{tikzpicture}
\end{document}
% myinput.tex
\usepackage{tikz}
\usetikzlibrary{my.test}
% tikzlibrarymy.test.code.tex:
\tikzset{
my test style/.style={
draw,
circle,
fill=red,
}
}
\input@pathaffects\inputbut not\@@input, tryTEXINPUTS. (that having said I believe there hasn't been something that explains what's the difference between the 2 above and e.g.\l_file_search_path_seq,graphicpathetc.) – user202729 May 09 '23 at 14:18\input{correct/path/to/file}– user202729 May 10 '23 at 02:13