I need to get the value of a macro from lualatex directly and return it in a function call
function GetMacroValue(macro)
return macro.value
end
I've tried various things such as using tex.print to store the value in a temp value BUT since tex.print executes after the function call/luacode block it does not work
function GetMacroValue()
tex.print("\\directlua{value = tonumber('\\the\\"..macro.."')}")
return value
end
Would work except the tex.print line does not execute until after the fact in which case the previous value is returned.
since tex.execute
does not exist yet is there any other method? I've tried coroutines but it does not work for(or I can't get it to work).