You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The luamath math expression parser always uses period . as decimal point, thus it fails (silently) when being used to parse a single number with setting /pgf/number format/read comma as period=true.
This makes luamath not a drop-in replacement for pgfmath plus fpu library, and result in inconsistent behaviors under LuaTeX and non-LuaTeX engines, see for example pgf-tikz/pgfplots#452.
It seems luamath should re-bind its own \pgfmathfloatparsenumber.
Minimal working example (MWE)
% !TeX program = lualatex\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{luamath}
\begin{document}
\pgfset{number format/read comma as period}
\pgfmathfloatparsenumber{1234,56}\pgfmathresult\pgfset{luamath/parser and computation}
\pgfmathfloatparsenumber{1234,56}\pgfmathresult% works because of the fallback\directlua{pgfluamathparser.texCallParser("1234,56"), ,true}\pgfmathresult\end{document}
The direct call of pgfluamathparser.texCallParser("1234,56"), ,true throws error
))[\directlua]:1: syntax error near ','.
l.21 ...amathparser.texCallParser("1234,56"), ,true}
\pgfmathresult
The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.
The logic of fallback is mentioned in lines 537--538 and implemented in lines 549--544 below
Brief outline of the bug
The
luamath
math expression parser always uses period.
as decimal point, thus it fails (silently) when being used to parse a single number with setting/pgf/number format/read comma as period=true
.pgf/tex/generic/pgf/libraries/luamath/pgf/luamath/parser.lua
Lines 47 to 49 in 425b03d
This makes
luamath
not a drop-in replacement forpgfmath
plusfpu
library, and result in inconsistent behaviors under LuaTeX and non-LuaTeX engines, see for example pgf-tikz/pgfplots#452.It seems
luamath
should re-bind its own\pgfmathfloatparsenumber
.Minimal working example (MWE)
The direct call of
pgfluamathparser.texCallParser("1234,56"), ,true
throws errorThe logic of fallback is mentioned in lines 537--538 and implemented in lines 549--544 below
pgf/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex
Lines 533 to 555 in 425b03d
The text was updated successfully, but these errors were encountered: