summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/luatex/luatex-lua.tex
diff options
context:
space:
mode:
Diffstat (limited to 'doc/context/sources/general/manuals/luatex/luatex-lua.tex')
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-lua.tex112
1 files changed, 68 insertions, 44 deletions
diff --git a/doc/context/sources/general/manuals/luatex/luatex-lua.tex b/doc/context/sources/general/manuals/luatex/luatex-lua.tex
index 0960f8032..82b060440 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-lua.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-lua.tex
@@ -55,33 +55,33 @@ option. If there is no \type {--lua} option, the command line is interpreted in
similar fashion as the other \TEX\ engines. Some options are accepted but have no
consequence. The following command|-|line options are understood:
-\starttabulate[|lT|p|]
-\NC --credits \NC display credits and exit \NC \NR
-\NC --debug-format \NC enable format debugging \NC \NR
-\NC --draftmode \NC switch on draft mode i.e.\ generate no output in \PDF\ mode \NC \NR
-\NC --[no-]file-line-error \NC disable/enable \type {file:line:error} style messages \NC \NR
-\NC --[no-]file-line-error-style \NC aliases of \type {--[no-]file-line-error} \NC \NR
-\NC --fmt=FORMAT \NC load the format file \type {FORMAT} \NC\NR
-\NC --halt-on-error \NC stop processing at the first error\NC \NR
-\NC --help \NC display help and exit \NC\NR
-\NC --ini \NC be \type {iniluatex}, for dumping formats \NC\NR
-\NC --interaction=STRING \NC set interaction mode: \type {batchmode}, \type {nonstopmode}, \type {scrollmode} or \type {errorstopmode} \NC \NR
-\NC --jobname=STRING \NC set the job name to \type {STRING} \NC \NR
-\NC --kpathsea-debug=NUMBER \NC set path searching debugging flags according to the bits of \type {NUMBER} \NC \NR
-\NC --lua=FILE \NC load and execute a \LUA\ initialization script \NC\NR
-\NC --[no-]mktex=FMT \NC disable/enable \type {mktexFMT} generation with \type {FMT} is \type {tex} or \type {tfm} \NC \NR
-\NC --nosocket \NC disable the \LUA\ socket library \NC\NR
-\NC --output-comment=STRING \NC use \type {STRING} for \DVI\ file comment instead of date (no effect for \PDF) \NC \NR
-\NC --output-directory=DIR \NC use \type {DIR} as the directory to write files to \NC \NR
-\NC --output-format=FORMAT \NC use \type {FORMAT} for job output; \type {FORMAT} is \type {dvi} or \type {pdf} \NC \NR
-\NC --progname=STRING \NC set the program name to \type {STRING} \NC \NR
-\NC --recorder \NC enable filename recorder \NC \NR
-\NC --safer \NC disable easily exploitable \LUA\ commands \NC\NR
-\NC --[no-]shell-escape \NC disable/enable system calls \NC \NR
-\NC --shell-restricted \NC restrict system calls to a list of commands given in \type {texmf.cnf} \NC \NR
-\NC --synctex=NUMBER \NC enable \type {synctex} \NC \NR
-\NC --utc \NC use utc times when applicable \NC \NR
-\NC --version \NC display version and exit \NC \NR
+\starttabulate[|l|p|]
+\NC \type{--credits} \NC display credits and exit \NC \NR
+\NC \type{--debug-format} \NC enable format debugging \NC \NR
+\NC \type{--draftmode} \NC switch on draft mode i.e.\ generate no output in \PDF\ mode \NC \NR
+\NC \type{--[no-]file-line-error} \NC disable/enable \type {file:line:error} style messages \NC \NR
+\NC \type{--[no-]file-line-error-style} \NC aliases of \type {--[no-]file-line-error} \NC \NR
+\NC \type{--fmt=FORMAT} \NC load the format file \type {FORMAT} \NC\NR
+\NC \type{--halt-on-error} \NC stop processing at the first error\NC \NR
+\NC \type{--help} \NC display help and exit \NC\NR
+\NC \type{--ini} \NC be \type {iniluatex}, for dumping formats \NC\NR
+\NC \type{--interaction=STRING} \NC set interaction mode: \type {batchmode}, \type {nonstopmode}, \type {scrollmode} or \type {errorstopmode} \NC \NR
+\NC \type{--jobname=STRING} \NC set the job name to \type {STRING} \NC \NR
+\NC \type{--kpathsea-debug=NUMBER} \NC set path searching debugging flags according to the bits of \type {NUMBER} \NC \NR
+\NC \type{--lua=FILE} \NC load and execute a \LUA\ initialization script \NC\NR
+\NC \type{--[no-]mktex=FMT} \NC disable/enable \type {mktexFMT} generation with \type {FMT} is \type {tex} or \type {tfm} \NC \NR
+\NC \type{--nosocket} \NC disable the \LUA\ socket library \NC\NR
+\NC \type{--output-comment=STRING} \NC use \type {STRING} for \DVI\ file comment instead of date (no effect for \PDF) \NC \NR
+\NC \type{--output-directory=DIR} \NC use \type {DIR} as the directory to write files to \NC \NR
+\NC \type{--output-format=FORMAT} \NC use \type {FORMAT} for job output; \type {FORMAT} is \type {dvi} or \type {pdf} \NC \NR
+\NC \type{--progname=STRING} \NC set the program name to \type {STRING} \NC \NR
+\NC \type{--recorder} \NC enable filename recorder \NC \NR
+\NC \type{--safer} \NC disable easily exploitable \LUA\ commands \NC\NR
+\NC \type{--[no-]shell-escape} \NC disable/enable system calls \NC \NR
+\NC \type{--shell-restricted} \NC restrict system calls to a list of commands given in \type {texmf.cnf} \NC \NR
+\NC \type{--synctex=NUMBER} \NC enable \type {synctex} \NC \NR
+\NC \type{--utc} \NC use utc times when applicable \NC \NR
+\NC \type{--version} \NC display version and exit \NC \NR
\stoptabulate
Some of the traditional flags are just ignored: \type {--etex}, \type
@@ -141,7 +141,7 @@ Then it checks the various safety switches. You can use those to disable some
\type {--safer} \type {nil}s the following functions:
\starttabulate[|l|l|]
-\NC \bf library \NC \bf functions \NC \NR
+\BC library \BC functions \NC \NR
\NC \type {os} \NC \type {execute} \type {exec} \type {spawn} \type {setenv} \type {rename} \type {remove} \type {tmpdir} \NC \NR
\NC \type {io} \NC \type {popen} \type {output} \type {tmpfile} \NC \NR
\NC \type {lfs} \NC \type {rmdir} \type {mkdir} \type {chdir} \type {lock} \type {touch} \NC \NR
@@ -179,8 +179,7 @@ deal with typesetting, like \type {tex}, \type {token}, \type {node} and
are \type {nil}'d). Special care is taken that \type {texio.write} and \type
{texio.write_nl} function properly, so that you can at least report your actions
to the log file when (and if) it eventually becomes opened (note that \TEX\ does
-not even know its \type {\jobname} yet at this point). See \in {chapter} [libraries]
-for more information about the \LUATEX-specific \LUA\ extension tables.
+not even know its \type {\jobname} yet at this point).
Everything you do in the \LUA\ initialization script will remain visible during
the rest of the run, with the exception of the \TEX\ specific libraries like
@@ -214,7 +213,7 @@ the right|-|hand side of an assignment to a \type {\dimen} or \type {\count}.
Loading dynamic \LUA\ libraries will fail if there are two \LUA\ libraries loaded
at the same time (which will typically happen on \type {win32}, because there is
-one \LUA\ 5.2 inside \LUATEX, and another will likely be linked to the \DLL\ file
+one \LUA\ 5.3 inside \LUATEX, and another will likely be linked to the \DLL\ file
of the module itself).
\LUATEX\ is able to use the kpathsea library to find \type {require()}d modules.
@@ -304,17 +303,17 @@ piecemeal:
\type {string.utfcharacters(s)}: a string with a single \UTF-8 token in it
\stopitem
\startitem
- \type {string.characters(s)} \NC a string containing one byte
+ \type {string.characters(s)}: a string containing one byte
\stopitem
\startitem
- \type {string.characterpairs(s)} two strings each containing one byte or an
+ \type {string.characterpairs(s)}: two strings each containing one byte or an
empty second string if the string length was odd
\stopitem
\startitem
- \type {string.bytes(s)} a single byte value
+ \type {string.bytes(s)}: a single byte value
\stopitem
\startitem
- \type {string.bytepairs(s)} two byte values or nil instead of a number as
+ \type {string.bytepairs(s)}: two byte values or nil instead of a number as
its second return value if the string length was odd
\stopitem
\stopitemize
@@ -336,8 +335,28 @@ always returns byte positions in a string, and \type {unicode.utf8.match} and
are} \UNICODE|-|aware, they fall|-|back to non|-|\UNICODE|-|aware behavior when
using the empty capture \type {()} but other captures work as expected. For the
interpretation of character classes in \type {unicode.utf8} functions refer to
-the library sources at \hyphenatedurl {http://luaforge.net/projects/sln}. Version
-5.3 of \LUA\ will provide some native \UTF8 support.
+the library sources at \hyphenatedurl {http://luaforge.net/projects/sln}.
+
+Version 5.3 of \LUA\ provides some native \UTF8 support but we have added a few
+similar helpers too:
+
+\startitemize
+\startitem
+ \type {string.utfvalue(s)}: returns the codepoints of the characters in the
+ given string
+\stopitem
+\startitem
+ \type {string.utfcharacter(c,...)}: returns a string with the characters of
+ the given code points
+\stopitem
+\startitem
+ \type {string.utflength(s)}: returns the length oif the given string
+\stopitem
+\stopitemize
+
+These three functions are relative fast and don't do much checking. They can be used
+as building blocks for other helpers.
+
\blank
@@ -405,7 +424,7 @@ The \type {os} library has a few extra functions and variables:
\startitem
\type {os.env} is a hash table containing a dump of the variables and
values in the process environment at the start of the run. It is writeable,
- but the actual environment is {\em not\/} updated automatically.
+ but the actual environment is \notabene {not} updated automatically.
\stopitem
\startitem
@@ -560,12 +579,17 @@ When Universal Time is needed, you can pass the flag \type {utc} to the engine.
property also works when the date and time are set by \LUATEX\ itself. It has a
complementary entry \type {use_utc_time} in the \type {texconfig} table.
-{\em To some extend a cleaner solution would be to have a flag that disables all
-variable data in one go (like filenames and so) but we just follow the method
-implemented in \PDFTEX\ where primitives are used to influence other properties.}
-
-{\em In \CONTEXT\ we provide the command line argument \type {--nodates} that
-does bit more disabling of dates.}
+\startnotabene
+ To some extend a cleaner solution would be to have a flag that disables all
+ variable data in one go (like filenames and so) but we just follow the method
+ implemented in \PDFTEX\ where primitives are used to influence other
+ properties.
+\stopnotabene
+
+\startnotabene
+ In \CONTEXT\ we provide the command line argument \type {--nodates} that does
+ bit more disabling of dates.
+\stopnotabene
\stopchapter