e-TeX's \dimexpr
only allows a very limited range of items inside the expression. In particular, you can only multiply a dimension by an integer value
\dimexpr 10pt * 5\relax
\dimexpr 10pt * (5 * 5)\relax
Note the fact that the dimension here comes first. As is the case for a TeX register, you can multiply a \dimexpr
by a real number by placing it before the expression
1.2\dimexpr 10pt * 5 \relax
Thus for your case you will need a series of expressions, each multiplied by 1.2, or to pre-calculate the factor
\dimexpr1.2\dimexpr1.2\dimexpr1.2\dimexpr 10pt \relax\relax\relax\relax
\dimexpr 1.728\dimexpr 10pt\relax
An alternative approach would be to use the expl3
FPU to do the floating point work, for example
\usepackage{expl3}
\ExplSyntaxOn
\cs_new_eq:NN \fpeval \fp_eval:n
\cs_new_eq:NN \fptodim \fp_to_dim:n
\ExplSyntaxOff
then one of
\dimexpr\fpeval{1.2^(3)}\dimexpr 10pt\relax
\dimexpr\fptodim{1.2^(3) * 10}\relax
where the latter uses the fact that the conversion of a float to dimen uses points as the unit. Note that this method supports negative exponents:
\the\dimexpr\fpeval{1.2^(-3)}\dimexpr 10pt\relax % => 5.78703pt
\the\dimexpr\fptodim{1.2^(-3) * 10}\relax % => 5.78703pt
\dimexpr
' I'm not sure what you are after here as an answer! (See for example tex.stackexchange.com/questions/88344/…)texdoc etex
, which saysAn expression consists of one or more terms of the same type to be added or subtracted; a term of type t consists of a factor of that type, optionally multiplied and/or divided by numeric factors; finally a factor of type t is either a parenthesized subexpression or a quantity (number, etc.) of that type.
\dimexpr 1.2 10pt
would not work either}
in front would convince TeX that there was an implicit multiplication symbol in front. Can't say I ever really believed it would work, though.