I have a command \entry which places two tikz-nodes next to each other. How can I make sure both nodes always have the same height (while also keeping the vertical centering of the text inside)?
Also, how come the right node extends the \linewidth, if both nodes together (0.25\linewidth+0.75\linewidth) should be equal to exactly one \linewidth? I would expect the total width of both nodes to be equal to the text width of the bottom text. How would I fix that?
MWE:
\documentclass[
12pt,
parskip=half,
]{scrartcl}
\usepackage[
a4paper,
left=25mm,
right=20mm,
top=25mm,
bottom=30mm,
showframe,
]{geometry}
\usepackage{blindtext}
% Font
\usepackage{inconsolata}
\usepackage[T1]{fontenc}
\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif
\usepackage{tikz}
\usetikzlibrary{positioning}
\definecolor{colour-a}{HTML}{eefaea}
\definecolor{colour-b}{HTML}{e8f4f2}
\newcommand\entry[2]{%
\begin{tikzpicture}
\node(node-a)[fill=colour-a, text width=0.25\linewidth] {
\textbf{#1}
};
\node(node-b)[fill=colour-b, right=0pt of node-a, align=left, text width=0.75\linewidth]{
#2
};
\draw[thick] (node-b.south west)--(node-b.north west);
\end{tikzpicture}
\par % end of previous paragraph
%\vspace*{1ex}% optional vertical space in between
}
\begin{document}
\entry{%
test1
}{
test1
}
\entry{%
test2 \\
test2 \\
test2 \\
}{
test2
}
\entry{%
test3
}{
test3 \\
test3 \\
test3 \\
}
\entry{%
test4
}{
\footnotesize \blindtext
}
\textbf{Bottom Text}: \\
\blindtext
\end{document}





text widthtwice theinner xsepgets added. Re Same height: Potentially Q107227. Re Vertical alignment: Potentially Q139719 (but I don't think you actually want that?) – Qrrbrbirlbel Oct 16 '22 at 09:01backgroundlayer. – Qrrbrbirlbel Oct 16 '22 at 09:25tcolorboxornicematrixbut I don't use those packages myself. You could also just use atabularwith one vertical line and\cellcolor. – Qrrbrbirlbel Oct 16 '22 at 10:04