LuaTeX fügt nicht immer einen mathematischen Knoten am Anfang der mathematischen Formel hinzu, wie in der Dokumentation versprochen
Mathematikknoten markieren Grenzen von mathematischen Ausdrücken in der TeX / LuaTeX-Satzmaschine. LuaTeX-Dokument besagt,
"Mathematikknoten stellen die Grenzen einer mathematischen Formel dar, die normalerweise in $ -Zeichen eingeschlossen ist."
Das Dokument scheint darauf hinzudeuten, dass mathematische Ausdrücke immer von mathematischen Knoten des Subtyps = 0 (Anfangsmath) und des Subtyps = 1 (Endmath) umgeben sind. Im folgenden Code gibt es keinen Knoten, der den Anfang des mathematischen Ausdrucks markiert, obwohl es einen gibt, der sein Ende markiert.
Ausgabe:

Code:
% >>> lualatex mathmode.tex
\documentclass{article}
\usepackage[callback={}]{nodetree}
\begin{document}
\setbox0=\vbox{{\noindent Hello\\ $x=a+b^2$}}
\directlua{
local nodetree = require('nodetree')
nodetree.print(tex.box[0])
}
\box0
\end{document}
Konsole (suchen Sie nach der Zeichenfolge "MATH"):
└─VLIST width: 345pt, depth: 0.83pt, height: 18.94pt
╚═head:
├─HLIST subtype: line, width: 345pt, depth: 0.11pt, height: 6.94pt
│ ╚═head:
│ ├─LOCAL_PAR
│ ├─GLYPH subtype: 256, char: H, width: 7.5pt, height: 6.83pt
│ ├─GLYPH subtype: 256, char: e, width: 4.44pt, height: 4.48pt, depth: 0.11pt
│ ├─GLYPH subtype: 256, char: l, width: 2.78pt, height: 6.94pt
│ ├─GLYPH subtype: 256, char: l, width: 2.78pt, height: 6.94pt
│ ├─GLYPH subtype: 256, char: o, width: 5pt, height: 4.48pt, depth: 0.11pt
│ ├─PENALTY penalty: 10000
│ ├─GLUE stretch: +1fil
│ ├─PENALTY penalty: -10000
│ └─GLUE subtype: rightskip
├─PENALTY subtype: linebreakpenalty, penalty: 300
├─GLUE subtype: baselineskip, width: 3.75pt
└─HLIST subtype: line, width: 345pt, depth: 0.83pt, height: 8.14pt
╚═head:
├─GLYPH subtype: 256, char: x, width: 5.72pt, height: 4.31pt
├─GLUE subtype: thickmuskip, width: 2.78pt, stretch: 2.78pt
├─GLYPH subtype: 256, char: =, width: 7.78pt, height: 3.67pt, depth: -1.33pt
├─PENALTY subtype: noadpenalty, penalty: 500
├─GLUE subtype: thickmuskip, width: 2.78pt, stretch: 2.78pt
├─GLYPH subtype: 256, char: a, width: 5.29pt, height: 4.31pt
├─GLUE subtype: medmuskip, width: 2.22pt, stretch: 1.11pt, shrink: 2.22pt
├─GLYPH subtype: 256, char: +, width: 7.78pt, height: 5.83pt, depth: 0.83pt
├─PENALTY subtype: noadpenalty, penalty: 700
├─GLUE subtype: medmuskip, width: 2.22pt, stretch: 1.11pt, shrink: 2.22pt
├─GLYPH subtype: 256, char: b, width: 4.29pt, height: 6.94pt
├─HLIST subtype: sup, width: 4.49pt, height: 4.51pt, shift: -3.63pt
│ ╚═head:
│ └─GLYPH char: 2, width: 3.99pt, height: 4.51pt
├─MATH subtype: endmath
├─PENALTY subtype: linepenalty, penalty: 10000
├─GLUE subtype: parfillskip, stretch: +1fil
└─GLUE subtype: rightskip
Antworten
LuaTeX nicht immer fügen Sie sie, aber in Ihrem Beispiel sie verworfen, bevor Sie sie sehen können:
In TeX werden einige Knotentypen (Kleber-, Kern-, Straf- und Mathematikknoten) als "verworfen" bezeichnet. Bei jedem Zeilenumbruch entfernt TeX alle verworfenen Knoten, bis der erste nicht verworfene Knoten angezeigt wird. (Es gibt eine Ausnahme, wenn auf einem dieser Knoten ein weiterer Zeilenumbruch ausgeführt wird. Weitere Informationen finden Sie im TeXbook.)
In Ihrem Beispiel ist der erste Knoten in der zweiten Zeile ein mathematischer Knoten, sodass er nach dem Zeilenumbruch verworfen wird.
Ihre Frage ist nicht luatexspezifisch. TeXbook bezieht sich auf wegwerfbare Gegenstände auf Seite 95, und mathematische Gegenstände werden ebenfalls als wegwerfbar erwähnt.
Und Ihr Beispiel sollte ohne luatex nur in TeX gezeigt werden:
\setbox0=\vbox{{\noindent Hello\hfil\break $x=a+b^2$}}
\showbox0
und .log sagt:
\box0=
\vbox(18.88875+0.83333)x455.24408, direction TLT
.\hbox(6.88875+0.0)x455.24408, glue set 432.74408fil, direction TLT
..\localpar
...\localinterlinepenalty=0
...\localbrokenpenalty=0
...\localleftbox=null
...\localrightbox=null
..\_tenrm H
..\_tenrm e
..\_tenrm l
..\_tenrm l
..\_tenrm o
..\glue 0.0 plus 1.0fil
..\penalty -10000
..\glue(\rightskip) 0.0
.\penalty 20000
.\glue(\baselineskip) 3.85997
.\hbox(8.14003+0.83333)x455.24408, glue set 409.90973fil, direction TLT
..\_mF x
..\glue(\thickmuskip) 2.77771 plus 2.77771
..\_mF =
..\penalty 500
..\glue(\thickmuskip) 2.77771 plus 2.77771
..\_mF a
..\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217
..\_mF +
..\penalty 700
..\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217
..\_mF b
..\hbox(4.51111+0.0)x4.48616, shifted -3.62892, direction TLT
...\_mF 2
..\mathoff
..\penalty 10000
..\glue(\parfillskip) 0.0 plus 1.0fil
..\glue(\rightskip) 0.0