(A follow-up question to Which is the best editor for LuaTeX?)
Emacs offers the LaTeX-mode in AUCTeX for editing LaTeX files, while it has the Lua-mode for editing Lua-files.
Consider the following code:
\documentclass{article}
\usepackage{luacode}
\begin{document}
\begin{luacode*}
for i=1,2,3 do
for j=1,2,3 do
tex.sprint("Test");
end
end
\end{luacode*}
\end{document}
In Emacs latex-mode I get the following screenshot:
But it is not possible to indent the lua-code with the tab-key or highlight Lua-code key words. If I turn on lua-mode in emacs, I get editing features for the Lua-code, but not for the latex-code, e.g.:
Is it possible to have both modes work together? (I have looked at this page: http://emacswiki.org/emacs/MultipleModes but I am not sure which mode to use and how to set it up)