Commit Graph
109 Commits
Author SHA1 Message Date
gloamxun ee22f25ee0 Resolve TeX inputs with the default suffix alternatives 2026-11-19 20:01:08 +08:00
gloamxun 38e4822370 Integrate native repeat boxes and PDF bookmarks 2026-11-19 16:06:28 +08:00
gloamxun 9ce878efd4 Match paragraph tokens in macro delimiters 2026-11-19 15:06:50 +08:00
gloamxun 72ed779749 Promote verified native PDF and box capacity support 2026-11-19 14:39:39 +08:00
gloamxun f4b003bd27 Write native PDF catalogs and open actions 2026-11-19 08:54:04 +08:00
gloamxun a53d9c9bf9 Implement native PDF links and vertical discard lists 2026-11-18 23:39:45 +08:00
gloamxun 2741546ca8 Advance native LaTeX execution and preview 2026-11-18 22:17:21 +08:00
gloamxun 01b3f518cb Add bounded line expansion for Times body text 2026-10-28 23:19:16 +08:00
gloamxun 2f9b18c95c Reserve display skips around math
TeX surrounds each display with \abovedisplayskip above and \belowdisplayskip
below, but route-D only reserved the paragraph's own spacing, so displays sat
directly against the surrounding text. Parse the four registers (including the
short forms), default to the article-class 10/11/12pt values, and add them to
the math unit and the unit that follows it.

The glue parser now also accepts the class-file spelling
(`\abovedisplayskip 7\p@ \@plus 2\p@ \@minus 5\p@`), register copies such as
`\belowdisplayskip \abovedisplayskip`, `\z@`/`\p@` dimensions and
space-separated assignments, which clears the display-skip warnings the arXiv
template produced.

A page oracle sets a 45pt above skip and pins the display moving to the second
page exactly as pdfLaTeX lays it out; unit tests cover the defaults, overrides
and the class-file spelling.
2026-10-26 22:49:41 +08:00
gloamxun 8ac2e828df Honour club and widow penalties on paragraph lines
Route-D expanded a paragraph into one node per line without TeX's
\clubpenalty/\widowpenalty, so a page break could orphan the first line or
widow the last. Insert the penalties between line nodes (150 by default, read
from the source registers) and make the page builder reject any penalty of
10000 or more as a breakpoint. Forced -10000 values now break exactly where
pdfLaTeX does; two page oracle fixtures compare per-page text, and unit tests
cover the node order and the forbidden breakpoint.
2026-10-26 22:14:01 +08:00
gloamxun 83f49db49e Sort oracle word boxes before grouping lines
pdftotext 26 does not always emit words in reading order: wide justified gaps and hyphenated lines interleave words from different baselines, so parse_bbox split one visual line into several. Sort by baseline and then x before grouping. It also reports each word box as the font extent, whose ascent varies with type size; compare display limits by the subscript/superscript baseline gap, which is anchor-free, instead of mixing 7pt box tops with the 10pt base.
2026-10-26 22:03:25 +08:00
gloamxun 8e274a252d Separate table columns by twice tabcolsep 2026-10-26 04:09:57 +08:00
gloamxun d89b71bfbc Measure table cells with Computer Modern metrics 2026-10-26 04:07:29 +08:00
gloamxun 569160f805 Check stacked limits against pdfLaTeX 2026-10-26 00:59:19 +08:00
gloamxun 52a74755f7 Check matrix and cases positions against pdfLaTeX 2026-10-26 00:53:40 +08:00
gloamxun aaa1ed8213 Map Type1 glyphs through their requested Unicode 2026-10-25 01:14:54 +08:00
gloamxun 7e006cea86 Cover Greek text through the Liberation fallback 2026-10-25 00:53:17 +08:00
gloamxun c6860b7b4a Fall back per glyph outside the Type1 encodings 2026-10-25 00:03:19 +08:00
gloamxun 9876895a84 Scale paragraphs by their declared base font size 2026-10-24 13:04:19 +08:00
gloamxun 5f5fc393a4 Embed Computer Modern Type1 outlines in route-D PDFs 2026-10-24 03:28:10 +08:00
gloamxun c3bb8af8a9 Verify narrow-measure pretolerance against pdfLaTeX 2026-10-24 00:07:26 +08:00
gloamxun 4dd28b3aa7 Defer bottom floats like TeX page building 2026-10-23 23:48:28 +08:00
gloamxun fd9790cf28 Cover bottom float page placement with pdfLaTeX 2026-10-23 23:39:24 +08:00
gloamxun 0f4c1f85ae Report paragraph depth to the page builder 2026-10-23 23:31:47 +08:00
gloamxun db1cc98338 Place top floats on the page they appear on 2026-10-23 23:15:56 +08:00
gloamxun a78e0c1d0d Compare footnote insertions with pdfLaTeX page breaks 2026-10-23 15:09:18 +08:00
gloamxun 2d73486dd1 Cover tolerance-10000 line breaking with pdfLaTeX 2026-10-23 14:43:57 +08:00
gloamxun 2b2ccd511c Break pages only at legal glue points 2026-10-23 14:38:35 +08:00
gloamxun 247cbf2b9e Start route-D pages on newpage breaks 2026-10-23 14:32:27 +08:00
gloamxun e00e0038c1 Cover hyphenated breaks and hyphen demerits with pdfLaTeX 2026-10-23 13:52:04 +08:00
gloamxun a6397fcfef Honour TeX looseness when an alternative line count exists 2026-10-23 13:46:32 +08:00
gloamxun d63db8d12d Support explicit hfil and hfill glue orders 2026-10-23 13:15:40 +08:00
gloamxun 3df21201c2 Verify parindent, parshape and skips against pdfLaTeX 2026-10-23 13:10:40 +08:00
gloamxun 97b72ac5d9 Honour textheight geometry and widen the page oracle 2026-10-23 13:07:11 +08:00
gloamxun 448152cea4 Support ragged-right paragraphs with an infinite rightskip 2026-10-23 04:08:32 +08:00
gloamxun 6c3636c7c5 Compare route-D page breaks with pdfLaTeX 2026-10-23 03:40:08 +08:00
gloamxun 6cf8221ba7 Lay out insertion classes through the page builder 2026-10-23 02:53:04 +08:00
gloamxun 6305f059ac Shrink overfull final lines and widen the oracle matrix 2026-10-23 02:45:11 +08:00
gloamxun 4be0ff5787 Replace font glue with explicit spaceskip and xspaceskip 2026-10-23 02:38:12 +08:00
gloamxun 4acccaee86 Honour explicit sfcode assignments 2026-10-23 02:29:40 +08:00
gloamxun b7b75fbff1 Split paragraphs at line boundaries across pages 2026-10-23 02:23:18 +08:00
gloamxun 5db7acaff2 Shift the route-D page body by TeX page origin offsets 2026-10-23 01:55:28 +08:00
gloamxun 49bd9b63e6 Model TeX interline glue and parskip 2026-10-23 01:36:26 +08:00
gloamxun 295c934438 Apply TeX sentence spacing to interword glue 2026-10-23 01:26:04 +08:00
gloamxun bd109d03c5 Honour finite parfillskip on the last line 2026-10-23 01:22:16 +08:00
gloamxun 8993186005 Support hang indentation and parshape measures 2026-10-23 01:18:19 +08:00
gloamxun 24a96d1c7c Model TeX demerit registers and hyphenation exceptions 2026-10-23 01:12:52 +08:00
texrra 3725cca9d7 Model TeX tolerance and hyphen penalty registers 2026-10-23 01:05:28 +08:00
texrra 4fbc43f5ff Match TeX hyphenation and justification semantics 2026-10-23 01:00:45 +08:00
gloamxun ac134b3c4e Reproduce TeX paragraph breaking with tolerance passes and demerits
- replace the single-tolerance DP with pass 0 (pretolerance, no hyphenation),
  pass 1 (tolerance, hyphenation) and an optional emergency pass
- add emergencystretch to ParagraphStyle; the emergency pass only runs when it
  is positive, otherwise TeX's overfull fallback applies and each line fills to
  the first break at or past the measure
- compute badness and fitness classes like TeX and fold them with penalties
  into demerits, ignoring the trailing forced penalty on the final line
- keep forward order in the greedy fallback
- enable the 180pt pdfLaTeX oracle fixture and add an emergencystretch test
- give route-D extraction tests scaled body styles so fixed-cell
  ParagraphStyle defaults no longer mix raw units with TFM advances
- document the passes, oracle results and remaining P1 gaps
2026-10-23 00:50:57 +08:00