I have a standalone mytikz.tikz picture which loads test.png. Both reside in the folder pics/. My main.tex, which uses tikzscale to load mytikz.tikz, is in the parent folder. Loading the test.png fails, when compiling main.tex, as the path is wrong. Somehow main.tex needs to know about the pics/ path. How do I achieve this, while still keeping the standalone functionality?
A similar problem arises, if e.g. common color definitions are used, say in pics/mycolors.tex, which are then loaded in mytikz.tikz via \input{mycolors.tex}.
The matter is further complicated, when trying to plot data from a file in pics/. How do I convey the correct path name to main.tex in this case?
Contents of main.tex:
%main.tex \documentclass{book} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{tikzscale} \usepackage{standalone} \begin{document} \begin{figure} \includegraphics[width=\textwidth]{pics/mytikz.tikz} \caption{includegraphics full width} \label{fig:tikz} \end{figure} \end{document} Contents of pics/mytikz.tikz:
%mytikz.tikz \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{tikzscale} %\input{mycolors.tex} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=-1,xmax=1,ymin=-1,ymax=1, ] \addplot graphics [ xmin=0,xmax=1,ymin=0,ymax=1, ] {test.png}; \end{axis} \end{tikzpicture} \end{document}
currfile, but it is not working yet. Maybe someone can give an example for this?\grapicspathform graphics (see p.10 of grfguide.pdf).\graphicspath{pics/}inmain.tex? That does not work for me, same error of not findingtest.png.\graphicspath{{./}{pics/}}(it is a list of paths).pics/?