how can I make the sum of 2 variables in cm? Example: \y+ \n \x + \m
Thank in advance
Minimal coding:
\documentclass{article}
\usepackage[absolute,overlay]{textpos}
\usepackage{xcolor}
\newcommand*{\x}{0.5cm}
\newcommand*{\y}{2.0cm}
\newcommand*{\m}{1.5cm}
\newcommand*{\n}{2.5cm}
\begin{document}
\title{Texblock color}
\textblockcolour{cyan}
\begin{textblock*}{5cm}(2cm,10cm)
123
\end{textblock*}
\textblockcolour{red}
\begin{textblock*}{5cm}(\x,\y+\n)
456
\end{textblock*}
\textblockcolour{yellow}
\begin{textblock*}{5cm}(\x+\m,16cm)
789
\end{textblock*}
\end{document}


\y+\nwith\dimexpr\y+\nor stay with\y+\nand use thecalcpackage. Either way, I'd be careful with single letter commands, see also: https://tex.stackexchange.com/q/316391/134144 – leandriis Oct 27 '19 at 11:51\newlengthrather than\newcommand. – cfr Oct 27 '19 at 17:57\newlengthis likely a better choice than\newcommand. – cfr Oct 27 '19 at 21:39