| 1 |
The luacode package for LuaLaTeX |
| 2 |
|
| 3 |
|
| 4 |
Executing Lua code from within TeX with \directlua can sometimes be |
| 5 |
tricky: there is no easy way to use the percent character, counting |
| 6 |
backslashes may be hard, and Lua comments don't work the way you expect. |
| 7 |
This package provides the \luaexec command and the luacode(*) |
| 8 |
environments to help with these problems. |
| 9 |
|
| 10 |
For an introduction to the most important gotchas of \directlua, see |
| 11 |
lualatex-doc.pdf. Before you start using the tools in this package, let me |
| 12 |
insist that the most robust way to manage a non-trivial piece of Lua code is |
| 13 |
to use an external file and source it from Lua, as explained in the cited |
| 14 |
document. |
| 15 |
|
| 16 |
|
| 17 |
Installation |
| 18 |
------------ |
| 19 |
|
| 20 |
Here are the recommended installation methods (preferred first). |
| 21 |
|
| 22 |
1. If you are using TeX Live 2008 or later, use 'tlmgr install luacode'. |
| 23 |
If your are using MiKTeX, use the MiKTeX Package Manager. |
| 24 |
Alternatively, try you Linux distribution's package management system. |
| 25 |
|
| 26 |
2. a. Grab luacode.tds.zip on the CTAN. |
| 27 |
b. Unzip it at the root of one or your TDS trees. |
| 28 |
c. You may need to update some filename database after this, see your TeX |
| 29 |
distribution's manual for details. (Hint: with TeX Live, run 'mktexlsr'; |
| 30 |
with MikTeX, look for "Refresh FNDB" in the MikTeX menu.) |
| 31 |
|
| 32 |
3. a. Grab the sources from CTAN or github. |
| 33 |
b. Run 'make install TEXMFROOT=/path/to/texmf'. |
| 34 |
(Warning: 'make install' without giving a TEXMFROOT will |
| 35 |
put files in './texmf', which is probably not what you want.) |
| 36 |
c. See 2c. |
| 37 |
|
| 38 |
|
| 39 |
Licence |
| 40 |
------- |
| 41 |
|
| 42 |
This package is distributed under the terms of the LPPL v1.3c or later. |
| 43 |
See the source file luacode.dtx for details. |