I have the following code
\documentclass{article}
\usepackage{luacode}
\begin{document}
\begin{luacode*}
local matrix = require "matrix"
local complex = require "complex"
function cmatrix(n)
return matrix(n):replace(complex)
end
function det(m)
tex.sprint(matrix.det(cmatrix(m)))
end
\end{luacode*}
\newcommand{\matrixdet}[1]{\directlua{det(#1)}}
\matrixdet{{{1,2,3},{4,5,6},{"7+8i",8,10}}}
\end{document}
Here I am using matrix.lua and complex.lua from the following links.
https://github.com/davidm/lua-matrix/blob/master/lua/matrix.lua
https://github.com/davidm/lua-matrix/blob/master/lua/complex.lua
The expected answer is -3-24i. However it gives the answer -3-24. The character i is not printed. This works well in lua itself. But it seems to be a bug in lualatex. How can it be over come? Any help will be appreciated.
complex.lua
first.