diff options
author | Luigi Scarso <luigi.scarso@gmail.com> | 2021-02-15 00:16:48 +0000 |
---|---|---|
committer | Luigi Scarso <luigi.scarso@gmail.com> | 2021-02-15 00:16:48 +0000 |
commit | 1426e46e70e41a176d37049fc4e0b9bf3dde108a (patch) | |
tree | ccf05b9ef37ae9aad9e9b1b4421f5047f5b0bf06 /Master/texmf-dist/doc/luatex/base | |
parent | d9a6c07a4c5694449647b57ae3695acb37658fc7 (diff) |
updated luatex manual
git-svn-id: svn://tug.org/texlive/trunk@57746 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/luatex/base')
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex-backend.tex | 20 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex-enhancements.tex | 23 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex-lua.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex-math.tex | 28 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex-modifications.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex-tex.tex | 61 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex.pdf | bin | 1756085 -> 1609366 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex.tex | 2 |
8 files changed, 126 insertions, 14 deletions
diff --git a/Master/texmf-dist/doc/luatex/base/luatex-backend.tex b/Master/texmf-dist/doc/luatex/base/luatex-backend.tex index 2606ff38475..cfadd46f25c 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex-backend.tex +++ b/Master/texmf-dist/doc/luatex/base/luatex-backend.tex @@ -681,7 +681,7 @@ returns a dictionary. The first argument is to be a page dictionary. \stoptyping Another convenience command gives you the (bounding) box of a (normally page) -which can be inheritted from the document itself. An example of a valid box name +which can be inherited from the document itself. An example of a valid box name is \type {MediaBox}. \starttyping @@ -690,13 +690,14 @@ pages = pdfe.getbox(<pdfe dictionary>,boxname) \stopsubsection -\startsubsection[title={\type {get[string|integer|number|boolean|name]}}] +\startsubsection[title={\type {get[string|integer|number|boolean|name]}, \type{type}}] \libindex {getstring} \libindex {getinteger} \libindex {getnumber} \libindex {getboolean} \libindex {getname} +\libindex {type} Common values in dictionaries and arrays are strings, integers, floats, booleans and names (which are also strings) and these are also normal \LUA\ objects: @@ -707,8 +708,23 @@ i = getinteger(<pdfe array|dictionary>,index|key) n = getnumber (<pdfe array|dictionary>,index|key) b = getboolean(<pdfe array|dictionary>,index|key) n = getname (<pdfe array|dictionary>,index|key) +s = type (<pdfe array|dictionary|document|reference|stream) \stoptyping +The \type {type} returns a string describing the type of the object, +i.e. "pdfe.array", "pdfe.dictionary", "pdfe", +"pdfe.reference", "pdfe.stream". + +The \type {getstring} function has two extra variants: + +\starttyping +s, h = getstring (<pdfe array|dictionary>,index|key,false) +s = getstring (<pdfe array|dictionary>,index|key,true) +\stoptyping + +The first call returns the original string plus a boolean indicating if the +string is hex encoded. The second call returns the unencoded string. + \stopsubsection \startsubsection[title={\type {get[from][dictionary|array|stream]}}] diff --git a/Master/texmf-dist/doc/luatex/base/luatex-enhancements.tex b/Master/texmf-dist/doc/luatex/base/luatex-enhancements.tex index b81e1dbdae5..537961661f5 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex-enhancements.tex +++ b/Master/texmf-dist/doc/luatex/base/luatex-enhancements.tex @@ -1266,6 +1266,29 @@ related primitives. \stopsubsection +\startsubsection[title={\prm {glyphdimensionsmode}}] + +Already in the early days of \LUATEX\ the decision was made to calculate the +effective height and depth of glyphs in a way that reflected the applied vertical +offset. The height got that offset added, the depth only when the offset was +larger than zero. We can now control this in more detail with this mode +parameter. An offset is added to the height and|/|or subtracted from the depth. +The effective values are never negative. The zero mode is the default. + +\starttabulate[|l|pl|] +\DB value \BC effect \NC\NR +\TB +\NC \type {0} \NC the old behaviour: add the offset to the height and only subtract + the offset only from the depth when it is positive \NC \NR +\NC \type {1} \NC add the offset to the height and subtract it from the depth \NC \NR +\NC \type {2} \NC add the offset to the height and subtract it from the depth but + keep the maxima of the current and previous results \NC \NR +\NC \type {3} \NC use the height and depth of the glyph, so no offset is applied \NC \NR +\LL +\stoptabulate + +\stopsubsection + \stopsection \startsection[title={Control and debugging}] diff --git a/Master/texmf-dist/doc/luatex/base/luatex-lua.tex b/Master/texmf-dist/doc/luatex/base/luatex-lua.tex index f9107fa1f96..625334c1b8a 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex-lua.tex +++ b/Master/texmf-dist/doc/luatex/base/luatex-lua.tex @@ -608,6 +608,10 @@ in addition to the regular \type {io} library functions. \NC \type{readbytetable(f,n)} \NC \type {n} bytes\NC \NR \stoptabulate +There are eight additional little endian variants for the \type {cardinal[1-4]} +and \type {integer[1-4]} readers: \type {cardinal[1-4]le} and \type +{integer[1-4]le}. + \stopsubsection \startsubsection[title={Binary input from strings with \type {sio}}] diff --git a/Master/texmf-dist/doc/luatex/base/luatex-math.tex b/Master/texmf-dist/doc/luatex/base/luatex-math.tex index e5999e72fd1..89c0836ba76 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex-math.tex +++ b/Master/texmf-dist/doc/luatex/base/luatex-math.tex @@ -1242,6 +1242,31 @@ $\Uhextensible width 1pt middle 0 "2194$ font metrics are involved we have a different code path for traditional fonts end \OPENTYPE\ fonts. +Sometimes you might want to act upon the size of a delimiter, something that is +not really possible because of the fact that they are calculated {\em after} most +has been typeset already. In the following example the all|-|zero specification +is the trigger to make a fake box with the last delimiter dimensions and shift. +It's an ugly hack but its relative simple and not intrusive implementation has no +side effects. Any other heuristic solution would not satisfy possible demands +anyway. Here is a rather low level example: + +\startbuffer +\startformula +\Uleft \Udelimiter 5 0 "222B +\frac{\frac{a}{b}}{\frac{c}{d}} +\Uright \Udelimiter 5 0 "222B +\kern-2\fontcharwd\textfont0 "222B +\mathlimop{\Uvextensible \Udelimiter 0 0 0}_1^2 x +\stopformula +\stopbuffer + +\typebuffer + +The last line, by passing zero values, results in a fake operator that has the +dimensions of the previous delimiter. We can then backtrack over the (presumed) +width and the two numbers become limit operators. As said, it's not pretty but it +works. + \subsection{Fractions} \topicindex {math+fractions} @@ -1306,6 +1331,9 @@ For Latin Modern the result looks as follows: \stoptabulate \stop +The keyword \type {norule} will hide the rule with the above variants while +keeping the rule related spacing. + \subsection {Delimiters: \type{\Uleft}, \prm {Umiddle} and \prm {Uright}} \topicindex {math+delimiters} diff --git a/Master/texmf-dist/doc/luatex/base/luatex-modifications.tex b/Master/texmf-dist/doc/luatex/base/luatex-modifications.tex index 747945f55f7..bf4233165b9 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex-modifications.tex +++ b/Master/texmf-dist/doc/luatex/base/luatex-modifications.tex @@ -615,6 +615,8 @@ primitives (for as far their functionality is still around) you now can do this: \protected\def\pdfmapline {\pdfextension mapline } \protected\def\pdftrailer {\pdfextension trailer } \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode } +\protected\def\pdfrunninglinkoff {\pdfextension linkstate 1 } +\protected\def\pdfrunninglinkon {\pdfextension linkstate 0 } \stoptyping The introspective primitives can be defined as: diff --git a/Master/texmf-dist/doc/luatex/base/luatex-tex.tex b/Master/texmf-dist/doc/luatex/base/luatex-tex.tex index dacaec0cb92..c9ca45158c3 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex-tex.tex +++ b/Master/texmf-dist/doc/luatex/base/luatex-tex.tex @@ -249,7 +249,8 @@ readable (like \prm {tracingcommands} and \prm {parindent}). \topicindex{parameters+internal} -\libindex{set} \libindex{get} +\libindex{set} +\libindex{get} For all the parameters in this section, it is possible to access them directly using their names as index in the \type {tex} table, or by using one of the @@ -357,6 +358,10 @@ These are read|-|only: tex.deadcycles tex.insertpenalties tex.parshape +tex.interlinepenalties +tex.clubpenalties +tex.widowpenalties +tex.displaywidowpenalties tex.prevgraf tex.spacefactor \stoptyping @@ -605,6 +610,8 @@ tex.currentifbranch \libindex{scantoks} +\libindex{getmark} + \TEX's attributes (\lpr {attribute}), counters (\prm {count}), dimensions (\prm {dimen}), skips (\prm {skip}, \prm {muskip}) and token (\prm {toks}) registers can be accessed and written to using two times five virtual sub|-|tables of the @@ -741,6 +748,12 @@ tex.scantoks("global",0,"$\int\limits^1_2$") In the function|-|based interface, it is possible to define values globally by using the string \type {global} as the first function argument. +There is a dedicated getter for marks: \type {getmark} that takes two arguments. +The first argument is one of \type {top}, \type {bottom}, \type {first}, \type +{splitbottom} or \type {splitfirst}, and the second argument is a marks class +number. When no arguments are given the current maximum number of classes is +returned. + \stopsubsection \startsubsection[title={Character code registers: \type {[get|set]*code[s]}}] @@ -1921,24 +1934,34 @@ the executable after loading and executing the startup file. \type {false} disables \TEX's normal file open|-|close feedback (the assumption is that callbacks will take care of that) \NC \NR -\NC \type{file_line_error} \NC boolean \NC false +\NC \type{file_line_error} \NC boolean \NC false \NC do \type {file:line} style error messages \NC \NR -\NC \type{halt_on_error} \NC boolean \NC false +\NC \type{halt_on_error} \NC boolean \NC false \NC abort run on the first encountered error \NC \NR -\NC \type{formatname} \NC string \NC +\NC \type{formatname} \NC string \NC \NC if no format name was given on the command line, this key will be tested first instead of simply quitting \NC \NR -\NC \type{jobname} \NC string \NC +\NC \type{jobname} \NC string \NC \NC if no input file name was given on the command line, this key will be tested first instead of simply giving up \NC \NR +\NC \type{level_chr} \NC number \NC +\NC + character to put in front of traced macros (see next value) +\NC \NR +\NC \type{level_max} \NC number \NC +\NC + when larger than zero the input nesting level will be shown when \type + {\tracingmacros} is set; levels above this value will be clipped with + the level shown up front +\NC \NR \LL \stoptabulate @@ -1946,6 +1969,16 @@ Note: the numeric values that match web2c parameters are only used if \type {kpse_init} is explicitly set to \type {false}. In all other cases, the normal values from \type {texmf.cnf} are used. +You can kick in your own nesting level visualizer, for instance: + +\stoptyping +callback.register("input_level_string",function(n) + if tex.tracingmacros > 1 then + return "! " .. string.rep(">",n) .. " " + end +end) +\stoptyping + \stopsection \startsection[title={The \type {texio} library}][library=texio] @@ -1961,16 +1994,15 @@ and|/|or console. \libindex{write} \startfunctioncall -texio.write(<string> target | <integer> stream, <string> s, ...) +texio.write(<string> target, <string> s, ...) texio.write(<string> s, ...) \stopfunctioncall Without the \type {target} argument, writes all given strings to the same location(s) \TEX\ writes messages to at this moment. If \prm {batchmode} is in effect, it writes only to the log, otherwise it writes to the log and the -terminal. The optional \type {target} can be one of four possibilities: \type -{term}, \type {log}, \type {term and log} or a valid integer of a stream -opened for writing. +terminal. The optional \type {target} can be one of three possibilities: \type +{term}, \type {log} or \type {term and log}. Note: If several strings are given, and if the first of these strings is or might be one of the targets above, the \type {target} must be specified explicitly to @@ -2063,8 +2095,7 @@ most intriguing. \NC \type{scan_toks} \NC definer, expand \NC returns a table of tokens tokens \NC \NR \NC \type{scan_code} \NC bitset \NC returns a character if its category is in the given bitset (representing catcodes) \NC \NR \NC \type{scan_string} \NC \NC returns a string given between \type {{}}, as \type {\macro} or as sequence of characters with catcode 11 or 12 \NC \NR -\NC \type{scan_argument} \NC \NC this one is simular to \type {scanstring} but also accepts a \type {\cs} - (which then get expanded) \NC \NR +\NC \type{scan_argument} \NC boolean \NC this one is simular to \type {scanstring} but also accepts a \type {\cs} \NC \NR \NC \type{scan_word} \NC \NC returns a sequence of characters with catcode 11 or 12 as string \NC \NR \NC \type{scan_csname} \NC \NC returns \type {foo} after scanning \type {\foo} \NC \NR \NC \type{scan_list} \NC \NC picks up a box specification and returns a \type {[h|v]list} node \NC \NR @@ -2080,6 +2111,11 @@ macro, in which case the result will also provide information about what arguments are expected and in the result this is separated from the meaning by a separator token. The \type {expand} flag determines if the list will be expanded. +The \type {scan_argument} function expands the given argument. When a braced +argument is scanned, expansion can be prohibited by passing \type {false} +(default is \type {true}). In case of a control sequence passing \type {false} +will result in a one|-|level expansion (the meaning of the macro). + The string scanner scans for something between curly braces and expands on the way, or when it sees a control sequence it will return its meaning. Otherwise it will scan characters with catcode \type {letter} or \type {other}. So, given the @@ -2292,6 +2328,9 @@ accepts a string and returns a boolean: local okay = token.is_defined("foo") \stoptyping +When a second argument to \type {is_defined} is \type {true} the check is for an +undefined control sequence (only), otherwise any undefined command gives true. + The largest character possible is returned by \type {biggest_char}, just in case you need to know that boundary condition. diff --git a/Master/texmf-dist/doc/luatex/base/luatex.pdf b/Master/texmf-dist/doc/luatex/base/luatex.pdf Binary files differindex aad713bec60..8504e3bf56d 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex.pdf +++ b/Master/texmf-dist/doc/luatex/base/luatex.pdf diff --git a/Master/texmf-dist/doc/luatex/base/luatex.tex b/Master/texmf-dist/doc/luatex/base/luatex.tex index 5a14b40bfda..b4c13c4de2d 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex.tex +++ b/Master/texmf-dist/doc/luatex/base/luatex.tex @@ -73,7 +73,7 @@ \startdocument [manual=Lua\TeX, status=stable, - version=1.12] + version=1.13] \startnotmode[*export] \component luatex-titlepage |