LuaTeX는 문서에서 약속 한대로 수학 공식의 시작 부분에 항상 수학 노드를 추가하지는 않습니다.
수학 노드는 TeX / LuaTeX 조판 엔진에서 수학 표현식의 경계를 표시합니다. LuaTeX 문서 상태,
"수학 노드는 일반적으로 $ 기호로 래핑 된 수학 공식의 경계를 나타냅니다."
이 문서는 수학 표현식이 항상 subtype = 0 (beginmath) 및 subtype = 1 (endmath)의 수학 노드로 둘러싸여 있다고 제안하는 것 같습니다. 다음 코드에서는 수학 표현식의 시작을 표시하는 노드가 없지만 끝을 표시하는 노드가 있습니다.
산출:

암호:
% >>> 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}
콘솔 ( "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
답변
LuaTeX 는 항상 그것들을 추가하지만, 귀하의 예에서는 그것들을 볼 수 있기 전에 버려집니다.
TeX에서 일부 노드 유형 (glue, kern, 벌점 및 수학 노드)은 "discardable"로 알려져 있습니다. 줄 바꿈이 발생할 때마다 TeX는 폐기 불가능한 첫 번째 노드가 표시 될 때까지 폐기 가능한 모든 노드를 제거합니다. (이러한 노드 중 하나에서 다른 줄 바꿈이 수행되는 경우 예외가 있습니다. 자세한 내용은 TeXbook을 참조하십시오.)
귀하의 예에서 두 번째 줄의 첫 번째 노드는 수학 노드이므로 줄 바꿈 후 삭제됩니다.
귀하의 질문은 luatex와 관련이 없습니다. TeXbook은 95 페이지에서 폐기 가능한 항목에 대해 언급하고 수학 항목도 폐기 가능 항목으로 언급합니다.
그리고 귀하의 예는 luatex없이 TeX에서만 표시되어야합니다.
\setbox0=\vbox{{\noindent Hello\hfil\break $x=a+b^2$}}
\showbox0
.log 내용 :
\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