I know I can access raw TeX dimens with Lua using tex.dimen[key]
, but how do I access a LaTeX length in Lua?
MWE:
\documentclass{article}
% This is TeX
\newdimen\boxwidth
\boxwidth=3.4ex
% end of TeX
\newlength{\boxwidthlatex}
\setlength{\boxwidthlatex}{5.8ex}
\begin{document}
\directlua{tex.print(tex.dimen['boxwidth'])}
% How to do something like this?
% \directlua{tex.print(tex.dimen['boxwidthlatex'])}
\end{document}