Could someone please tell me how I can use the \widthof{} command from the calc package within \FPeval from the fp package?
\documentclass[10pt]{article}
\usepackage{calc}
\usepackage{fp}
\begin{document}
\FPeval\result{(2.5-\widthof{13})/2}
\end{document}
Even with \csname and \value, or \arabic, it still results in an error.
\settowidth? – Joseph Wright May 21 '16 at 17:15\settowidth{\tempdimen}{13}is shorter and does not depend on packagecalc; therefore it is the better choice. However, it does not show, how\widthofcan be used with thefppackage. ;-) – Heiko Oberdiek May 21 '16 at 17:20\newcommand{\test}[1]{\makeatletter\setlength{\tempdimen}{\widthof{#1}}\FPeval\resultaP(2.5-\strip@pt\tempdimen)/2}\makeatother}, but this doesn't seem to work. – user111 May 21 '16 at 22:14\strip@ptcontains@, which needs the category code letter. The category codes are used, when TeX tokenizes the input bytes, that means definition time here, not execution time of the defined macro.\makeatletterand\makeatothermust go outside the definition:\makeatletter\newcommand*{\test}[1]{\settowidth{\tempdimen}{#1}\FPeval\resultaP(2.5-\strip@pt\tempdimen)/2}}\maketother. – Heiko Oberdiek May 22 '16 at 06:57