summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/luametatex/luametatex-preamble.tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2020-08-24 20:03:53 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2020-08-24 20:03:53 +0200
commit89f7bbac9616406b3990b8608c17c542f5fb476d (patch)
tree9e487938454fd224025391d975ae85dff85a10f8 /doc/context/sources/general/manuals/luametatex/luametatex-preamble.tex
parent4ba731dd6ff370a42984b4df050906fd9a884bc8 (diff)
downloadcontext-89f7bbac9616406b3990b8608c17c542f5fb476d.tar.gz
2020-08-24 19:49:00
Diffstat (limited to 'doc/context/sources/general/manuals/luametatex/luametatex-preamble.tex')
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex-preamble.tex48
1 files changed, 26 insertions, 22 deletions
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-preamble.tex b/doc/context/sources/general/manuals/luametatex/luametatex-preamble.tex
index 8f1400c9f..9a2fe5690 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex-preamble.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex-preamble.tex
@@ -47,19 +47,21 @@ If you still decide to read on, then it's good to know what nodes are, so we do
quick introduction here. If you input this text:
\starttyping
-Hi There
+Hi There ...
\stoptyping
eventually we will get a linked lists of nodes, which in \ASCII\ art looks like:
\starttyping
-H <=> i <=> [glue] <=> T <=> h <=> e <=> r <=> e
+H <=> i <=> [glue] <=> T <=> h <=> e <=> r <=> e ...
\stoptyping
-When we have a paragraph, we actually get something:
+When we have a paragraph, we actually get something like this, where a \type
+{localpar} node stores some metadata and is followed by a \type {hlist} flagged
+as indent box:
\starttyping
-[localpar] <=> H <=> i <=> [glue] <=> T <=> h <=> e <=> r <=> e <=> [glue]
+[localpar] <=> [hlist] <=> H <=> i <=> [glue] <=> T <=> h <=> e <=> r <=> e ...
\stoptyping
Each character becomes a so called glyph node, a record with properties like the
@@ -69,14 +71,14 @@ back to a previous node or next node, given that these exist. Sometimes
multiple characters are represented by one glyphs, so one can also get:
\starttyping
-[localpar] <=> H <=> i <=> [glue] <=> Th <=> e <=> r <=> e <=> [glue]
+[localpar] <=> [hlist] <=> H <=> i <=> [glue] <=> Th <=> e <=> r <=> e ...
\stoptyping
And maybe some characters get positioned relative to each other, so we might
see:
\starttyping
-[localpar] <=> H <=> [kern] <=> i <=> [glue] <=> Th <=> e <=> r <=> e <=> [glue]
+[localpar] <=> [hlist] <=> H <=> [kern] <=> i <=> [glue] <=> Th <=> e <=> r <=> e ...
\stoptyping
It's also good to know beforehand that \TEX\ is basically centered around
@@ -96,6 +98,8 @@ means these hooks. The \TEX\ engine itself is pretty well optimized but when you
kick in much \LUA\ code, you will notices that performance drops. Don't blame and
bother the authors with performance issues. In \CONTEXT\ over 50\% of the time
can be spent in \LUA, but so far we didn't get many complaints about efficiency.
+Adding more callbacks makes no sense, also because at some point the performance
+hit gets too large. There are plenty ways to achieve one goals.
Where plain \TEX\ is basically a basic framework for writing a specific style,
macro packages like \CONTEXT\ and \LATEX\ provide the user a whole lot of
@@ -108,7 +112,7 @@ mess around to much, the engine eventually might bark and quit. It can even
crash, because testing everywhere for what users can do wrong is no real option.
When you read about nodes in the following chapters it's good to keep in mind
-their commands that relate to then. Here are a few:
+what commands relate to them. Here are a few:
\starttabulate[|l|l|p|]
\DB command \BC node \BC explanation \NC \NR
@@ -137,23 +141,23 @@ all terms used in the next chapters. Don't worry, they loose their magic once yo
use \TEX\ a lot. You have access to most of the internals and when not, at least
it is possible to query some state we're in or level we're at.
-When we talk about packing it can mean two things. When \TEX\ has consumed some
-tokens that represent text the next can happen. When the text is put into a so
-called \type {\hbox} it (normally) first gets hyphenated, next ligatures are
-build, and finally kerns are added. Each of that stages can be overloaded using
-\LUA\ code. When these three stages are finished, the dimension of the content is
-calculated and the box gets its width, height and depth. What happens with the
-box depends on what macros do with it.
+When we talk about pack(ag)ing it can mean two things. When \TEX\ has consumed
+some tokens that represent text. When the text is put into a so called \type
+{\hbox} it (normally) first gets hyphenated (even in an horizontal list), next
+ligatures are build, and finally kerns are added. Each of these stages can be
+overloaded using \LUA\ code. When these three stages are finished, the dimension
+of the content is calculated and the box gets its width, height and depth. What
+happens with the box depends on what macros do with it.
The other thing that can happen is that the text starts a new paragraph. In that
-case some (directional) information is put in front, indentation is prepended and
-some skip appended at the end. Again the three stages are applied but this time,
-afterwards, the long line is broken into lines and the result is either added to
-the content of a box or to the main vertical list (the running text so to say).
-This is called par building. At some point \TEX\ decides that enough is enough
-and it will trigger the page builder. So, building is another concept we will
-encounter. Another example of a builder is the one that turns an intermediate
-math list into something typeset.
+case some information is stored in a leading \type {localpar} node. Then
+indentation is appended and the paragraph ends with some glue. Again the three
+stages are applied but this time, afterwards, the long line is broken into lines
+and the result is either added to the content of a box or to the main vertical
+list (the running text so to say). This is called par building. At some point
+\TEX\ decides that enough is enough and it will trigger the page builder. So,
+building is another concept we will encounter. Another example of a builder is
+the one that turns an intermediate math list into something typeset.
Wrapping something in a box is called packing. Adding something to a list is
described in terms of contributing. The more complicated processes are wrapped