File: test-luacode.tex

package info (click to toggle)
vim-vimtex 2.16-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,660 kB
  • sloc: makefile: 367; python: 103
file content (28 lines) | stat: -rw-r--r-- 678 bytes parent folder | download
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}