I have the following code which sets up a XeLaTeX document (to be run with --enable-write18) and defines two commands, \showme and \prRaise:
\documentclass[a4paper,oneside]{memoir}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\usepackage{catchfile}
% ----------------------------------------------------------------------------------------------------------
\newcommand*{\showme}[1]{The value is #1.}
% ----------------------------------------------------------------------------------------------------------
\makeatletter%
\newdimen\pr@Height%
\newcommand{\prRaise}[2]{%
\setlength{\pr@Height}{\f@size pt}%
\raisebox{#1\pr@Height}{#2}%
}%
\makeatother%
% ----------------------------------------------------------------------------------------------------------
\def\cxltxReadA{\CatchFileEdef{\cxltxR}{/tmp/CXLTXtempout.tex}{}}
\def\cxltxReadB{\CatchFileEdef{\cxltxR}{/tmp/CXLTXtempout.tex}{}\cxltxR}
% ----------------------------------------------------------------------------------------------------------
\begin{document}
\showme{foobar}% => ”The value is foobar”.
\showme{\cxltxReadB}% => ”The value is -0.2 .”
\showme{\input{/tmp/CXLTXtempout}}% => ”The value is -0.2 .”
\showme{\immediate\input{/tmp/CXLTXtempout}}% => ”The value is -0.2 .”
A\prRaise{-0.2}{B}C% => "ABC" with B lowered
A\prRaise{-0.2 }{B}C% => "ABC" with B lowered (trailing space shouldn't be a problem)
A\prRaise{\input{/tmp/CXLTXtempout}}{B}C% !!! => Missing number, treated as zero.
A\prRaise{\immediate\input{/tmp/CXLTXtempout}}{B}% !!! => Missing number, treated as zero.
A\prRaise{\cxltxReadB}{B}C% !!! => Missing number, treated as zero.
\cxltxReadA A\prRaise{\cxltxR}{B}C% works
\end{document}
The thing is, trying to use the file contents with \input, \immediate\input and \cxltxReadA ... \cxltxR works for both commands, but, crucially, all attempts to read the file contents within the argument to prRaise fail. It'd be great if it did work, because what i really want to do is call some external program to do a contextual computation, so i want to call that external program at exactly the point where i need it.
Why do the two commands behave so differently? What in the definition of \prRaise causes these troubles?

A\raise\input file.tex em\hbox{B}Cinstead of your\prRaise. LaTeX brings only complications. – wipet Nov 26 '14 at 19:23