LuaTeX 是否可能对于 LuaTeX 参考中引用的内容不完整?
我的引擎是:LuaTeX,版本 0.95.0(TeX Live 2016)(format=lualatex 2017.1.20)
看起来不起作用的至少有以下几点:
\directlua{tex.sprint(number.dimenfactors["mm"])}
\directlua{tex.sprint(number.tocentimeters(100000))}
\directlua{tex.sprint(1,'pt')}
我在以下位置找到的前两个命令http://wiki.contextgarden.net/Dimensions,手册中的最后一条是http://www.luatex.org/svn/trunk/manual/luatex.pdf
編輯:MWE
\documentclass{article}
\begin{document}
number.dimenfactors: \directlua{tex.sprint(number.dimenfactors["mm"])}
number.tocentimeters: \directlua{tex.sprint(number.tocentimeters(100000))}
print two objects: \directlua{tex.sprint(1,'pt')}
\end{document}
前两行不会产生所需的输出,但却会在日志文件中导致这两个(不幸的是没有什么指导意义的)错误:
[\directlua]:1: attempt to index global 'number' (a nil value)
stack traceback:
[\directlua]:1: in main chunk.
l.3 ...ectlua{tex.sprint(number.dimenfactors["mm"])}
The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.
[\directlua]:1: attempt to index global 'number' (a nil value)
stack traceback:
[\directlua]:1: in main chunk.
l.4 ...lua{tex.sprint(number.tocentimeters(100000))}
The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.
第三个命令只输出第二个参数中的字符串,但不输出第一个参数中的数字。