1

I am using use textblock with tikz.

If I change the x,y values of \node (Point) at (xcm,ycm) the image position does not change?

Example: (x=12, y = 13) or (x = 2, y = 5) display same position of the image

Thank in advance.

My minimal coding:

\documentclass{article}
\usepackage[absolute,overlay]{textpos}
\usepackage{xcolor}
\usepackage{tikz} 
\usetikzlibrary{positioning}
\begin{document}

\begin{textblock*}{5cm}(2cm,5.0cm)
\begin{center}
\tikz% image and letters are inserted in nodes
{
\node (Point) at (12cm,13cm) [font=\large, text=black] {\includegraphics[height=2.5cm]{example-image-duck}};
\node [font=\sffamily\small,below=35mm of Point.north] {\includegraphics[height=0.5cm]{example-image-a}};
}
\end{center}
\end{textblock*}

\end{document}

Please help

  • 1
    You position the second node below=35mm of the first one. If you change the coordinates of the first one, there won't be an effect simple because this will lead to another bounding box. If you want to change the something, either change the relative positioning of the nodes or add coordinates, or both. What do you want to achieve? – Schrödinger's cat Jan 26 at 1:49
  • 2
    If you use e.g. \path (-4,4); \node (Point) [font=\large, text=black] {\includegraphics[height=2.5cm]{example-image-duck}}; \node [font=\sffamily\small,below=35mm of Point.north] {\includegraphics[height=0.5cm]{example-image-a}}; for the contents of the tikzpicture, you will see that it moves. – Schrödinger's cat Jan 26 at 1:51
2

enter image description here

A rough look at how the coord system is working -- x and y are being varied for the text block --irrespective of the node(s) the block will move to all 4 corners of the page-- in the last image at x=7,y=10 the example image A is moved relative to the duck--the coord of the node point has no effect since it is held by the text block itself

\documentclass{article}
\usepackage[absolute,overlay]{textpos}
\usepackage{xcolor}
\usepackage{tikz} 
\usetikzlibrary{positioning}
\begin{document}

\begin{textblock*}{5cm}(2cm,5.0cm)
\begin{center}
\tikz% image and letters are inserted in nodes
{
\node (Point) at (12cm,13cm) [font=\large, text=black] {\includegraphics[height=2.5cm]{example-image-duck}};
\node [font=\sffamily\small,below=35mm of Point.north] {\includegraphics[height=0.5cm]{example-image-a}};
}
\end{center}x=2,y=5
\end{textblock*}
\begin{textblock*}{5cm}(12cm,5.0cm)
\begin{center}
\tikz% image and letters are inserted in nodes
{
\node (Point) at (12cm,13cm) [font=\large, text=black] {\includegraphics[height=2.5cm]{example-image-duck}};
\node [font=\sffamily\small,below=35mm of Point.north] {\includegraphics[height=0.5cm]{example-image-a}};
}
\end{center}x=12,y=5
\end{textblock*}
\begin{textblock*}{5cm}(12cm,15.0cm)
\begin{center}
\tikz% image and letters are inserted in nodes
{
\node (Point) at (12cm,13cm) [font=\large, text=black] {\includegraphics[height=2.5cm]{example-image-duck}};
\node [font=\sffamily\small,below=35mm of Point.north] {\includegraphics[height=0.5cm]{example-image-a}};
}
\end{center}x=12,y=15
\end{textblock*}
\begin{textblock*}{5cm}(2cm,15.0cm)
\begin{center}
\tikz% image and letters are inserted in nodes
{
\node (Point) at (12cm,13cm) [font=\large, text=black] {\includegraphics[height=2.5cm]{example-image-duck}};
\node [font=\sffamily\small,below=35mm of Point.north] {\includegraphics[height=0.5cm]{example-image-a}};
}
\end{center}x=2,y=15
\end{textblock*}
\begin{textblock*}{5cm}(7cm,10.0cm)
\begin{center}
\tikz% image and letters are inserted in nodes
{
\node (Point)  [font=\large, text=black] {\includegraphics[height=2.5cm]{example-image-duck}};
\node [font=\sffamily\small,below=12cm of Point.north] {\includegraphics[height=0.5cm]{example-image-a}};
}

\end{center}x=7,y=10 node point coord removed and example-image-a at 12cm below node point 
\end{textblock*}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.