这是我所能得到的最接近的结果,但是我不知道如何进行计算以便文本块接受它:
\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}
答案1
您不能将尺寸与 一起使用textblock
。它期望接收与水平和垂直单位数相对应的简单数字。但我认为您试图向其提供mm
,这是行不通的。(如果您需要使用尺寸,请考虑textblock*
。)
这是一个有效的例子:
\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}