On Feb 23, 2011, at 1:41 PM, Curiouslearn wrote:
I will try to do this using lua loop. I should learn it. I am learning so many new things currently that I have not had a chance to learn Lua.
lua is not all that different from other languages such as python or perl; once you've grasped the concept of one syntax, you should be able to learn others and write lua code pretty soon.
I was wondering if Aditya's filter module could be used to use Python instead of Lua, but I suppose I should ask that as a new question.
Aditya's filter module is for highlighting code, it will not run python code within luatex. I think Luigi once played with a module that allowed embedding python within luatex (http://wiki.contextgarden.net/User:Luigi.scarso#Luatex_hosts_python and http://wiki.contextgarden.net/User:Luigi.scarso/luatex_lunatic), but I think he has since given up on this project. As for the lua loop, maybe this can be helpful (this is how I create "offprints" of my scanned articles): \startluacode for i = 1,21 do tex.sprint('\\hskip1cm\\externalfigure[includethis][page=' .. i .. ',height=\\textheight]') end \stopluacode tex.sprint() passes its argument to the typesetting engine, '..' concatenates the lua variable 'i' into this code. Od course, this is mkiv only. That should get you started. Best Thomas