summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals
diff options
context:
space:
mode:
Diffstat (limited to 'doc/context/sources/general/manuals')
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-enhancements.tex47
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-fonts.tex5
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-languages.tex17
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-libraries.tex463
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-lua.tex11
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-math.tex478
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-modifications.tex259
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-nodes.tex175
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-style.tex2
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex.tex2
10 files changed, 1232 insertions, 227 deletions
diff --git a/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex b/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex
index bc68a0db9..6dfaecaba 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex
@@ -618,7 +618,7 @@ This new integer parameter allows you to alter the number of the box that will b
used to store the page sent to the output routine. Its default value is 255, and
the acceptable range is from 0 to 65535.
-\section{\type {\fontid}}
+\section{\type {\fontid} and \type {\setfontid}}
\startsyntax
\fontid\font
@@ -640,6 +640,9 @@ order of loading fonts. For instance, when in \CONTEXT\ virtual math \UNICODE\
fonts are used, we can easily get over a hundred ids in use. Not all ids have to
be bound to a real font, after all it's just a number.
+The primitive \type {\setfontid} can be used to enable a font with the given id
+(which of course needs to be a valid one).
+
\section{\type {\gleaders}}
This type of leaders is anchored to the origin of the box to be shipped out. So
@@ -647,6 +650,14 @@ they are like normal \type {\leaders} in that they align nicely, except that the
alignment is based on the {\it largest\/} enclosing box instead of the {\it
smallest\/}. The \type {g} stresses this global nature.
+\section{\type {\nohrule} and \type {\novrule}}
+
+Because internally box resources and image resources are now stored as a special
+kind of rule, we also introduced an empty rule variant. Because introducing a new
+keyword can cause incompatibilities, two new primitives were introduced: \type
+{\nohrule} and \type {\novrule}. These can be used to reserve space. This is
+often more efficient than creating an empty box with fake dimensions).
+
\section{\type {\Uchar}}
The expandable command \type {\Uchar} reads a number between~0 and $1{,}114{,}111$
@@ -660,6 +671,21 @@ within the constraints of the \type {\lefthyphenmin} and \type {\righthyphenmin}
values (as stored in the glyph node). This primitive accepts a number and stores
the value with the language.
+\section{\type {\boundary} and \type {\noboundary}}
+
+The \type {\noboundary} commands used to inject a whatsit node but now injects a normal
+node with type \type {boundary} and subtype~0. In addition you can say:
+
+\starttyping
+x\boundary 123\relax y
+\stoptyping
+
+This has the same effect but the subtype is now~1 and the value~123 is stored. The
+traditional ligature builder still sees this as a cancel boundary directive but at the
+\LUA\ end you can implement different behaviour. The added benefit of passing this
+value is a side effect of the generalization.
+
+
\section{Debugging}
If \type {\tracingonline} is larger than~2, the node list display will also print
@@ -700,6 +726,19 @@ optional parameters are not implemented for \type {\saveboxresource}.
\pdfrefxform width 20mm height 10mm depth 5mm \pdflastxform
\stoptyping
+\section{\type {\outputmode} and \type {\draftmode}}
+
+The \type {\outputmode} variable tells \LUATEX\ what it has to produce:
+
+\starttabulate[|l|l|]
+\NC \type {0} \NC \DVI\ code \NC \NR
+\NC \type {1} \NC \PDF\ code \NC \NR
+\stoptabulate
+
+The value of the \type {\draftmode} counter signals the backend if it should
+output less. The \PDF\ backend accepts a value of~$1$, while the \DVI\ backend
+ignores the value.
+
\section{File syntax}
\LUATEX\ will accept a braced argument as a file name:
@@ -723,6 +762,12 @@ expansion takes place inside the argument.
This allows for embedded spaces, without the need for double quotes. Macro
expansion takes place inside the argument.
+\section{Writing to file}
+
+You can now open upto 127 files with \type {\openout}. When no file is open
+writes will go to the console and log. As a consequence a system command is
+no longer possible but one can use \type {os.execute} to do the same.
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/luatex/luatex-fonts.tex b/doc/context/sources/general/manuals/luatex/luatex-fonts.tex
index 8ea4058a6..937e99c91 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-fonts.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-fonts.tex
@@ -526,6 +526,11 @@ parameters to that command. The allowed commands and their arguments are:
\NC comment \NC any \NC any \NC the arguments of this command are ignored\NC\NR
\stoptabulate
+When a font id is set to~0 then it will be replaced by the currently assigned
+font id. This prevents the need for hackery with future id's (normally one could
+use \type {font.nextid} but when more complex fonts are built in the meantime
+other instances could have been loaded.
+
Here is a rather elaborate glyph commands example:
\starttyping
diff --git a/doc/context/sources/general/manuals/luatex/luatex-languages.tex b/doc/context/sources/general/manuals/luatex/luatex-languages.tex
index 56978b0fd..83c251473 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-languages.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-languages.tex
@@ -334,6 +334,23 @@ Differences between \LUATEX\ and \TEX82 that are a direct result of that:
\stopitem
\stopitemize
+Because we store penalties in the disc node the \type {\discretionary} command has
+been extended to accept an optional penalty specification, so you can do the
+following:
+
+\startbuffer
+\hsize1mm
+1:foo{\hyphenpenalty 10000\discretionary{}{}{}}bar\par
+2:foo\discretionary penalty 10000 {}{}{}bar\par
+3:foo\discretionary{}{}{}bar\par
+\stopbuffer
+
+\typebuffer
+
+This results in:
+
+\blank \start \getbuffer \stop \blank
+
Inserted characters and ligatures inherit their attributes from the nearest glyph
node item (usually the preceding one, but the following one for the items
inserted at the left-hand side of a word).
diff --git a/doc/context/sources/general/manuals/luatex/luatex-libraries.tex b/doc/context/sources/general/manuals/luatex/luatex-libraries.tex
index df03e348d..339f25eaf 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-libraries.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-libraries.tex
@@ -18,7 +18,12 @@ the \LUATEX\ executable. Together, they allow \LUA\ scripts to query and change
number of \TEX's internal variables, run various internal \TEX\ functions, and
set up \LUATEX's hooks to execute \LUA\ code.
-The following sections are in alphabetical order.
+The following sections are in alphabetical order. For any callback (and
+manipulation of nodes) the following is true: you have a lot of freedom which
+also means that you can mess up the node lists and nodes themselves. So, a bit of
+defensive programming doesn't hurt. A crash can happen when you spoil things or
+when \LUATEX\ can recognize the issue, a panic exit will happen. Don't bother the
+team with such issues.
\section{The \type {callback} library}
@@ -532,6 +537,22 @@ represent a hbox. Failure to do so will result in a fatal error.
Setting this callback to \type {false} is possible, but dangerous, because it is
possible you will end up in an unfixable \quote {deadcycles loop}.
+\subsubsection{\type {append_to_vlist_filter}}
+
+This callback is called whenever \LUATEX\ adds a box to a vertical list:
+
+\startfunctioncall
+function(<node> box, <string> locationcode, <number prevdepth>,
+ <boolean> mirrored)
+ return list, prevdepth
+end
+\stopfunctioncall
+
+It is ok to return nothing in which case you also need to flush the box or deal
+with it yourself. The prevdepth is also optional. Locations are \type {box},
+\type {alignment}, \type {equation}, \type {equation_number} and \type
+{post_linebreak}.
+
\subsubsection{\type {post_linebreak_filter}}
This callback is called just after \LUATEX\ has converted a list of nodes into a
@@ -585,6 +606,61 @@ end
This callback does not replace any internal code.
+\subsubsection{\type {hpack_quality} and \type {vpack_quality}}
+
+These two callbacks can be used to intercept the overfull messages. They get a few
+arguments:
+
+\startfunctioncall
+function(<string> incident, <number> detail, <node> head, <number> first,
+ <number> last)
+ return <node> whatever
+end
+\stopfunctioncall
+
+The incident is one of \type {overfull}, \type {underfull}, \type {loose} or
+\type {tight}. The detail is either the amount of overflow (in case of \type
+{overerful}, or the badness. The head is the list that is constructed (when
+protrusion or expansion is enabled, this is an intermediate list). For a hpack
+you can return a node (for instance an overfull rule indicator). That node will
+be appended to the list (just like \TEX's own rule would).
+
+\subsubsection{\type {hpack_quality}}
+
+This callback can be used to intercept the overfull messages that can result from
+packing a horizontal list (as happens in the par builder). The function takes a
+few arguments:
+
+\startfunctioncall
+function(<string> incident, <number> detail, <node> head, <number> first,
+ <number> last)
+ return <node> whatever
+end
+\stopfunctioncall
+
+The incident is one of \type {overfull}, \type {underfull}, \type {loose} or
+\type {tight}. The detail is either the amount of overflow in case of \type
+{overfull}, or the badness otherwise. The head is the list that is constructed
+(when protrusion or expansion is enabled, this is an intermediate list).
+Optionally you can return a node, for instance an overfull rule indicator. That
+node will be appended to the list (just like \TEX's own rule would).
+
+\subsubsection{\type {vpack_quality}}
+
+This callback can be used to intercept the overfull messages that can result from
+packing a vertical list (as happens in the page builder). The function takes a
+few arguments:
+
+\startfunctioncall
+function(<string> incident, <number> detail, <node> head, <number> first,
+ <number> last)
+end
+\stopfunctioncall
+
+The incident is one of \type {overfull}, \type {underfull}, \type {loose} or
+\type {tight}. The detail is either the amount of overflow in case of \type
+{overfull}, or the badness otherwise. The head is the list that is constructed.
+
\subsubsection{\type {pre_output_filter}}
This callback is called when \TEX\ is ready to start boxing the box 255 for \type
@@ -637,6 +713,9 @@ and because it can sometimes be handy when special processing has to take place.
Setting this callback to \type {false} will prevent the internal ligature
creation pass.
+You must not ruin the node list. For instance, the head normally is a local par node,
+and the tail a glue. Messing too much can push \LUATEX\ into panic mode.
+
\subsubsection{\type {kerning}}
\startfunctioncall
@@ -650,6 +729,9 @@ node list it receives. See \type {ligaturing} for calling conventions.
Setting this callback to \type {false} will prevent the internal kern insertion
pass.
+You must not ruin the node list. For instance, the head normally is a local par node,
+and the tail a glue. Messing too much can push \LUATEX\ into panic mode.
+
\subsubsection{\type {mlist_to_hlist}}
This callback replaces \LUATEX's math list to node list conversion algorithm.
@@ -1352,8 +1434,6 @@ conversion in memory and passing the result directly to the backend. This might
save some runtime in one|-|pass workflows. This feature is currently not meant
for production.
-%***********************************************************************
-
\section{The \type {font} library}
The font library provides the interface into the internals of the font system,
@@ -2231,7 +2311,6 @@ The subtables table has:
\NC kernclass \NC table \NC (only if used)\NC \NR
\stoptabulate
-
The kernclass with subtables table has:
\starttabulate[|lT|l|p|]
@@ -2242,6 +2321,10 @@ The kernclass with subtables table has:
\NC offsets \NC array of numbers \NC \NC \NR
\stoptabulate
+Note: the kernclass (as far as we can see) always has one entry so it could be one level
+deep instead. Also the seconds start at \type {[2]} which is close to the fontforge
+internals so we keep that too.
+
\subsubsubsection{gsub table}
This has identical layout to the \type {gpos} table, except for the
@@ -2537,8 +2620,6 @@ reversecoverage:
\NC replacements \NC string \NC \NC \NR
\stoptabulate
-%***********************************************************************
-
\section{The \type {img} library}
The \type {img} library can be used as an alternative to \type {\pdfximage} and
@@ -2610,44 +2691,48 @@ user-supplied and automatic ones.
% hahe: i need to add r/w ro column...
\starttabulate[|l|l|p|]
-\NC \bf field name\NC \bf type \NC description \NC \NR
-\NC attr \NC string \NC the image attributes for \LUATEX \NC \NR
-\NC bbox \NC table \NC table with 4 boundingbox dimensions
- \type {llx}, \type {lly}, \type {urx},
- and \type {ury} overruling the \type {pagebox}
- entry\NC \NR
-\NC colordepth \NC number \NC the number of bits used by the color space\NC \NR
-\NC colorspace \NC number \NC the color space object number \NC \NR
-\NC depth \NC number \NC the image depth for \LUATEX\
- (in scaled points)\NC \NR
-\NC filename \NC string \NC the image file name \NC \NR
-\NC filepath \NC string \NC the full (expanded) file name of the image\NC \NR
-\NC height \NC number \NC the image height for \LUATEX\
- (in scaled points)\NC \NR
-\NC imagetype \NC string \NC one of \type {pdf}, \type {png}, \type {jpg}, \type {jp2},
- \type {jbig2}, or \type {nil} \NC \NR
-\NC index \NC number \NC the \PDF\ image name suffix \NC \NR
-\NC objnum \NC number \NC the \PDF\ image object number \NC \NR
-\NC page \NC ?? \NC the identifier for the requested image page
- (type is number or string,
- default is the number 1)\NC \NR
-\NC pagebox \NC string \NC the requested bounding box, one of
- \type {none}, \type {media}, \type {crop},
- \type {bleed}, \type {trim}, \type {art} \NC \NR
-\NC pages \NC number \NC the total number of available pages \NC \NR
-\NC rotation \NC number \NC the image rotation from included \PDF\ file,
- in multiples of 90~deg. \NC \NR
-\NC stream \NC string \NC the raw stream data for an \type {/Xobject}
- \type {/Form} object\NC \NR
-\NC transform \NC number \NC the image transform, integer number 0..7\NC \NR
-\NC width \NC number \NC the image width for \LUATEX\
- (in scaled points)\NC \NR
-\NC xres \NC number \NC the horizontal natural image resolution
- (in \DPI) \NC \NR
-\NC xsize \NC number \NC the natural image width \NC \NR
-\NC yres \NC number \NC the vertical natural image resolution
- (in \DPI) \NC \NR
-\NC ysize \NC number \NC the natural image height \NC \NR
+\NC \bf field name \NC \bf type \NC description \NC \NR
+\NC attr \NC string \NC the image attributes for \LUATEX \NC \NR
+\NC bbox \NC table \NC table with 4 boundingbox dimensions
+ \type {llx}, \type {lly}, \type {urx},
+ and \type {ury} overruling the \type {pagebox}
+ entry\NC \NR
+\NC colordepth \NC number \NC the number of bits used by the color space\NC \NR
+\NC colorspace \NC number \NC the color space object number \NC \NR
+\NC depth \NC number \NC the image depth for \LUATEX\
+ (in scaled points)\NC \NR
+\NC filename \NC string \NC the image file name \NC \NR
+\NC filepath \NC string \NC the full (expanded) file name of the image\NC \NR
+\NC height \NC number \NC the image height for \LUATEX\
+ (in scaled points)\NC \NR
+\NC imagetype \NC string \NC one of \type {pdf}, \type {png}, \type {jpg}, \type {jp2},
+ \type {jbig2}, or \type {nil} \NC \NR
+\NC index \NC number \NC the \PDF\ image name suffix \NC \NR
+\NC objnum \NC number \NC the \PDF\ image object number \NC \NR
+\NC page \NC ?? \NC the identifier for the requested image page
+ (type is number or string,
+ default is the number 1)\NC \NR
+\NC pagebox \NC string \NC the requested bounding box, one of
+ \type {none}, \type {media}, \type {crop},
+ \type {bleed}, \type {trim}, \type {art} \NC \NR
+\NC pages \NC number \NC the total number of available pages \NC \NR
+\NC rotation \NC number \NC the image rotation from included \PDF\ file,
+ in multiples of 90~deg. \NC \NR
+\NC stream \NC string \NC the raw stream data for an \type {/Xobject}
+ \type {/Form} object\NC \NR
+\NC transform \NC number \NC the image transform, integer number 0..7\NC \NR
+\NC width \NC number \NC the image width for \LUATEX\
+ (in scaled points)\NC \NR
+\NC xres \NC number \NC the horizontal natural image resolution
+ (in \DPI) \NC \NR
+\NC xsize \NC number \NC the natural image width \NC \NR
+\NC yres \NC number \NC the vertical natural image resolution
+ (in \DPI) \NC \NR
+\NC ysize \NC number \NC the natural image height \NC \NR
+\NC visiblefileame \NC string \NC when set, this name will find its way in the
+ \PDF\ file as \type {PTEX} specification; when
+ an empty string is assigned nothing is written
+ to file, otherwise the natural filename is taken \NC \NR
\stoptabulate
A running (undefined) dimension in \type {width}, \type {height}, or \type
@@ -2821,8 +2906,6 @@ This function returns a list with the supported \PDF\ page box names, currently
these are \type {media}, \type {crop}, \type {bleed}, \type {trim}, and \type
{art} (all in lowercase letters).
-%***********************************************************************
-
\section{The \type {kpse} library}
This library provides two separate, but nearly identical interfaces to the
@@ -4279,6 +4362,28 @@ The preferred interface is now \type {pdf.setpageattributes}, \type
properties and \type {pdf.getpageattributes}, \type {pdf.getpageattributes}
and \type {pdf.getpageresources} for querying them.
+\subsection{\type {pdf.<set/get>xformattributes}, \type {pdf.<set/get>xformresources}}
+
+These variables offer a read|-|write interface to related token lists. The value
+types are strings. The variables have no interaction with the corresponding
+\PDFTEX\ token registers \type {\pdfxformattr} and \type {\pdfxformresources}. They
+are written out to the \PDF\ file directly after the \PDFTEX\ token registers.
+
+The preferred interface is now \type {pdf.setxformattributes} and \type
+{pdf.setxformattributes} for setting these properties and \type
+{pdf.getxformattributes} and \type {pdf.getxformresources} for querying them.
+
+\subsection{\type {pdf.setcompresslevel} and \type {pdf.setobjcompresslevel}}
+
+These two functions set the level of compression. The minimum valu sis~0,
+the maximum is~9.
+
+\subsection{\type {pdf.lastobj}, \type {pdf.lastlink}, \type {pdf.lastannot},
+and \type {pdf.retval}}
+
+These status variables are similar to the ones traditionally used at the \TEX\
+end.
+
\subsection{\type {pdf.h}, \type {pdf.v}}
These are the \type {h} and \type {v} values that define the current location on
@@ -4449,6 +4554,15 @@ page without doing anything else. This function can only be used from within
pdf.registerannot (<number> objnum)
\stopfunctioncall
+\subsection{\type {pdf.newcolorstack}}
+
+This function allocates a new color stack and returns it's id. The arguments
+are the same as for the similar backend extension primitive.
+
+\startfunctioncall
+pdf.newcolorstack("0 g","page",true) -- page|direct|origin
+\stopfunctioncall
+
\section{The \type {pdfscanner} library}
The \type {pdfscanner} library allows interpretation of PDF content streams and
@@ -4661,6 +4775,7 @@ The current list is:
\NC hash_size \NC size of hash \NC \NR
\NC hash_extra \NC extra allowed hash \NC \NR
\NC font_ptr \NC number of active fonts \NC \NR
+\NC input_ptr \NC th elevel of input we're at \NC \NR
\NC max_in_stack \NC max used input stack entries \NC \NR
\NC max_nest_stack \NC max used nesting stack entries \NC \NR
\NC max_param_stack \NC max used parameter stack entries \NC \NR
@@ -4683,7 +4798,11 @@ The current list is:
\NC filename \NC name of the current input file \NC \NR
\NC inputid \NC numeric id of the current input \NC \NR
\NC linenumber \NC location in the current input file \NC \NR
-\NC lasterrorstring \NC last error string\NC \NR
+\NC lasterrorstring \NC last tex error string \NC \NR
+\NC lastluaerrorstring \NC last lua error string \NC \NR
+\NC lastwarningtag \NC last warning string\NC \NR
+\NC lastwarningstring \NC last warning tag, normally an indication of in what part\NC \NR
+\NC lasterrorcontext \NC last error context string (with newlines) \NC \NR
\NC luabytecodes \NC number of active \LUA\ bytecode registers \NC \NR
\NC luabytecode_bytes \NC number of bytes in \LUA\ bytecode registers \NC \NR
\NC luastate_bytes \NC number of bytes in use by \LUA\ interpreters \NC \NR
@@ -4697,6 +4816,9 @@ The current list is:
\NC ini_version \NC \type {true} if this is an \INITEX\ run \NC \NR
\stoptabulate
+The error and warning messages can be wiped with the \type {resetmessages}
+function.
+
\section{The \type {tex} library}
The \type {tex} table contains a large list of virtual internal \TEX\
@@ -4726,7 +4848,9 @@ writable as well as readable (stuff like \type {\tracingcommands} and
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
-functions \type {tex.get()} and \type {tex.set()}.
+functions \type {tex.get} and \type {tex.set}. If you created aliasses,
+you can use accessors like \type {tex.getdimen} as these also understand
+names of built|-|in variables.
The exact parameters and return values differ depending on the actual parameter,
and so does whether \type {tex.set} has any effect. For the parameters that {\it
@@ -4735,10 +4859,22 @@ can\/} be set, it is possible to use \type {global} as the first argument to
\startfunctioncall
tex.set (<string> n, ...)
-tex.set ('global', <string> n, ...)
+tex.set ("global", <string> n, ...)
... = tex.get (<string> n)
\stopfunctioncall
+There are also dedicated setters, getters and checkers:
+
+\startfunctioncall
+local d = tex.getdimen("foo")
+if tex.isdimen("bar") then
+ tex.setdimen("bar",d)
+end
+\stopfunctioncall
+
+There are such helpers for \type {dimen}, \type {count}, \type {skip}, \type
+{box} and \type {attribute} registers.
+
\subsubsection{Integer parameters}
The integer parameters accept and return \LUA\ numbers.
@@ -4892,6 +5028,9 @@ tex.splitmaxdepth
tex.vfuzz
tex.voffset
tex.vsize
+tex.prevdepth
+tex.prevgraf
+tex.spacefactor
\stoptyping
\stopthreecolumns
@@ -4907,10 +5046,40 @@ tex.pagegoal
tex.pageshrink
tex.pagestretch
tex.pagetotal
-tex.prevdepth
\stoptyping
\stopthreecolumns
+Beware: as with all \LUA\ tables you can add values to them. So, the following is valid:
+
+\starttyping
+tex.foo = 123
+\stoptyping
+
+When you access a \TEX\ parameter a look up takes place. For read||only variables
+that means that you will get something back, but when you set them you create a
+new entry in the table thereby making the original invisible.
+
+There are a few special cases that we make an exception for: \type {prevdepth},
+\type {prevgraf} and \type {spacefactor}. These normally are accessed via the
+\type {tex.nest} table:
+
+\starttyping
+tex.nest[tex.nest.ptr].prevdepth = p
+tex.nest[tex.nest.ptr].spacefactor = s
+\stoptyping
+
+However, the following also works:
+
+\starttyping
+tex.prevdepth = p
+tex.spacefactor = s
+\stoptyping
+
+Keep in mind that when you mess with node lists directly at the \LUA\ end you
+might need to update the top of the nesting stack's \type {prevdepth} explicitly
+as there is no way \LUATEX\ can guess your intentions. By using the accessor in
+the \type {tex} tables, you get and set the values atthe top of the nest stack.
+
\subsubsection{Direction parameters}
The direction parameters are read|-|only and return a \LUA\ string.
@@ -5118,6 +5287,16 @@ tex.setskip ('global',<string> s, <node> s)
<node> s = tex.getskip (<string> s)
\stopfunctioncall
+We have similar setters for \type {count}, \type {dimen}, \type {muskip}, and
+\type {toks}. Counters and dimen are represented by numbers, skips and muskips by
+nodes, and toks by strings. For tokens registers we have an alternative where a
+catcode table is specified:
+
+\startfunctioncall
+tex.scantoks(0,3,"$e=mc^2$")
+tex.scantoks("global",0,"$\int\limits^1_2$")
+\stopfunctioncall
+
In the function-based interface, it is possible to define values globally by
using the string \type {global} as the first function argument.
@@ -5192,6 +5371,13 @@ And the table for \type {delcode} is an array with 4 numbers, like this:
{<number> small_fam, <number> small_char, <number> large_fam, <number> large_char}
\stoptyping
+You can also avoid the table:
+
+\startfunctioncall
+class, family, char = tex.getmathcodes (<number> n)
+smallfam, smallchar, largefam, largechar = tex.getdelcodes (<number> n)
+\stopfunctioncall
+
Normally, the third and fourth values in a delimiter code assignment will be zero
according to \type {\Udelcode} usage, but the returned table can have values there
(if the delimiter code was set using \type {\delcode}, for example). Unset \type
@@ -5236,6 +5422,28 @@ invalid as well. To prevent this from happening, always use \type
tex.box[0] = node.copy_list(tex.box[2])
\stoptyping
+The following function will register a box for reuse (this is modelled after so
+called xforms in \PDF). You can (re)use the box with \type {\useboxresource} or
+by creating a rule node with subtype~2.
+
+\starttyping
+local index = tex.saveboxresource(n,attributes,resources)
+\stoptyping
+
+You can generate the reference (a rule type) with:
+
+\starttyping
+local reused = tex.useboxresource(n,wd,ht,dp)
+\stoptyping
+
+The dimensions are optional and the final ones are returned as extra values. The
+following is just a bonus (no dimensions returned means that the resource is
+unknown):
+
+\starttyping
+local w, h, d = tex.getboxresourcedimensions(n)
+\stoptyping
+
\subsection{Math parameters}
It is possible to set and query the internal math parameters using:
@@ -5298,6 +5506,10 @@ script crampedscript
scriptscript crampedscriptscript
\stoptyping
+The value is either a number (representing a dimension or number) or a glue spec
+node representing a muskip for \type {ordordspacing} and similar spacing
+parameters.
+
\subsection{Special list heads}
The virtual table \type {tex.lists} contains the set of internal registers that
@@ -5536,6 +5748,26 @@ Associates \type {csname} with the internal font number \type {fontid}. The
definition is global if (and only if) \type {global} is specified and true (the
setting of \type {globaldefs} is not taken into account).
+\subsubsection{\type {tex.getlinenumber} and \type {tex.setlinenumber}}
+
+You can mess with the current line number:
+
+\startfunctioncall
+local n = tex.getlinenumber()
+tex.setlinenumber(n+10)
+\stopfunctioncall
+
+which can be shortcut to:
+
+\startfunctioncall
+tex.setlinenumber(10,true)
+\stopfunctioncall
+
+This might be handy when you have a callback that read numbers from a file and
+combines them in one line (in which case an error message probably has to refer
+to the original line). Interference with \TEX's internal handling of numbers is
+of course possible.
+
\subsubsection{\type {tex.error}}
\startfunctioncall
@@ -5598,15 +5830,15 @@ will define \type {\LuaTeXformatname} with the same intrinsic meaning as the
documented primitive \type {\formatname}, provided that the control sequences \type
{\LuaTeXformatname} is currently undefined.
-Second example:
-
-\starttyping
- tex.enableprimitives('Omega',tex.extraprimitives ('omega'))
-\stoptyping
-
-will define a whole series of csnames like \type {\Omegatextdir}, \type
-{\Omegapardir}, etc., but it will stick with \type {\OmegaVersion} instead of
-creating the doubly-prefixed \type {\OmegaOmegaVersion}.
+% Second example:
+%
+% \starttyping
+% tex.enableprimitives('Omega',tex.extraprimitives ('omega'))
+% \stoptyping
+%
+% will define a whole series of csnames like \type {\Omegatextdir}, \type
+% {\Omegapardir}, etc., but it will stick with \type {\OmegaVersion} instead of
+% creating the doubly-prefixed \type {\OmegaOmegaVersion}.
When \LUATEX\ is run with \type {--ini} only the \TEX82 primitives and \type
{\directlua} are available, so no extra primitives {\bf at all}.
@@ -5655,22 +5887,20 @@ end
\NC tex \NC \ctxlua{document.showprimitives('tex') } \NC \NR
\NC core \NC \ctxlua{document.showprimitives('core') } \NC \NR
\NC etex \NC \ctxlua{document.showprimitives('etex') } \NC \NR
-\NC pdftex \NC \ctxlua{document.showprimitives('pdftex') } \NC \NR
\NC luatex \NC \ctxlua{document.showprimitives('luatex') } \NC \NR
-\NC umath \NC \ctxlua{document.showprimitives('umath') } \NC \NR
\stoptabulate
Note that \type {'luatex'} does not contain \type {directlua}, as that
isconsidered to be a core primitive, along with all the \TEX82 primitives, so it
is part of the list that is returned from \type {'core'}.
-\type {'umath'} is a subset of \type {'luatex'} that covers the Unicode math
-primitives as it might be desired to handle the prefixing of that subset
-differently.
+% \type {'umath'} is a subset of \type {'luatex'} that covers the Unicode math
+% primitives as it might be desired to handle the prefixing of that subset
+% differently.
Running \type {tex.extraprimitives()} will give you the complete list of
primitives \type {-ini} startup. It is exactly equivalent to \type
-{tex.extraprimitives('etex', 'pdftex' and 'luatex')}.
+{tex.extraprimitives('etex' and 'luatex')}.
\subsubsection{\type {tex.primitives}}
@@ -5683,6 +5913,12 @@ about. The keys in the hash are primitives names, the values are tables
representing tokens (see~\in{section }[luatokens]). The third value is always
zero.
+{\em In the beginning we had \type {omega} and \type {pdftex} subsets but in the
+meantime relevant primitives ave been promoted (either or not adapted) to the
+\type {luatex} set when found useful, or removed when considered to be of no use.
+Originally we had two sets of math definition primitives but the \OMEGA\ ones
+have been removed, so we no longer have a subset for math either.}
+
\subsection{Core functionality interfaces}
\subsubsection{\type {tex.badness}}
@@ -5899,7 +6135,10 @@ This function behaves like \type {texio.write}, but make sure that the given
strings will appear at the beginning of a new line. You can pass a single empty
string if you only want to move to the next line.
-\section[luatokens]{The \type {token} library}
+\section[luatokens]{The \type {oldtoken} library (obsolete)}
+
+{\em Nota Bene: This library will disappear soon. It is replaced by the \type
+{token} library, that used to be called \type {newroken}.}
The \type {token} table contains interface functions to \TEX's handling of
tokens. These functions are most useful when combined with the \type
@@ -5918,49 +6157,49 @@ consists of three numeric entries:
{equivalence table} \NC \NR
\stoptabulate
-\subsection{\type {token.get_next}}
+\subsection{\type {oldtoken.get_next}}
\startfunctioncall
-token t = token.get_next()
+token t = oldtoken.get_next()
\stopfunctioncall
This fetches the next input token from the current input source, without
expansion.
-\subsection{\type {token.is_expandable}}
+\subsection{\type {oldtoken.is_expandable}}
\startfunctioncall
-<boolean> b = token.is_expandable(<token> t)
+<boolean> b = oldtoken.is_expandable(<token> t)
\stopfunctioncall
This tests if the token \type {t} could be expanded.
-\subsection{\type {token.expand}}
+\subsection{\type {oldtoken.expand}}
\startfunctioncall
-token.expand(<token> t)
+oldtoken.expand(<token> t)
\stopfunctioncall
If a token is expandable, this will expand one level of it, so that the first
token of the expansion will now be the next token to be read by \type
-{token.get_next()}.
+{oldtoken.get_next()}.
-\subsection{\type {token.is_activechar}}
+\subsection{\type {oldtoken.is_activechar}}
\startfunctioncall
-<boolean> b = token.is_activechar(<token> t)
+<boolean> b = oldtoken.is_activechar(<token> t)
\stopfunctioncall
This is a special test that is sometimes handy. Discovering whether some control
sequence is the result of an active character turned out to be very hard
otherwise.
-\subsection{\type {token.create}}
+\subsection{\type {oldtoken.create}}
\startfunctioncall
-token t = token.create(<string> csname)
-token t = token.create(<number> charcode)
-token t = token.create(<number> charcode, <number> catcode)
+token t = oldtoken.create(<string> csname)
+token t = oldtoken.create(<number> charcode)
+token t = oldtoken.create(<number> charcode, <number> catcode)
\stopfunctioncall
This is the token factory. If you feed it a string, then it is the name of a
@@ -5972,17 +6211,17 @@ optional second number gives its category code. This means it is possible to
overrule a character's category code, with a few exceptions: the category codes~0
(escape), 9~(ignored), 13~(active), 14~(comment), and 15 (invalid) cannot occur
inside a token. The values~0, 9, 14 and~15 are therefore illegal as input to
-\type {token.create()}, and active characters will be resolved immediately.
+\type {oldtoken.create()}, and active characters will be resolved immediately.
Note: unknown string sequences and never defined active characters will result in
a token representing an \quote {undefined control sequence} with a near|-|random
name. It is {\em not} possible to define brand new control sequences using
-\type {token.create}!
+\type {oldtoken.create}!
-\subsection{\type {token.command_name}}
+\subsection{\type {oldtoken.command_name}}
\startfunctioncall
-<string> commandname = token.command_name(<token> t)
+<string> commandname = oldtoken.command_name(<token> t)
\stopfunctioncall
This returns the name associated with the \quote {command} value of the token in
@@ -5990,19 +6229,19 @@ This returns the name associated with the \quote {command} value of the token in
primitives. For instance, all \type {\ifxxx} tests are grouped under \type
{if_test}, and the \quote {command modifier} defines which test is to be run.
-\subsection{\type {token.command_id}}
+\subsection{\type {oldtoken.command_id}}
\startfunctioncall
-<number> i = token.command_id(<string> commandname)
+<number> i = oldtoken.command_id(<string> commandname)
\stopfunctioncall
This returns a number that is the inverse operation of the previous command, to
be used as the first item in a token table.
-\subsection{\type {token.csname_name}}
+\subsection{\type {oldtoken.csname_name}}
\startfunctioncall
-<string> csname = token.csname_name(<token> t)
+<string> csname = oldtoken.csname_name(<token> t)
\stopfunctioncall
This returns the name associated with the \quote {equivalence table} value of the
@@ -6013,20 +6252,20 @@ Keep in mind that there are potentially two control sequences that return the
same csname string: single character control sequences and active characters have
the same \quote {name}.
-\subsection{\type {token.csname_id}}
+\subsection{\type {oldtoken.csname_id}}
\startfunctioncall
-<number> i = token.csname_id(<string> csname)
+<number> i = oldtoken.csname_id(<string> csname)
\stopfunctioncall
This returns a number that is the inverse operation of the previous command, to
be used as the third item in a token table.
-\subsection{The \type {newtoken} libray}
+\subsection{The \type {token} libray}
The current \type {token} library will be replaced by a new one that is more
flexible and powerful. The transition takes place in steps. In version 0.80 we
-have \type {newtoken} and in version 0.85 the old lib will be replaced
+have \type {token} and in version 0.85 the old lib will be replaced
completely. So if you use this new mechanism in production code you need to be
aware of incompatible updates between 0.80 and 0.90. Because the related in- and
output code will also be cleaned up and rewritten you should be aware of
@@ -6041,7 +6280,7 @@ parsers without too much overhead. It's up to macro package writers to see how
they can benefit from this as the main principle behind \LUATEX\ is to provide a
minimal set of tools and no solutions.
-The current functions in the \type {newtoken} namespace are given in the next
+The current functions in the \type {token} namespace are given in the next
table:
\starttabulate[|lT|lT|p|]
@@ -6057,6 +6296,8 @@ table:
\NC scan_code \NC bitset \NC returns a character if its category is in the given bitset (representing catcodes) \NC \NR
\NC 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 scan_word \NC \NC returns a sequence of characters with catcode 11 or 12 as string \NC \NR
+\NC scan_csname \NC \NC returns \type {foo} after scanning \type {\foo} \NC \NR
+\NC set_macro \NC see below \NC assign a macro \NC \NR
\NC create \NC \NC returns a userdata token object of the given control sequence name (or character); this interface can change \NC \NR
\stoptabulate
@@ -6086,9 +6327,9 @@ following definition:
we get:
\starttabulate[|l|Tl|l|]
-\NC \type {\directlua{newtoken.scan_string()}{foo}} \NC \directlua{context("{\\red\\type {"..newtoken.scan_string().."}}")} {foo} \NC full expansion \NR
-\NC \type {\directlua{newtoken.scan_string()}foo} \NC \directlua{context("{\\red\\type {"..newtoken.scan_string().."}}")} foo \NC letters and others \NR
-\NC \type {\directlua{newtoken.scan_string()}\foo} \NC \directlua{context("{\\red\\type {"..newtoken.scan_string().."}}")}\foo \NC meaning \NR
+\NC \type {\directlua{token.scan_string()}{foo}} \NC \directlua{context("{\\red\\type {"..token.scan_string().."}}")} {foo} \NC full expansion \NR
+\NC \type {\directlua{token.scan_string()}foo} \NC \directlua{context("{\\red\\type {"..token.scan_string().."}}")} foo \NC letters and others \NR
+\NC \type {\directlua{token.scan_string()}\foo} \NC \directlua{context("{\\red\\type {"..token.scan_string().."}}")}\foo \NC meaning \NR
\stoptabulate
The \type {\foo} case only gives the meaning, but one can pass an already
@@ -6099,8 +6340,8 @@ do expand.
The \type {scan_word} scanner can be used to implement for instance a number scanner:
\starttyping
-function newtokens.scan_number(base)
- return tonumber(newtoken.scan_word(),base)
+function token.scan_number(base)
+ return tonumber(token.scan_word(),base)
end
\stoptyping
@@ -6110,7 +6351,7 @@ in the input.
The creator function can be used as follows:
\starttyping
-local t = newtoken("relax")
+local t = token("relax")
\stoptyping
This gives back a token object that has the properties of the \type {\relax}
@@ -6159,7 +6400,7 @@ You can also do this:
\starttyping
\directlua {
function mymacro()
- local d = newtoken.scan_dimen()
+ local d = token.scan_dimen()
...
end
}
@@ -6194,6 +6435,30 @@ more so we know then what will stay and go. A positive side effect of this
transition is that we can simplify the input part because we no longer need to
intercept using callbacks.
+The \type {set_macro} function can get upto 4 arguments:
+
+\starttyping
+setmacro("csname","content")
+setmacro("csname","content","global")
+setmacro("csname")
+\stoptyping
+
+You can pass a catcodetable identifier as first argument:
+
+\starttyping
+setmacro(catcodetable,"csname","content")
+setmacro(catcodetable,"csname","content","global")
+setmacro(catcodetable,"csname")
+\stoptyping
+
+The results are like:
+
+\starttyping
+ \def\csname{content}
+\gdef\csname{content}
+ \def\csname{}
+\stoptyping
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/luatex/luatex-lua.tex b/doc/context/sources/general/manuals/luatex/luatex-lua.tex
index 3fe2ec9ad..86ddc17e8 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-lua.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-lua.tex
@@ -156,6 +156,15 @@ Then it checks the various safety switches. You can use those to disable some
Furthermore, it disables loading of compiled \LUA\ libraries and it makes \type
{io.open()} fail on files that are opened for anything besides reading.
+When \LUATEX\ starts it set the locale to a neutral value. If for some reason you use
+\type {os.locale}, you need to make sire you nil it afterwards because otherise it
+can interfere with code that for instance generates dates. You can nil the
+locale with
+
+\starttyping
+os.setlocale(nil.nil)
+\stoptyping
+
\type {--nosocket} makes the socket library unavailable, so that \LUA\ cannot use
networking.
@@ -242,7 +251,7 @@ for this variable is \type {CLUAINPUTS}, and by default it has this value:
\starttyping
CLUAINPUTS=.:$SELFAUTOLOC/lib/{$progname,$engine,}/lua//
-\stoptyping % $
+\stoptyping
This path is imperfect (it requires a \TDS\ subtree below the binaries
directory), but the architecture has to be in the path somewhere, and the
diff --git a/doc/context/sources/general/manuals/luatex/luatex-math.tex b/doc/context/sources/general/manuals/luatex/luatex-math.tex
index 88809d9d9..6c83b7786 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-math.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-math.tex
@@ -91,7 +91,7 @@ Unaltered:
New primitives that are compatible with \XETEX:
\starttabulate[|l|l|l|l|]
-\NC \bf primitive \NC \bf value range (in hex) \NC \NR
+\NC \bf primitive \NC \bf value range (in hex) \NC \NR
\NC \type {\Umathchardef} \NC 0+0+0--7+FF+10FFFF$^1$ \NC \NR
\NC \type {\Umathcharnumdef}$^5$ \NC -80000000--7FFFFFFF$^3$ \NC \NR
\NC \type {\Umathcode} \NC 0--10FFFF = 0+0+0--7+FF+10FFFF$^1$ \NC \NR
@@ -105,15 +105,19 @@ New primitives that are compatible with \XETEX:
\NC \type {\Udelcodenum} \NC 0--10FFFF = -80000000--7FFFFFFF$^3$ \NC \NR
\stoptabulate
-Note 1: \type {\Umathchardef<csname>="8"0"0} and \type
-{\Umathchardef<number>="8"0"0} are also accepted.
+Specifications typically look like:
-Note 2: The new primitives that deal with delimiter-style objects do not set up a
+\starttyping
+\Umathchardef\xx="1"0"456
+\Umathcode 123="1"0"789
+\stoptyping
+
+Note 1: The new primitives that deal with delimiter-style objects do not set up a
\quote {large family}. Selecting a suitable size for display purposes is expected
to be dealt with by the font via the \type {\Umathoperatorsize} parameter (more
information can be found in a following section).
-Note 3: For these three primitives, all information is packed into a single
+Note 2: For these three primitives, all information is packed into a single
signed integer. For the first two (\type {\Umathcharnum} and \type {\Umathcodenum}),
the lowest 21 bits are the character code, the 3 bits above that represent the
math class, and the family data is kept in the topmost bits (This means that the
@@ -124,7 +128,7 @@ natural as using the two- and three-value commands, so unless you know exactly
what you are doing and absolutely require the speedup resulting from the faster
input scanning, it is better to use the verbose commands instead.
-Note 4: The \type {\Umathaccent} command accepts optional keywords to control
+Note 3: The \type {\Umathaccent} command accepts optional keywords to control
various details regarding math accents. See \in {section} [mathacc] below for
details.
@@ -154,6 +158,74 @@ in following sections):
These additional commands are not all that valuable on their own, but they come
in handy as arguments to the math parameter settings that will be added shortly.
+In Eijkhouts \quotation {\TEX\ by Topic} the rules for handling styles in scripts
+are described as follows:
+
+\startitemize
+\startitem
+ In any style superscripts and subscripts are taken from the next smaller style.
+ Exception: in display style they are taken in script style.
+\stopitem
+\startitem
+ Subscripts are always in the cramped variant of the style; superscripts are only
+ cramped if the original style was cramped.
+\stopitem
+\startitem
+ In an \type {..\over..} formula in any style the numerator and denominator are
+ taken from the next smaller style.
+\stopitem
+\startitem
+ The denominator is always in cramped style; the numerator is only in cramped
+ style if the original style was cramped.
+\stopitem
+\startitem
+ Formulas under a \type {\sqrt} or \type {\overline} are in cramped style.
+\stopitem
+\stopitemize
+
+In \LUATEX\ one can set the styles in more detail which means that you sometimes
+have to set both normal and cramped styles to get the effect you want. If we
+force styles in the scriptr using \type {\scriptstyle} and \type {\crampedscriptstyle}
+we get this:
+
+\startbuffer[demo]
+\starttabulate
+\NC default \NC $b_{x=xx}^{x=xx}$ \NC \NR
+\NC script \NC $b_{\scriptstyle x=xx}^{\scriptstyle x=xx}$ \NC \NR
+\NC crampedscript \NC $b_{\crampedscriptstyle x=xx}^{\crampedscriptstyle x=xx}$ \NC \NR
+\stoptabulate
+\stopbuffer
+
+\getbuffer[demo]
+
+Now we set the following parameters
+
+\startbuffer[setup]
+\Umathordrelspacing\scriptstyle=30mu
+\Umathordordspacing\scriptstyle=30mu
+\stopbuffer
+
+\typebuffer[setup]
+
+This gives:
+
+\start\getbuffer[setup,demo]\stop
+
+But, as this is not what is expected (visually) we should say:
+
+\startbuffer[setup]
+\Umathordrelspacing\scriptstyle=30mu
+\Umathordordspacing\scriptstyle=30mu
+\Umathordrelspacing\crampedscriptstyle=30mu
+\Umathordordspacing\crampedscriptstyle=30mu
+\stopbuffer
+
+\typebuffer[setup]
+
+Now we get:
+
+\start\getbuffer[setup,demo]\stop
+
\section{Math parameter settings}
In \LUATEX, the font dimension parameters that \TEX\ used in math typesetting are
@@ -161,10 +233,10 @@ now accessible via primitive commands. In fact, refactoring of the math engine
has resulted in many more parameters than were accessible before.
\starttabulate
-\NC \bf primitive name \NC \bf description \NC \NR
+\NC \bf primitive name \NC \bf description \NC \NR
\NC \type {\Umathquad} \NC the width of 18mu's \NC \NR
\NC \type {\Umathaxis} \NC height of the vertical center axis of
- the math formula above the baseline \NC \NR
+ the math formula above the baseline \NC \NR
\NC \type {\Umathoperatorsize} \NC minimum size of large operators in display mode \NC \NR
\NC \type {\Umathoverbarkern} \NC vertical clearance above the rule \NC \NR
\NC \type {\Umathoverbarrule} \NC the width of the rule \NC \NR
@@ -176,15 +248,15 @@ has resulted in many more parameters than were accessible before.
\NC \type {\Umathradicalrule} \NC the width of the rule \NC \NR
\NC \type {\Umathradicalvgap} \NC vertical clearance below the rule \NC \NR
\NC \type {\Umathradicaldegreebefore}\NC the forward kern that takes place before placement of
- the radical degree \NC \NR
+ the radical degree \NC \NR
\NC \type {\Umathradicaldegreeafter} \NC the backward kern that takes place after placement of
- the radical degree \NC \NR
+ the radical degree \NC \NR
\NC \type {\Umathradicaldegreeraise} \NC this is the percentage of the total height and depth of
- the radical sign that the degree is raised by. It is
- expressed in \type {percents}, so 60\% is expressed as the
- integer $60$. \NC \NR
+ the radical sign that the degree is raised by. It is
+ expressed in \type {percents}, so 60\% is expressed as the
+ integer $60$. \NC \NR
\NC \type {\Umathstackvgap} \NC vertical clearance between the two
- elements in a \type {\atop} stack \NC \NR
+ elements in a \type {\atop} stack \NC \NR
\NC \type {\Umathstacknumup} \NC numerator shift upward in \type {\atop} stack \NC \NR
\NC \type {\Umathstackdenomdown} \NC denominator shift downward in \type {\atop} stack \NC \NR
\NC \type {\Umathfractionrule} \NC the width of the rule in a \type {\over} \NC \NR
@@ -209,11 +281,11 @@ has resulted in many more parameters than were accessible before.
\NC \type {\Umathsupshiftup} \NC superscript raise for characters \NC \NR
\NC \type {\Umathsubsupshiftdown} \NC subscript drop in the presence of a superscript \NC \NR
\NC \type {\Umathsubtopmax} \NC the top of standalone subscripts cannot be higher than this
- above the baseline \NC \NR
+ above the baseline \NC \NR
\NC \type {\Umathsupbottommin} \NC the bottom of standalone superscripts cannot be less than
- this above the baseline \NC \NR
+ this above the baseline \NC \NR
\NC \type {\Umathsupsubbottommax} \NC the bottom of the superscript of a combined super- and subscript
- be at least as high as this above the baseline \NC \NR
+ be at least as high as this above the baseline \NC \NR
\NC \type {\Umathsubsupvgap} \NC vertical clearance between super- and subscript \NC \NR
\NC \type {\Umathspaceafterscript} \NC additional space added after a super- or subscript \NC \NR
\NC \type {\Umathconnectoroverlapmin}\NC minimum overlap between parts in an extensible recipe \NC \NR
@@ -228,6 +300,20 @@ Each of the parameters in this section can be set by a command like this:
they obey grouping, and you can use \type {\the\Umathquad\displaystyle} if
needed.
+\section{Skips around display math}
+
+The injection of \type {\abovedisplayskip} and \type {\belowdisplayskip} is not symmetrical. An
+above one is always inserted, also when zero, but the below is only inserted when larger than
+zero. Especially the later mkes it sometimes hard to fully control spacing. Therefore \LUATEX\
+comes with a new directive: \type {\mathdisplayskipmode}. The following values apply:
+
+\starttabulate
+\NC 0 \NC normal tex behaviour: always above, only below when larger than zero \NC \NR
+\NC 1 \NC always \NC \NR
+\NC 2 \NC only when not zero \NC \NR
+\NC 3 \NC never, not even when not zero \NC \NR
+\stoptabulate
+
\section{Font-based Math Parameters}
While it is nice to have these math parameters available for tweaking, it would
@@ -257,20 +343,22 @@ dimension parameter. For math fonts, this should be set to zero.
\switchtobodyfont[8pt]
\starttabulate[|l|l|l|p|]
-\NC \bf variable \NC \bf style \NC \bf default value opentype \NC \bf default value tfm \NC \NR
+\NC \bf variable \NC \bf style \NC \bf default value opentype \NC \bf default value tfm \NC \NR
\NC \type {\Umathaxis} \NC -- \NC AxisHeight \NC axis_height \NC \NR
\NC \type {\Umathoperatorsize} \NC D, D' \NC DisplayOperatorMinHeight \NC $^6$ \NC \NR
\NC \type {\Umathfractiondelsize} \NC D, D' \NC FractionDelimiterDisplayStyleSize$^9$ \NC delim1 \NC \NR
-\NC " \NC T, T', S, S', SS, SS' \NC FractionDelimiterSize$^9$ \NC delim2 \NC \NR
+\NC \NC T, T', S, S', SS, SS' \NC FractionDelimiterSize$^9$ \NC delim2 \NC \NR
\NC \type {\Umathfractiondenomdown} \NC D, D' \NC FractionDenominatorDisplayStyleShiftDown \NC denom1 \NC \NR
-\NC " \NC T, T', S, S', SS, SS' \NC FractionDenominatorShiftDown \NC denom2 \NC \NR
+\NC \NC T, T', S, S', SS, SS' \NC FractionDenominatorShiftDown \NC denom2 \NC \NR
\NC \type {\Umathfractiondenomvgap} \NC D, D' \NC FractionDenominatorDisplayStyleGapMin \NC 3*default_rule_thickness \NC \NR
-\NC " \NC T, T', S, S', SS, SS' \NC FractionDenominatorGapMin \NC default_rule_thickness \NC \NR
+\NC \NC T, T', S, S', SS, SS' \NC FractionDenominatorGapMin \NC default_rule_thickness \NC \NR
\NC \type {\Umathfractionnumup} \NC D, D' \NC FractionNumeratorDisplayStyleShiftUp \NC num1 \NC \NR
-\NC " \NC T, T', S, S', SS, SS' \NC FractionNumeratorShiftUp \NC num2 \NC \NR
+\NC \NC T, T', S, S', SS, SS' \NC FractionNumeratorShiftUp \NC num2 \NC \NR
\NC \type {\Umathfractionnumvgap} \NC D, D' \NC FractionNumeratorDisplayStyleGapMin \NC 3*default_rule_thickness \NC \NR
-\NC " \NC T, T', S, S', SS, SS' \NC FractionNumeratorGapMin \NC default_rule_thickness \NC \NR
+\NC \NC T, T', S, S', SS, SS' \NC FractionNumeratorGapMin \NC default_rule_thickness \NC \NR
\NC \type {\Umathfractionrule} \NC -- \NC FractionRuleThickness \NC default_rule_thickness \NC \NR
+\NC \type {\Umathskewedfractionhgap} \NC -- \NC SkewedFractionHorizontalGap \NC math_quad/2 \NC \NR
+\NC \type {\Umathskewedfractionvgap} \NC -- \NC SkewedFractionVerticalGap \NC math_x_height \NC \NR
\NC \type {\Umathlimitabovebgap} \NC -- \NC UpperLimitBaselineRiseMin \NC big_op_spacing3 \NC \NR
\NC \type {\Umathlimitabovekern} \NC -- \NC 0$^1$ \NC big_op_spacing5 \NC \NR
\NC \type {\Umathlimitabovevgap} \NC -- \NC UpperLimitGapMin \NC big_op_spacing1 \NC \NR
@@ -288,30 +376,30 @@ dimension parameter. For math fonts, this should be set to zero.
\NC \type {\Umathradicalkern} \NC -- \NC RadicalExtraAscender \NC default_rule_thickness \NC \NR
\NC \type {\Umathradicalrule} \NC -- \NC RadicalRuleThickness \NC <not set>$^2$ \NC \NR
\NC \type {\Umathradicalvgap} \NC D, D' \NC RadicalDisplayStyleVerticalGap \NC (default_rule_thickness+\crlf
- (abs(math_x_height)/4))$^3$ \NC \NR
-\NC " \NC T, T', S, S', SS, SS' \NC RadicalVerticalGap \NC (default_rule_thickness+\crlf
- (abs(default_rule_thickness)/4))$^3$ \NC \NR
+ (abs(math_x_height)/4))$^3$ \NC \NR
+\NC \NC T, T', S, S', SS, SS' \NC RadicalVerticalGap \NC (default_rule_thickness+\crlf
+ (abs(default_rule_thickness)/4))$^3$ \NC \NR
\NC \type {\Umathradicaldegreebefore} \NC -- \NC RadicalKernBeforeDegree \NC <not set>$^2$ \NC \NR
\NC \type {\Umathradicaldegreeafter} \NC -- \NC RadicalKernAfterDegree \NC <not set>$^2$ \NC \NR
\NC \type {\Umathradicaldegreeraise} \NC -- \NC RadicalDegreeBottomRaisePercent \NC <not set>$^{2,7}$ \NC \NR
\NC \type {\Umathspaceafterscript} \NC -- \NC SpaceAfterScript \NC script_space$^4$ \NC \NR
\NC \type {\Umathstackdenomdown} \NC D, D' \NC StackBottomDisplayStyleShiftDown \NC denom1 \NC \NR
-\NC " \NC T, T', S, S', SS, SS' \NC StackBottomShiftDown \NC denom2 \NC \NR
+\NC \NC T, T', S, S', SS, SS' \NC StackBottomShiftDown \NC denom2 \NC \NR
\NC \type {\Umathstacknumup} \NC D, D' \NC StackTopDisplayStyleShiftUp \NC num1 \NC \NR
-\NC " \NC T, T', S, S', SS, SS' \NC StackTopShiftUp \NC num3 \NC \NR
+\NC \NC T, T', S, S', SS, SS' \NC StackTopShiftUp \NC num3 \NC \NR
\NC \type {\Umathstackvgap} \NC D, D' \NC StackDisplayStyleGapMin \NC 7*default_rule_thickness \NC \NR
-\NC " \NC T, T', S, S', SS, SS' \NC StackGapMin \NC 3*default_rule_thickness \NC \NR
+\NC \NC T, T', S, S', SS, SS' \NC StackGapMin \NC 3*default_rule_thickness \NC \NR
\NC \type {\Umathsubshiftdown} \NC -- \NC SubscriptShiftDown \NC sub1 \NC \NR
\NC \type {\Umathsubshiftdrop} \NC -- \NC SubscriptBaselineDropMin \NC sub_drop \NC \NR
\NC \type {\Umathsubsupshiftdown} \NC -- \NC SubscriptShiftDownWithSuperscript$^8$ \NC \NC \NR
-\NC \NC \NC \quad\ or SubscriptShiftDown \NC sub2 \NC \NR
+\NC \NC \NC \quad\ or SubscriptShiftDown \NC sub2 \NC \NR
\NC \type {\Umathsubtopmax} \NC -- \NC SubscriptTopMax \NC (abs(math_x_height * 4) / 5) \NC \NR
\NC \type {\Umathsubsupvgap} \NC -- \NC SubSuperscriptGapMin \NC 4*default_rule_thickness \NC \NR
\NC \type {\Umathsupbottommin} \NC -- \NC SuperscriptBottomMin \NC (abs(math_x_height) / 4) \NC \NR
\NC \type {\Umathsupshiftdrop} \NC -- \NC SuperscriptBaselineDropMax \NC sup_drop \NC \NR
\NC \type {\Umathsupshiftup} \NC D \NC SuperscriptShiftUp \NC sup1 \NC \NR
-\NC " \NC T, S, SS, \NC SuperscriptShiftUp \NC sup2 \NC \NR
-\NC " \NC D', T', S', SS' \NC SuperscriptShiftUpCramped \NC sup3 \NC \NR
+\NC \NC T, S, SS, \NC SuperscriptShiftUp \NC sup2 \NC \NR
+\NC \NC D', T', S', SS' \NC SuperscriptShiftUpCramped \NC sup3 \NC \NR
\NC \type {\Umathsupsubbottommax} \NC -- \NC SuperscriptBottomMaxWithSubscript \NC (abs(math_x_height * 4) / 5) \NC \NR
\NC \type {\Umathunderbarkern} \NC -- \NC UnderbarExtraDescender \NC default_rule_thickness \NC \NR
\NC \type {\Umathunderbarrule} \NC -- \NC UnderbarRuleThickness \NC default_rule_thickness \NC \NR
@@ -498,13 +586,23 @@ font of the accentee (as explained in the \TEX book), but if value that turns ou
to be zero and the font had a MathConstants table, then \type {AccentBaseHeight}
is used instead.
-If a math bottom accent has to be placed, the \type {bot_accent} value is checked
-instead of \type {top_accent}. Because bottom accents do not exist in \TEX82, the
-\type {\skewchar} kern is ignored.
+% there is no bot_accent in opentype math
+%
+% If a math bottom accent has to be placed, the \type {bot_accent} value is checked
+% instead of \type {top_accent}. Because bottom accents do not exist in \TEX82, the
+% \type {\skewchar} kern is ignored.
The vertical placement of a bottom accent is straight below the accentee, no
correction takes place.
+Possible locations are \type {top}, \type {bottom}, \type {both} and \type
+{center}. When no location is given \type {top} is assumed. An additional
+parameter \type {fraction} can be specified followed by a number; a value of for
+instance 1200 means that the criterium is 1.2 times the width of the nuclues. The
+fraction only aplies to the stepwise selected shapes and is mostly meant for the
+\type {overlay} location. It also works for the other locations but then it
+concerns the width.
+
\section{Math root extension}
The new primitive \type {\Uroot} allows the construction of a radical noad
@@ -607,12 +705,126 @@ The vertical placements are controlled by \type {\Umathunderdelimiterbgap}, \typ
The superscript in \type {\Uoverdelimiter} is typeset in a suitable scripted style,
the subscript in \type {\Uunderdelimiter} is cramped as well.
-\section {Extensible delimiters}
+These primitives accepts an option \type {width} specification. When used the
+also optional keywords \type {left}, \type {middle} and \type {right} will
+determine what happens when a requested size can't be met (which can happen when
+we step to successive larger variants).
+
+An extra primitive \type {\Uhextensible} is available that can be used like this:
+
+\startbuffer
+$\Uhextensible width 10cm 0 "2194$
+\stopbuffer
+
+\typebuffer This will render this:
+
+\blank \startnarrower \getbuffer \stopnarrower \blank
+
+Here you can also pass options, like:
+
+\startbuffer
+$\Uhextensible width 1pt middle 0 "2194$
+\stopbuffer
+
+\typebuffer This gives:
+
+\blank \startnarrower \getbuffer \stopnarrower \blank
\LUATEX\ internally uses a structure that supports \OPENTYPE\ \quote
{MathVariants} as well as \TFM\ \quote {extensible recipes}.
-\section{Other Math changes}
+\section {Extracting values}
+
+You can extract the components of a math character. Say that we have defined:
+
+\starttyping
+\Umathcode 1 2 3 4
+\stoptyping
+
+then
+
+\starttyping
+[\Umathcharclass1] [\Umathcharfam1] [\Umathcharslot1]
+\stoptyping
+
+will return:
+
+\starttyping
+[2] [3] [4]
+\stoptyping
+
+These commands are provides as convenience. before they came available you could
+do the following:
+
+\starttyping
+\def\Umathcharclass{\directlua{tex.print(tex.getmathcode(token.scan_int())[1])}}
+\def\Umathcharfam {\directlua{tex.print(tex.getmathcode(token.scan_int())[2])}}
+\def\Umathcharslot {\directlua{tex.print(tex.getmathcode(token.scan_int())[3])}}
+\stoptyping
+
+\section{fractions}
+
+The \type {\abovewithdelims} command accepts a keyword \type {exact}. When issued
+the extra space relative to the rule thickness is not added. One can of course
+use the \type {\Umathfraction..gap} commands to influence the spacing. Also the
+rule is still positioned around the math axis.
+
+\starttyping
+$$ { {a} \abovewithdelims() exact 4pt {b} }$$
+\stoptyping
+
+The math parameter table contains some parameters that specify a horizontal and
+vertical gap for skewed fractions. Of course some guessing is needed in order to
+implement something that uses then. And so we now provide a primitive similar to the
+other fraction related ones but with a few options so that one can influence the
+rendering. Of course a user can mess around a bit with the parameters
+\type {\Umathskewedfractionhgap} and \type {\Umathskewedfractionvgap}.
+
+The syntax used here is:
+
+\starttyping
+{ {1} \Uskewed / <options> {2} }
+{ {1} \Uskewedwithdelims / () <options> {2} }
+\stoptyping
+
+where the options can be \type {noaxis} and \type {exact}. By default we add half
+the axis to the shifts and by default we zero the width of the middle character.
+For Latin Modern The result looks as follows:
+
+\def\ShowA#1#2#3{$x + { {#1} \Uskewed / #3 {#2} } + x$}
+\def\ShowB#1#2#3{$x + { {#1} \Uskewedwithdelims / () #3 {#2} } + x$}
+
+\start
+ \switchtobodyfont[modern]
+ \starttabulate[||||||]
+ \NC \NC
+ \ShowA{a}{b}{} \NC
+ \ShowA{1}{2}{} \NC
+ \ShowB{a}{b}{} \NC
+ \ShowB{1}{2}{} \NC
+ \NR
+ \NC \type{exact} \NC
+ \ShowA{a}{b}{exact} \NC
+ \ShowA{1}{2}{exact} \NC
+ \ShowB{a}{b}{exact} \NC
+ \ShowB{1}{2}{exact} \NC
+ \NR
+ \NC \type{noaxis} \NC
+ \ShowA{a}{b}{noaxis} \NC
+ \ShowA{1}{2}{noaxis} \NC
+ \ShowB{a}{b}{noaxis} \NC
+ \ShowB{1}{2}{noaxis} \NC
+ \NR
+ \NC \type{exact noaxis} \NC
+ \ShowA{a}{b}{exact noaxis} \NC
+ \ShowA{1}{2}{exact noaxis} \NC
+ \ShowB{a}{b}{exact noaxis} \NC
+ \ShowB{1}{2}{exact noaxis} \NC
+ \NR
+ \stoptabulate
+\stop
+
+\section {Other Math changes}
\subsection {Verbose versions of single-character math commands}
@@ -644,27 +856,181 @@ are the result of \type {\mathchardef} or \type {\Umathchardef} are also
acceptable in the horizontal and vertical modes. In those cases, the \type
{\textfont} from the requested math family is used.
-\section{Math todo}
+\section{Math surrounding skips}
+
+Inline math is surrounded by (optional) \type {\mathsurround} spacing but that is fixed
+dimension. There is now an additional parameter \type {\mathsurroundskip}. When set to a
+non|-|zero value (or zero with some stretch or shrink) this parameter will replace
+\type {\mathsurround}. By using an additional parameter instead of changing the nature
+of \type {\mathsurround}, we can remain compatible.
+
+% \section{Math todo}
+%
+% The following items are still todo.
+%
+% \startitemize
+% \startitem
+% Pre-scripts.
+% \stopitem
+% \startitem
+% Multi-story stacks.
+% \stopitem
+% \startitem
+% Flattened accents for high characters (maybe).
+% \stopitem
+% \startitem
+% Better control over the spacing around displays and handling of equation numbers.
+% \stopitem
+% \startitem
+% Support for multi|-|line displays using \MATHML\ style alignment points.
+% \stopitem
+% \stopitemize
+
+\subsection {Delimiters: \type{\Uleft}, \type {\Umiddle} and \type {\Uright}}
+
+Normally you will force delimiters to certain sizes by putting an empty box or
+rule next to it. The resulting delimiter will either be a character from the
+stepwise size range or an extensible. The latter can be quite differently
+positioned that the characters as it depends on the fit aas well as the fact if
+the used characters in the font have depth or height. Commands like (plain \TEX
+s) \type {\big} need use this feature. In \LUATEX\ we provide a bit more control
+by three variants that supporting optional parameters \type {height}, \type
+{depth} and \type {axis}. The following example uses this:
-The following items are still todo.
+\startbuffer
+\Uleft height 30pt depth 10pt \Udelimiter "0 "0 "000028
+\quad x\quad
+\Umiddle height 40pt depth 15pt \Udelimiter "0 "0 "002016
+\quad x\quad
+\Uright height 30pt depth 10pt \Udelimiter "0 "0 "000029
+\quad \quad \quad
+\Uleft height 30pt depth 10pt axis \Udelimiter "0 "0 "000028
+\quad x\quad
+\Umiddle height 40pt depth 15pt axis \Udelimiter "0 "0 "002016
+\quad x\quad
+\Uright height 30pt depth 10pt axis \Udelimiter "0 "0 "000029
+\stopbuffer
-\startitemize
-\startitem
- Pre-scripts.
-\stopitem
-\startitem
- Multi-story stacks.
-\stopitem
-\startitem
- Flattened accents for high characters (maybe).
-\stopitem
-\startitem
- Better control over the spacing around displays and handling of equation numbers.
-\stopitem
-\startitem
- Support for multi|-|line displays using \MATHML\ style alignment points.
-\stopitem
-\stopitemize
+\typebuffer
+
+\startlinecorrection
+\ruledhbox{\mathematics{\getbuffer}}
+\stoplinecorrection
+
+The keyword \type {exact} can be used as directive that the real dimensions
+should be applied when the criteria can't be met which can happen when we're
+still stepping through the succesively larger variants. When no dimensions are
+given the \type {noaxis} command can be used to prevent shifting over the axis.
+
+You can influence the final class with the keyword \type {class} which will
+influence the spacing.
+
+\subsection{Fixed scripts}
+
+We have three parameters that are used for this fixed anchoring:
+
+\starttabulate[|l|l|]
+\NC $d$ \NC \type {\Umathsubshiftdown} \NC \NR
+\NC $u$ \NC \type {\Umathsupshiftup} \NC \NR
+\NC $s$ \NC \type {\Umathsubsupshiftdown} \NC \NR
+\stoptabulate
+
+When we set \type {\mathscriptsmode} to a value other than zero these are used
+for calculating fixed positions. This is something that is needed for instance
+for chemistry. You can manipulate the mentioned variables to achive different
+effects.
+
+\def\SampleMath#1%
+ {$\mathscriptsmode#1\mathupright CH_2 + CH^+_2 + CH^2_2$}
+
+\starttabulate[|c|c|c|l|]
+\NC \bf mode \NC \bf down \NC \bf up \NC \NC \NR
+\NC 0 \NC dynamic \NC dynamic \NC \SampleMath{0} \NC \NR
+\NC 1 \NC $d$ \NC $u$ \NC \SampleMath{1} \NC \NR
+\NC 2 \NC $s$ \NC $u$ \NC \SampleMath{2} \NC \NR
+\NC 3 \NC $s$ \NC $u + s - d$ \NC \SampleMath{3} \NC \NR
+\NC 4 \NC $d + (s-d)/2$ \NC $u + (s-d)/2$ \NC \SampleMath{4} \NC \NR
+\NC 5 \NC $d$ \NC $u + s - d$ \NC \SampleMath{5} \NC \NR
+\stoptabulate
+
+The value of this parameter obeys grouping but applies to the whole current
+formula.
+
+% if needed we can put the value in stylenodes but maybe more should go there
+
+
+\subsection {Math options}
+
+The logic in the math engine is rather complex and there are often no universal
+solutions (read: what works out well for one font, fails for another). Therefore
+some variations in the implementation will be driven by options for which a new
+primitive \type {\mathoption} has been introduced (so that we don't end up with
+many new commands). The approach of options also permits us to see what effect a
+specific solution has.
+
+\subsubsection {\type {\mathoption noitaliccompensation}}
+
+This option compensates placement for characters with a built|-|in italic
+correction.
+
+\startbuffer
+{\showboxes\int}\quad
+{\showboxes\int_{|}^{|}}\quad
+{\showboxes\int\limits_{|}^{|}}
+\stopbuffer
+
+\typebuffer
+
+Gives (with computer modern that has such italics):
+
+\startlinecorrection[blank]
+ \switchtobodyfont[modern]
+ \startcombination[nx=2,ny=2,distance=5em]
+ {\mathoption noitaliccompensation 0\relax \mathematics{\getbuffer}}
+ {\nohyphens\type{0:inline}}
+ {\mathoption noitaliccompensation 0\relax \mathematics{\displaymath\getbuffer}}
+ {\nohyphens\type{0:display}}
+ {\mathoption noitaliccompensation 1\relax \mathematics{\getbuffer}}
+ {\nohyphens\type{1:inline}}
+ {\mathoption noitaliccompensation 1\relax \mathematics{\displaymath\getbuffer}}
+ {\nohyphens\type{1:display}}
+ \stopcombination
+\stoplinecorrection
+
+\subsubsection {\type {\mathoption nocharitalic}}
+
+When two characters follow each other italic correction can interfere. The
+following example shows what this option does:
+
+\startbuffer
+\catcode"1D443=11
+\catcode"1D444=11
+\catcode"1D445=11
+P( PP PQR
+\stopbuffer
+
+\typebuffer
+
+Gives (with computer modern that has such italics):
+
+\startlinecorrection[blank]
+ \switchtobodyfont[modern]
+ \startcombination[nx=2,ny=2,distance=5em]
+ {\mathoption nocharitalic 0\relax \mathematics{\getbuffer}}
+ {\nohyphens\type{0:inline}}
+ {\mathoption nocharitalic 0\relax \mathematics{\displaymath\getbuffer}}
+ {\nohyphens\type{0:display}}
+ {\mathoption nocharitalic 1\relax \mathematics{\getbuffer}}
+ {\nohyphens\type{1:inline}}
+ {\mathoption nocharitalic 1\relax \mathematics{\displaymath\getbuffer}}
+ {\nohyphens\type{1:display}}
+ \stopcombination
+\stoplinecorrection
+
+\subsubsection {\type {\mathoption useoldfractionscaling}}
+
+This option has been introduced as solution for tracker item 604 for fuzzy cases
+around either or not present fraction related settings for new fonts.
\stopchapter
diff --git a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex
index 28431fe29..5b35f3ec1 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex
@@ -217,6 +217,12 @@ which in turn triggered renaming primitives.
\stopitem
\startitem
+ When \type {\adjustspacing} has value~2, hz optimization will be applied to
+ glyphs and kerns. When the valus is~3, only glyphs will be treated. A value
+ smaller than~2 disables this feature.
+\stopitem
+
+\startitem
The \type {\tagcode} primitive is promoted to core primitive.
\stopitem
@@ -230,6 +236,10 @@ which in turn triggered renaming primitives.
\stopitem
\startitem
+ The \type {\pdfcopyfont} primitive is now \type {\copyfont}.
+\stopitem
+
+\startitem
The \type {\pdffontexpand} primitive is now \type {\expandglyphsinfont}.
\stopitem
@@ -255,6 +265,21 @@ which in turn triggered renaming primitives.
determine these properties or use the built|-|in \type {img} library.
\stopitem
+\startitem
+ The initializers \type {\pdfoutput} has been replaced by \type {\outputmode} and
+ \type {\pdfdraftmode} is now \type {\draftmode}.
+\stopitem
+
+\startitem
+ The pixel multiplier dimension \type {\pdfpxdimen} lots its prefix and is now calles
+ \type {\pxdimen}.
+\stopitem
+
+\startitem
+ An extra \type {\pdfimageaddfilename} option has been added that can be used to block
+ writing the filename to the \PDF\ file.
+\stopitem
+
\stopitemize
One change involves the so called xforms and ximages. In \PDFTEX\ these are
@@ -332,7 +357,7 @@ we say next applies to both these programs.
\stopitem
\startitem
- Several bugs hav ebeen fixed. The \type {\hoffset} bug when \type {\pagedir TRT}
+ Several bugs have been fixed. The \type {\hoffset} bug when \type {\pagedir TRT}
is gone, removing the need for an explicit fix to \type {\hoffset}. Also bug
causing \type {\fam} to fail for family numbers above 15 is fixed. A fair amount
of other minor bugs are fixed as well, most of these related to \type
@@ -360,13 +385,14 @@ we say next applies to both these programs.
\stopitem
\startitem
- The page dimension related primitives \type {\pagewidth} and \type {\pageheight} have
- been promoted to core primitives.
+ The page dimension related primitives \type {\pagewidth} and \type
+ {\pageheight} have been promoted to core primitives.
\stopitem
\startitem
- The primitives \type {\charwd}, \type {\charht}, \type {\chardp} and \type {\charit}
- have been removes as we have the \ETEX\ variants \type {\fontchar*}.
+ The primitives \type {\charwd}, \type {\charht}, \type {\chardp} and \type
+ {\charit} have been removes as we have the \ETEX\ variants \type
+ {\fontchar*}.
\stopitem
\startitem
@@ -381,6 +407,15 @@ we say next applies to both these programs.
\stopitem
\startitem
+ The primitive \type {\pdftracingfonts} is now \type {\tracingfonts} as it
+ doesn't relate to the backend.
+\stopitem
+
+\startitem
+ The experimental primitive \type {\pdfinsertht} is kept as \type {\insertht}.
+\stopitem
+
+\startitem
The promotion of primitives to core primitives as well as the removed of all
others mean that the initialization namespace \type {aleph} is gone.
\stopitem
@@ -432,6 +467,220 @@ different:
\stopsubsection
+\startsubsection[title=The backend primitives \type {\pdf*}]
+
+In a previous section we mentioned that some \PDFTEX\ primitives were removed and
+others promoted to core \LUATEX\ primitives. That is only part of the story. In
+order to separate the backend specific primitives in de code these commands are
+now replaced by only a few. In traditional \TEX\ we only had the \DVI\ backend
+but now we have two: \DVI\ and \PDF. Additional functionality is implemented as
+\quote {extensions} in \TEX speak. By seperating more strickly we are able to
+keep the core (fontend) clean and stable. If for some reason an extra backend
+option is needed, it can be implemented without touching the core. The three
+\PDF\ backend related primitives are
+
+\starttyping
+\pdfextension command [specification]
+\pdfvariable name
+\pdffeedback name
+\stoptyping
+
+An extension triggers further parsing, depending on the command given. A variable is
+a (kind of) register and can be read and written, while a feedback is reporting
+something (as it comes from the backend it's normally a sequence of tokens).
+
+In order for \LUATEX\ to be more than just \TEX\ you need to enable primitives. That
+has already be the case right from the start. If you want the traditional \PDFTEX\
+primitives (for as far their functionality is still around) you now can do this:
+
+\starttyping
+\protected\def\pdfliteral {\pdfextension literal}
+\protected\def\pdfcolorstack {\pdfextension colorstack}
+\protected\def\pdfsetmatrix {\pdfextension setmatrix}
+\protected\def\pdfsave {\pdfextension save\relax}
+\protected\def\pdfrestore {\pdfextension restore\relax}
+\protected\def\pdfobj {\pdfextension obj }
+\protected\def\pdfrefobj {\pdfextension refobj }
+\protected\def\pdfannot {\pdfextension annot }
+\protected\def\pdfstartlink {\pdfextension startlink }
+\protected\def\pdfendlink {\pdfextension endlink\relax}
+\protected\def\pdfoutline {\pdfextension outline }
+\protected\def\pdfdest {\pdfextension dest }
+\protected\def\pdfthread {\pdfextension thread }
+\protected\def\pdfstartthread {\pdfextension startthread }
+\protected\def\pdfendthread {\pdfextension endthread\relax}
+\protected\def\pdfinfo {\pdfextension info }
+\protected\def\pdfcatalog {\pdfextension catalog }
+\protected\def\pdfnames {\pdfextension names }
+\protected\def\pdfincludechars {\pdfextension includechars }
+\protected\def\pdffontattr {\pdfextension fontattr }
+\protected\def\pdfmapfile {\pdfextension mapfile }
+\protected\def\pdfmapline {\pdfextension mapline }
+\protected\def\pdftrailer {\pdfextension trailer }
+\protected\def\pdfglyphtounicode{\pdfextension glyphtounicode }
+\stoptyping
+
+The introspective primitives can bve defines as:
+
+\starttyping
+\def\pdftexversion {\numexpr\pdffeedback version}
+\def\pdftexrevision {\pdffeedback revision}
+\def\pdflastlink {\numexpr\pdffeedback lastlink}
+\def\pdfretval {\numexpr\pdffeedback retval}
+\def\pdflastobj {\numexpr\pdffeedback lastobj}
+\def\pdflastannot {\numexpr\pdffeedback lastannot}
+\def\pdfxformname {\numexpr\pdffeedback xformname}
+\def\pdfcreationdate {\pdffeedback creationdate}
+\def\pdffontname {\numexpr\pdffeedback fontname}
+\def\pdffontobjnum {\numexpr\pdffeedback fontobjnum}
+\def\pdffontsize {\dimexpr\pdffeedback fontsize}
+\def\pdfpageref {\numexpr\pdffeedback pageref}
+\def\pdfcolorstackinit {\pdffeedback colorstackinit}
+\stoptyping
+
+The configuration related registers have become:
+
+\starttyping
+\edef\pdfcompresslevel {\pdfvariable compresslevel}
+\edef\pdfobjcompresslevel {\pdfvariable objcompresslevel}
+\edef\pdfdecimaldigits {\pdfvariable decimaldigits}
+\edef\pdfgamma {\pdfvariable gamma}
+\edef\pdfimageresolution {\pdfvariable imageresolution}
+\edef\pdfimageapplygamma {\pdfvariable imageapplygamma}
+\edef\pdfimagegamma {\pdfvariable imagegamma}
+\edef\pdfimagehicolor {\pdfvariable imagehicolor}
+\edef\pdfimageaddfilename {\pdfvariable imageaddfilename}
+\edef\pdfpkresolution {\pdfvariable pkresolution}
+\edef\pdfinclusioncopyfonts {\pdfvariable inclusioncopyfonts}
+\edef\pdfinclusionerrorlevel {\pdfvariable inclusionerrorlevel}
+\edef\pdfreplacefont {\pdfvariable replacefont}
+\edef\pdfgentounicode {\pdfvariable gentounicode}
+\edef\pdfpagebox {\pdfvariable pagebox}
+\edef\pdfminorversion {\pdfvariable minorversion}
+\edef\pdfuniqueresname {\pdfvariable uniqueresname}
+
+\edef\pdfhorigin {\pdfvariable horigin}
+\edef\pdfvorigin {\pdfvariable vorigin}
+\edef\pdflinkmargin {\pdfvariable linkmargin}
+\edef\pdfdestmargin {\pdfvariable destmargin}
+\edef\pdfthreadmargin {\pdfvariable threadmargin}
+
+\edef\pdfpagesattr {\pdfvariable pagesattr}
+\edef\pdfpageattr {\pdfvariable pageattr}
+\edef\pdfpageresources {\pdfvariable pageresources}
+\edef\pdfxformattr {\pdfvariable xformattr}
+\edef\pdfxformresources {\pdfvariable xformresources}
+\edef\pdfpkmode {\pdfvariable pkmode}
+\stoptyping
+
+The variables are internal ones, so they are anonymous. When you ask for the
+meaning of a few previously defined ones:
+
+\starttyping
+\meaning\pdfhorigin
+\meaning\pdfcompresslevel
+\meaning\pdfpageattr
+\stoptyping
+
+you will get:
+
+\starttyping
+macro:->[internal backend dimension]
+macro:->[internal backend integer]
+macro:->[internal backend tokenlist]
+\stoptyping
+
+The \type {\edef} can also be an \type {\def} but it's a bit more efficient
+to expand the lookup related register beforehand. After that you can adapt
+the defaults; these are:
+
+\starttyping
+\pdfcompresslevel 9
+\pdfobjcompresslevel 1
+\pdfdecimaldigits 3
+\pdfgamma 1000
+\pdfimageresolution 71
+\pdfimageapplygamma 0
+\pdfimagegamma 2200
+\pdfimagehicolor 1
+\pdfimageaddfilename 1
+\pdfpkresolution 72
+\pdfinclusioncopyfonts 0
+\pdfinclusionerrorlevel 0
+\pdfreplacefont 0
+\pdfgentounicode 0
+\pdfpagebox 0
+\pdfminorversion 4
+\pdfuniqueresname 0
+
+\pdfhorigin 1in
+\pdfvorigin 1in
+\pdflinkmargin 0pt
+\pdfdestmargin 0pt
+\pdfthreadmargin 0pt
+\stoptyping
+
+If you also want some backward compatibility, you can add:
+
+\starttyping
+\let\pdfpagewidth \pagewidth
+\let\pdfpageheight \pageheight
+
+\let\pdfadjustspacing \adjustspacing
+\let\pdfprotrudechars \protrudechars
+\let\pdfnoligatures \ignoreligaturesinfont
+\let\pdffontexpand \expandglyphsinfont
+\let\pdfcopyfont \copyfont
+
+\let\pdfxform \saveboxresource
+\let\pdflastxform \lastsavedboxresourceindex
+\let\pdfrefxform \useboxresource
+
+\let\pdfximage \saveimageresource
+\let\pdflastximage \lastsavedimageresourceindex
+\let\pdflastximagepages\lastsavedimageresourcepages
+\let\pdfrefximage \useimageresource
+
+\let\pdfsavepos \savepos
+\let\pdflastxpos \lastxpos
+\let\pdflastypos \lastypos
+
+\let\pdfoutput \outputmode
+\let\pdfdraftmode \draftmode
+
+\let\pdfpxdimen \pxdimen
+
+\let\pdfinsertht \insertht
+
+\let\pdfnormaldeviate \normaldeviate
+\let\pdfuniformdeviate \uniformdeviate
+\let\pdfsetrandomseed \setrandomseed
+\let\pdfrandomseed \randomseed
+
+\let\pdfprimitive \primitive
+\let\ifpdfprimitive \ifprimitive
+
+\let\ifpdfabsnum \ifabsnum
+\let\ifpdfabsdim \ifabsdim
+\stoptyping
+
+And even:
+
+\starttyping
+\newdimen\pdfeachlineheight
+\newdimen\pdfeachlinedepth
+\newdimen\pdflastlinedepth
+\newdimen\pdffirstlineheight
+\newdimen\pdfignoreddimen
+\stoptyping
+
+The backend is derived from \PDFTEX\ so the same syntax applies. However, the
+\type {outline} command accepts a \type {objnum} followed by a number. No
+checking takes place so when this is used it had better be a valid (flushed)
+object.
+
+\stopsubsection
+
\stopsection
\startsection[title=Implementation notes]
diff --git a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
index 9626190fc..d59efbf19 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
@@ -25,8 +25,13 @@ The current return value of \type {node.types()} is:
The \type {\lastnodetype} primitive is \ETEX\ compliant. The valid range is still
$[-1,15]$ and glyph nodes (formerly known as char nodes) have number~0 while
ligature nodes are mapped to~7. That way macro packages can use the same symbolic
-names as in traditional \ETEX. Keep in mind that the internal node numbers are
-different and that there are more node types than~15.
+names as in traditional \ETEX. Keep in mind that these \ETEX\ node numbers are
+different from the real internal ones and that there are more \ETEX\ node types
+than~15.
+
+You can ask for a list of fields with the \type {node.fields} (which takes an id)
+and for valid subtypes with \type {node.subtypes} (which takes a string because
+eventually we might support more used enumerations) .
\subsection{Auxiliary items}
@@ -35,36 +40,6 @@ nodes, but can be pointed to from within that list. They are not quite the same
as regular nodes, but it is easier for the library routines to treat them as if
they were.
-\subsubsection{glue_spec items}
-
-Skips are about the only type of data objects in traditional \TEX\ that are not a
-simple value. The structure that represents the glue components of a skip is
-called a \type {glue_spec}, and it has the following accessible fields:
-
-\starttabulate[|lT|l|p|]
-\NC \ssbf key \NC \bf type \NC \bf explanation \NC \NR
-\NC width \NC number \NC \NC \NR
-\NC stretch \NC number \NC \NC \NR
-\NC stretch_order \NC number \NC \NC \NR
-\NC shrink \NC number \NC \NC \NR
-\NC shrink_order \NC number \NC \NC \NR
-\NC writable \NC boolean \NC If this is true, you can't assign to this
- \type {glue_spec} because it is one of the
- preallocated special cases. \NC \NR
-\stoptabulate
-
-These objects are reference counted, so there is actually an extra read-only
-field named \type {ref_count} as well. This item type will likely disappear in
-the future, and the glue fields themselves will become part of the nodes
-referencing glue items.
-
-The effective width of some glue subtypes depends on the stretch or shrink needed
-to make the encapsulating box fit its dimensions. For instance, in a paragraph
-lines normally have glue representing spaces and these stretch of shrink to make
-the content fit in the available space. The \type {effective_glue} function that
-takes a glue node and a parent (hlist or vlist) returns the effective width of
-that glue item.
-
\subsubsection{attribute_list and attribute items}
The newly introduced attribute registers are non|-|trivial, because the value
@@ -102,27 +77,6 @@ As mentioned it's better to use the official helpers rather than edit these
fields directly. For instance the \type {prev} field is used for other purposes
and there is no double linked list.
-\subsubsection{action item}
-
-Valid fields: \showfields{action}\crlf
-Id: \showid{action}
-
-These are a special kind of item that only appears inside \PDF\ start link
-objects.
-
-\starttabulate[|lT|l|p|]
-\NC \ssbf field \NC \bf type \NC \bf explanation \NC \NR
-\NC action_type \NC number \NC \NC \NR
-\NC action_id \NC number or string \NC \NC \NR
-\NC named_id \NC number \NC \NC \NR
-\NC file \NC string \NC \NC \NR
-\NC new_window \NC number \NC \NC \NR
-\NC data \NC string \NC \NC \NR
-\NC ref_count \NC number \NC
- read-only
-\NC \NR
-\stoptabulate
-
\subsection{Main text nodes}
These are the nodes that comprise actual typesetting commands.
@@ -159,7 +113,9 @@ Id: \showid{hlist}
\type {2} = explicit box command,
\type {3} = paragraph indentation box,
\type {4} = alignment column or row,
- \type {5} = alignment cell \NC \NR
+ \type {5} = alignment cell
+ \type {6} = equation
+ \type {7} = equation number \NC \NR
\NC attr \NC \syntax{<node>} \NC The head of the associated attribute
list \NC \NR
\NC width \NC number \NC \NC \NR
@@ -205,7 +161,7 @@ image.
\starttabulate[|lT|l|p|]
\NC \ssbf field \NC \bf type \NC \bf explanation \NC \NR
-\NC subtype \NC number \NC 0, 1 or 2 \NC \NR
+\NC subtype \NC number \NC 0 upto 3 \NC \NR
\NC attr \NC \syntax{<node>} \NC \NC \NR
\NC width \NC number \NC the width of the rule; the special value
$-1073741824$ is used for \quote
@@ -222,7 +178,8 @@ image.
\stoptabulate
The subtypes 1 and~2 replace the xform and ximage whatsits and in nodelists they
-behave like rules of subtype_0 when it comes to dimensions.
+behave like rules of subtype_0 when it comes to dimensions. Subtype~3 only has
+dimensions.
\subsubsection{ins nodes}
@@ -322,6 +279,36 @@ Id: \showid{math}
\subsubsection{glue nodes}
+Skips are about the only type of data objects in traditional \TEX\ that are not a
+simple value. The structure that represents the glue components of a skip is
+called a \type {glue_spec}, and it has the following accessible fields:
+
+\starttabulate[|lT|l|p|]
+\NC \ssbf key \NC \bf type \NC \bf explanation \NC \NR
+\NC width \NC number \NC \NC \NR
+\NC stretch \NC number \NC \NC \NR
+\NC stretch_order \NC number \NC \NC \NR
+\NC shrink \NC number \NC \NC \NR
+\NC shrink_order \NC number \NC \NC \NR
+\NC writable \NC boolean \NC If this is true, you can't assign to this
+ \type {glue_spec} because it is one of the
+ preallocated special cases. \NC \NR
+\stoptabulate
+
+% These objects are reference counted, so there is actually an extra read|-|only
+% field named \type {ref_count} as well. This item type will likely disappear in
+% the future, and the glue fields themselves will become part of the nodes
+% referencing glue items.
+
+The effective width of some glue subtypes depends on the stretch or shrink needed
+to make the encapsulating box fit its dimensions. For instance, in a paragraph
+lines normally have glue representing spaces and these stretch of shrink to make
+the content fit in the available space. The \type {effective_glue} function that
+takes a glue node and a parent (hlist or vlist) returns the effective width of
+that glue item.
+
+A spec node is normally references to from a glue node:
+
Valid fields: \showfields{glue}\crlf
Id: \showid{glue}
@@ -335,6 +322,11 @@ Id: \showid{glue}
\NC leader \NC \syntax{<node>} \NC pointer to a box or rule for leaders \NC \NR
\stoptabulate
+The indirect spec approach is an optimization in the original \TEX\ code. First
+of all it saves quite some memory because all these spaces that become glue now
+share the same specification, and zero testing is also faster because only the
+pointer has to be checked.
+
The exact meanings of the subtypes are as follows:
\starttabulate[|rT|l|]
@@ -362,6 +354,28 @@ The exact meanings of the subtypes are as follows:
\NC 103 \NC \type {\gleaders} \NC \NR
\stoptabulate
+For convenience we provide access to the spec fields directly so that you can
+avoid the spec lookup. So, the following fields can also be queried or set. When
+you set a field and no spec is set, a spec will automatically be created.
+
+\starttabulate[|lT|l|p|]
+\NC \ssbf key \NC \bf type \NC \bf explanation \NC \NR
+\NC width \NC number \NC \NC \NR
+\NC stretch \NC number \NC \NC \NR
+\NC stretch_order \NC number \NC \NC \NR
+\NC shrink \NC number \NC \NC \NR
+\NC shrink_order \NC number \NC \NC \NR
+\stoptabulate
+
+When you assign the properties to a spec using the above keys the advantage is
+that when needed a new spec is allocated. if you access the spec node directly
+you can get an error message with respect to a non|-|writable spec node.
+
+By using the accessors in the glue node you are more future proof as we might
+decide at some point to carry all information in the glue nodes themselves. Of
+course we can then also decide to make the spec field kind of virtual to keep
+compatibility (for a while).
+
\subsubsection{kern nodes}
Valid fields: \showfields{kern}\crlf
@@ -592,7 +606,8 @@ Id: \showid{accent}
\subsubsubsection{style nodes}
-Valid fields: \showfields{style}\crlf Id: \showid{style}
+Valid fields: \showfields{style}\crlf
+Id: \showid{style}
\starttabulate[|lT|l|p|]
\NC \ssbf field \NC \bf type \NC \bf explanation \NC \NR
@@ -605,7 +620,8 @@ a trailing \type {'} to signify \quote {cramped} styles.
\subsubsubsection{choice nodes}
-Valid fields: \showfields{choice}\crlf Id: \showid{choice}
+Valid fields: \showfields{choice}\crlf
+Id: \showid{choice}
\starttabulate[|lT|l|p|]
\NC \ssbf field \NC \bf type \NC \bf explanation \NC \NR
@@ -622,7 +638,8 @@ correct, otherwise an error may be result.
\subsubsubsection{radical nodes}
-Valid fields: \showfields{radical}\crlf Id: \showid{radical}
+Valid fields: \showfields{radical}\crlf
+Id: \showid{radical}
\starttabulate[|lT|l|p|]
\NC \ssbf field \NC \bf type \NC \bf explanation \NC \NR
@@ -673,7 +690,8 @@ sure its internal link structure is correct, otherwise an error may be result.
\subsubsubsection{fence nodes}
-Valid fields: \showfields{fence}\crlf Id: \showid{fence}
+Valid fields: \showfields{fence}\crlf
+Id: \showid{fence}
\starttabulate[|lT|l|p|]
\NC \ssbf field \NC \bf type \NC \bf explanation \NC \NR
@@ -749,6 +767,14 @@ Id: \showid{whatsit,special}
\NC data \NC string \NC the \type {\special} information \NC \NR
\stoptabulate
+\subsubsection{boundary nodes}
+
+Valid fields: \showfields{boundary}\crlf
+Id: \showid{boundary}
+
+This node relates to the \type {\noboundary} primitive but you can use it for
+your own purpose too, in which case \type {\boundary} can come in handy.
+
\subsubsection{language nodes}
\LUATEX\ does not have language whatsits any more. All language information is
@@ -757,8 +783,8 @@ removed in the next release.
\subsubsection{local_par nodes}
-Valid fields: \showfields{whatsit,local_par}\crlf
-Id: \showid{whatsit,local_par}
+Valid fields: \showfields{local_par}\crlf
+Id: \showid{local_par}
\starttabulate[|lT|l|p|]
\NC \ssbf field \NC \bf type \NC \bf explanation \NC \NR
@@ -782,8 +808,8 @@ error may be result.
\subsubsection[dirnodes]{dir nodes}
-Valid fields: \showfields{whatsit,dir}\crlf
-Id: \showid{whatsit,dir}
+Valid fields: \showfields{dir}\crlf
+Id: \showid{dir}
\starttabulate[|lT|l|p|]
\NC \ssbf field \NC \bf type \NC \bf explanation \NC \NR
@@ -912,6 +938,25 @@ Id: \showid{whatsit,pdf_dest}
\NC objnum \NC number \NC the \PDF\ object number \NC \NR
\stoptabulate
+\subsubsection{pdf_action nodes}
+
+Valid fields: \showfields{whatsit,pdf_action}\crlf
+Id: \showid{whatsit,pdf_action}
+
+These are a special kind of item that only appears inside \PDF\ start link
+objects.
+
+\starttabulate[|lT|l|p|]
+\NC \ssbf field \NC \bf type \NC \bf explanation \NC \NR
+\NC action_type \NC number \NC \NC \NR
+\NC action_id \NC number or string \NC \NC \NR
+\NC named_id \NC number \NC \NC \NR
+\NC file \NC string \NC \NC \NR
+\NC new_window \NC number \NC \NC \NR
+\NC data \NC string \NC \NC \NR
+\NC ref_count \NC number \NC read-only \NC \NR
+\stoptabulate
+
\subsubsection{pdf_thread nodes}
Valid fields: \showfields{whatsit,pdf_thread}\crlf
@@ -1239,6 +1284,7 @@ summarized this:
\NC \type {setprev} \NC \yes \NC \yes \NC \NR
\NC \type {slide} \NC \yes \NC \yes \NC \NR
\NC \type {subtype} \NC \yes \NC \nop \NC \NR
+\NC \type {subtypes} \NC \yes \NC \nop \NC \NR
\NC \type {tail} \NC \yes \NC \yes \NC \NR
\NC \type {todirect} \NC \yes \NC \yes \NC \NR
\NC \type {tonode} \NC \yes \NC \yes \NC \NR
@@ -1252,6 +1298,7 @@ summarized this:
\NC \type {usedlist} \NC \yes \NC \yes \NC \NR
\NC \type {vpack} \NC \yes \NC \yes \NC \NR
\NC \type {whatsits} \NC \yes \NC \nop \NC \NR
+\NC \type {whatsitsubtypes} \NC \yes \NC \nop \NC \NR
\NC \type {write} \NC \yes \NC \yes \NC \NR
\stoptabulate
diff --git a/doc/context/sources/general/manuals/luatex/luatex-style.tex b/doc/context/sources/general/manuals/luatex/luatex-style.tex
index 4bb4557b0..90479adf1 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-style.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-style.tex
@@ -74,6 +74,8 @@
\definecolor[maincolor] [b=.5]
\definecolor[othercolor][r=.5,g=.5]
+\setupbodyfont[modern] % we need this in examples so we predefine
+
% \doifmodeelse {atpragma} {
%
% % \setupbodyfont
diff --git a/doc/context/sources/general/manuals/luatex/luatex.tex b/doc/context/sources/general/manuals/luatex/luatex.tex
index 7648140f7..bcb543c54 100644
--- a/doc/context/sources/general/manuals/luatex/luatex.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex.tex
@@ -7,7 +7,7 @@
\dontcomplain
\startdocument
- [beta=0.82.0]
+ [beta=0.85.0]
\component luatex-titlepage