1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
\documentclass[notitlepage,12pt]{article}
\usepackage{luacode}
\newcommand{\somecommand}{
\loop
\begingroup%
\directlua{loopcnt=loopcnt+1}%
\ifnum\somecount=1%
\directlua{prevcount=prevcount+\luastring{\pgfmathresult}}%
\else%
\directlua{prevcount=prevcount+\luastring{\someamt}}%
\fi%
\endgroup%
\if\someothercnt0%
\repeat%
\directlua{linecount=math.floor(prevcount)+1;}%
\fi
}
\begin{document}
\directlua{
local foo = "this is lua syntax highlighting";
function helloworld(input)
local output = input + \luastring{\something} + "123";
return output
end
prevcount prevcount + \luastring{\something} + "123";
}
\end{document}
|