I have some foo.lua
code that needs to behave slightly differently when loaded from luatex or texlua.
Here is my example document.
%!TeX Program=LuaLaTeX
\documentclass{article}
\RequirePackage{luacode}
\begin{document}
\begin{luacode}
require("foo.lua")
\end{luacode}
\end{document}
and here is foo.lua
if is_luatex then
tex.sprint("Hello LuaTeX World!")
else
print("Hello TeXLua World!")
end
How to define is_luatex
?
My first idea is to parse arg[0]
but I really need a very strong solution that covers the widest range of situations (99.999%).