Add a math atom box model

This commit is contained in:
gloamxun committed 2026-10-20 12:52:33 +08:00
1 parent 9a7404c717
commit cd6baba53f
3 files changed
+167 -1

No files matched your search

+4 -1
View File
@@ -76,7 +76,7 @@ next paragraph milestones.
| M1 | TeX box/glue/penalty + paragraph builder (`\par`, `\hsize`, `\parindent`) | **partial**: item stream, CMR10 metrics, pdfTeX fixture and minimum line fill; hyphenation next |
| M2 | page builder + `\output`, `\vsize`, `\topskip`, footnotes, floats | **partial**: `\vsize` page goal, `\topskip`, forced penalties, `Insertion` reserve, running `Mark`s, `OutputRoutine` hook, top/bottom `Float` placement; interpreted `\output`, float pages next |
| M3 | `\halign`, `\omit`, `\span`, `\multispan`, booktabs/longtable | **partial**: `Halign` model with natural column widths, spans and rule rows; no `\omit`/`\span` token parsing or PDF painting yet |
| M4 | math lists, scripts, fractions, radicals, accents, delimiters | arXiv formulas render without overlap |
| M4 | math lists, scripts, fractions, radicals, accents, delimiters | **partial**: `MathAtom` symbol/script/fraction boxes with CMR10 widths; no token conversion, radicals, accents or painter |
| M5 | NFSS/TFM metrics, CM/Latin Modern | same line/page breaks as reference |
| M6 | class/package execution (`article`, `sn-jnl`) | Overleaf page-count parity |
| M7 | `\special`, PDF XObjects, hyperref annotations | PDF structure parity |
@@ -104,6 +104,9 @@ overfull ratio 4.11, badness 6942. TeX rejects the underfull candidate under
its tolerance but still emits the moderately overfull 5-word line. Reproducing
this needs a two-pass tolerance algorithm with an emergency overfull pass, not
a single cost function.
- `MathAtom::{Symbol, Script, Fraction}` and `layout_math` produce
`MathBox { width, height, depth }`; `Unit::math` turns an atom into a
vertical box. Parsing TeX math tokens and painting remain future M4 work.
- M1 now inserts TeX en-US hyphenation points as `HorizontalItem::
Discretionary`: a break adds the hyphen width, a non-break keeps zero
width. The line breaker scores these breakpoints with the same glue