Actually, I just tried to copy a figure from my document to another template (mdpi template https://www.overleaf.com/latex/templates/mdpi-article-template/fcpwsspfzsph). I am aware that the template is quite problematic.
The simplified part I copy:
\begin{figure}[ht]
\begin{tikzpicture}
\begin{scope}[ x={(image.south east)},y={(image.north west)}]
\node at (0.5,0.5) { \includegraphics[width=1\columnwidth]{figures/figure.png}};
%% HERE WILL BE SOME NOTATIONS/ETC (I USE THE COORDINATE SYSTEM TO DRAW THEM ON TOP OF THE IMAGE)
%% AND GRID that are commented
% \draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
% \draw[help lines,xstep=.05,ystep=.05] (0,0) grid (1,1);
% \foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }
% \foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y};}
\end{scope}
\end{tikzpicture}
\caption{Test figure.}
\label{fig:figure1}
\end{figure}
When I try to compile it, I receive quite an unexpected error to the line \begin{scope}[ x={(image.south east)},y={(image.north west)}]
namely Package pgf Error: "No shape named 'image' is known"
for another templates, it works perfectly.
What might be a problem?
Thanks to all in advance. Best regards,
imagein your picture. Whay else did you expect? – Henri Menke Aug 16 '21 at 12:00node (image) at...and put this line before\begin{scope}... – Enevevet Aug 16 '21 at 12:04\begin{figure}\centering\includegraphics{figures/figure.png}\caption{...}\end{figure}. But if you want to draw something over the figures like in https://tex.stackexchange.com/a/9562/1952, then you need to put the image inside a node before thescopeenvironment. – Ignasi Aug 16 '21 at 12:12imagenode in the later picture. – Andrew Stacey Aug 16 '21 at 12:31imagein a previous picture. – Henri Menke Aug 16 '21 at 12:45node prefixkey can help). – Andrew Stacey Aug 16 '21 at 13:04