# How can I achieve textpos relative positioning in a document set to absolute positioning?

This is as close as I've got, but I can't work out how to do the calculation so that textblock accepts it:

\documentclass[11pt]{article}
\usepackage[paperheight=93.884mm,paperwidth=68.992mm,margin=0mm,heightrounded]{geometry}
\usepackage[absolute]{textpos}
\usepackage{zref-user}
\usepackage{zref-abspos}
\usepackage{calc}

\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}
\setlength{\parindent}{0pt}

\begin{document}

This is a document in absolute textpos mode, but I will also need to use relative positioning in it.

\zsavepos{test}
\def\dimtomm #1{\the\numexpr \dimexpr #1\relax*635/118407168\relax }
\begin{textblock}{59}(\dimtomm{\zposx{test}sp},93.884mm-\dimtomm{\zposy{test}sp})
% ! Illegal unit of measure (pt inserted)
I WANT THIS TEXTBLOCK TO BE POSITIONED RELATIVELY
\end{textblock}

\end{document}


You can't use dimensions with textblock. It expects to receive simple numbers corresponding to the numbers of horizontal and vertical units. But you are trying to feed it mm, I think, which won't work. (If you need to use dimensions, consider textblock*.)

Here's a working example:

\documentclass[11pt]{article}
\usepackage[paperheight=93.884mm,paperwidth=68.992mm,margin=0mm,heightrounded]{geometry}
\usepackage[absolute]{textpos}
\usepackage{zref-user}
\usepackage{zref-abspos}
\usepackage{calc}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}
\setlength{\parindent}{0pt}
\begin{document}
This is a document in absolute textpos mode, but I will also need to use relative positioning in it.

\hspace*{5mm}\zsavepos{test}
\edef\thingone{\numexpr\zposx{test}*635/118407168}
\edef\thingtwo{\numexpr\zposy{test}*635/118407168}
\edef\thingthree{\numexpr 93-\thingtwo}
\begin{textblock}{59}(\thingone,\thingthree)
I WANT THIS TEXTBLOCK TO BE POSITIONED RELATIVELY
\end{textblock}
\end{document}