I would like to automate the creation of some beamer slides using LuaLaTeX. These are my first steps with LuaLaTeX so please excuse my ignorance.
\documentclass{beamer}
\begin{document}
\directlua{
for i=0, 5 do
tex.print("\unexpanded{\\begin{frame}}")
tex.print("Math: $x_{" .. i .. "}$")
tex.print("\unexpanded{\\end{frame}}")
end
}
\end{document}
The example compiles and gives the expected result; 6 frames with x_0,1,2,3,5 on it.
I'm a bit unhappy about the additional \unexpands and \s before \begin and \end.
Is there a dedicated LuaTeX command that just inserts latex code 1:1 to the document?