2

The package lengthconvert "uses the modul l3fp to convert the length". But its conversions are totally off the charts:

\documentclass{article}
\usepackage{lengthconvert}
\begin{document}
\the\textheight

\Convert[unit = mm]{\textheight}

\Convert[unit = cm]{\textheight}
\end{document}

enter image description here

Is this due to some problem with the l3kernel, or has the l3kernel changed some of its internals that lengthconvert hasn't been updated to reflect?

1

1 Answer 1

3

I don't know whether l3fp is changed or not. The following seems to show right dimensions:

\documentclass{article}
\usepackage{lengthconvert}
%
\ExplSyntaxOn
\cs_new:Npn \__lconv_calc_dim_fixed:n #1
 {
  \fp_eval:n
     {
      round( \dim_to_fp:n { #1 } / (1\l__lconv_unit_tl) , \l__lconv_precision_int)
     }
 }
\cs_set_eq:NN \__lconv_calc_dim:n \__lconv_calc_dim_fixed:n
\ExplSyntaxOff
%
\begin{document}
\the\textheight

\Convert[unit = mm]{\textheight}

\Convert[unit = cm]{\textheight}
\end{document}
2
  • You should use \cs_set_eq:NN instead of \let. Oct 3, 2015 at 12:38
  • @Henri Menke -- Thanks a lot. I don't know expl3 programming. Please edit. Oct 3, 2015 at 12:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .