I want to create the following tikzpicture:
I want the rectangle that fits around the example-image and nodes 2 and 3 to be, say, 0.6\textwidth wide.
Moreover, I want nodes 1 and 2 to be one adjacent to the other but centered inside this rectangle.
I came across this answer from 2012 where Peter Grill says that in his opinion it doesn't make sense to specify the height or width of a tikzpicture.
I agree with that to some extent but I don't want to wrap my tikzpicture inside a resizebox.
What I have now is this:
% !TEX TS-program = pdflatex
\documentclass{article}
\usepackage{tikz,lipsum}
\usetikzlibrary{positioning,fit}
\begin{document}
\lipsum[1]
\vskip 10pt
\noindent
\begin{tikzpicture}
\node(n0) [draw=black,outer sep=0pt] {node 1};
\node (n1) [below right = 1pt and 0pt of n0.south west,outer sep=0pt] {\includegraphics[width=0.3\textwidth]{example-image}};
\node (n2) [below right = 10pt and 20pt of n1,draw=black] {node 2};
\node (n3) [right = 1pt of n2,draw=black] {node 3};
\node (n4) [below left = 0pt and 130pt of n3.south west,outer sep=0pt,draw=black] {node 4};
%draw a rectangle as the border
\nodedraw, fit=(n1) (n3),inner sep=0pt {};
\end{tikzpicture}
\end{document}
Any suggestion would be very welcome.



.6\textwidth? Or do you just want the picture to have a specific width centered around a point? What about the drawn line? It will add half the line width on both sides to the final width of the TikZ picture. – Qrrbrbirlbel Mar 14 '23 at 09:32.6\textwidth; Well yes, I forgot this small detail about the addition of half the line width on both sides. Then I guess I can make the drawn rectangle to be0.6textwidth minus edge widthor something similar. – tush Mar 14 '23 at 10:02n1node is further away from the center ofn2andn3than.3\textwidth? – Qrrbrbirlbel Mar 14 '23 at 13:59tikzpicturewould occupy on the page a width of this "further away distance" +.6\textwidth. – tush Mar 14 '23 at 14:04