I'm using XeLaTeX to draw a sticker header with TikZ, using two images and some text. I want to define the height of those images based on the height of the text node, which is defined according to the lines of text. For instance, if the height of the text node is 2cm, the height of both images should be 2cm.
I tried to use let
to extract the y-coordinate based on this calculation:
\path let \p1 = ($(text.north west) - (text.south west)$) in node ...
But it didn't work (I'm not sure if that's a valid approach, or if I used the syntax incorrectly).
So, what should I do to achieve what I'm trying to do?
Here's a MWE of what I'm trying to do (it doesn't have the above instruction):
\documentclass{article}
\usepackage{geometry}
\geometry{paperwidth=10cm,paperheight=1.5cm}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[remember picture, overlay]
\node[anchor=north, font=\bfseries, align=flush center] (text) at ($(current page.north) + (0,-0.25)$) {This is the first line\\This is the second one};
\node[anchor=east, inner sep=0pt] (image) at ($(text.west) + (-1.25,0)$) {\includegraphics[height=1cm]{example-image}};
\node[anchor=west, inner sep=0pt] (image) at ($(text.east) + (1.25,0)$) {\includegraphics[height=1cm]{example-image}};
\end{tikzpicture}
\end{document}
The output of the given file is this:
Any help will be appreciated!