Skip to content

render-pipeline: itemize bullet, asterisk and centred period take tcrm's widths without lmodern (stacked on #625) - #628

Closed
d-q222 wants to merge 3 commits into
mainfrom
agent/daniel-parent/ot1-bullet-width
Closed

d-q222 wants to merge 3 commits into
mainfrom
agent/daniel-parent/ot1-bullet-width

Conversation

@d-q222

@d-q222 d-q222 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Stacked on #625 (which is stacked on #611). Task GH-OT1-BULLET-WIDTH.

What

Which glyph pdflatex uses (TeX Live 2026; widths from \wd of \labelitem<i> and tftopl; fonts from the PDFs):

label OT1 (no fontenc) T1 (no lmodern) T1 + lmodern
\textbullet (level 1) TS1 tcrm1000: 4.99878pt (SFRM1000) same tcrm TS1 ts1-lmr10: 7.778pt
\bfseries\textendash (level 2) cmbx10 5.74997pt ecbx1000 5.7486pt ec-lmbx10 5.75pt
\textasteriskcentered (level 3) tcrm 4.99878pt tcrm ts1-lmr 5.0pt
\textperiodcentered (level 4) tcrm 2.7771pt tcrm ts1-lmr 7.778pt
  • The kernel declares these three symbols TS1 (latex.ltx 14414-14419), not OMS. Without lmodern, TS1 cmr is tcrm in both OT1 and T1 documents. Its bullet, asterisk and centred period are the cmsy designs: 0.5em, 0.5em and 0.2777em at 10pt (0.497164/0.276356 at 10.95pt, 0.489464/0.271924 at 12pt).
  • Label box width: under Scheme::CmOt1/CmT1 (not Times), a symbol label now takes tcrm's advance. The widths come from fonts::tcrm_symbol_width, which holds the CHARWDs transcribed at all 14 EC sizes, because the bundled texmf has no tcrm.
  • Glyph: Latin Modern Math's U+2022 and U+00B7 are exactly cmsy's bullet and cdot (ink 0.055–0.445em and 0.086–0.192em). Those glyphs are drawn, centred in the tcrm advance. On a rendered PDF at 10pt, the ink extents match pdflatex's SFRM1000 within 0.03bp (bullet 149.264–153.164 vs 149.264–153.139). LM Roman's bullet is a smaller dot, 0.288em against 0.389em. The asterisk keeps LM Roman's asterisk.math, which already matches tcrm's ink.
  • leftmargin=* on itemize: widest_label now names \labelitemi..\labelitemiv instead of spelling the symbols. The typesetter measures each one as the class sets it: tcrm widths, and \labelitemii's en dash in bold. The dash was measured regular before, so nested leftmargin=* item text sat 0.75bp left even with lmodern.
  • Class \leftmargin<i> under T1 cmr: these now use OT1 cmr's em (the class sets them while loading, before fontenc), not ecrm1095's smaller quad. This removes a 0.15–0.5bp item-text shift at 11pt.
  • ListGeom is unchanged. No style=/nextline code is touched.
  • New oracle tests/itemize_ts1_symbols.rs with fixtures tests/fixtures/itemize-ts1-symbols/{ot1,t1,lm}-{10,11,12}.tex:
    • page 1 is itemize levels 1–4;
    • page 2 is the same with [leftmargin=*];
    • it gates label x and item-text x at 0.1bp against pdflatex (72 checks).
  • enumitem_item_text now also gates the K..j bullet x, which render-pipeline: enumitem labelsep, itemindent, widest and register leftmargin follow \enit@calcleft (stacked on #611) #625 left ungated for this reason.

Before → after (bp, FlashTeX vs pdflatex; PyMuPDF get_texttrace() origins):

row pdflatex before after
ot1-10 level-1 bullet x 148.714 145.943 148.714
ot1-10 level-4 · x 208.411 203.427 208.412
ot1-10 leftmargin=* L1 text x 143.731 146.501 143.730
ot1-10 leftmargin=* L4 text x 172.152 179.158 172.149
ot1-12 level-1 bullet x 128.415 125.156 128.355¹
ot1-12 leftmargin=* L4 text x 155.951 164.185 ok (<0.1)
t1-11 level-1 text x 153.069 152.916 153.071
t1-11 level-4 · x 207.547 201.563 207.536
t1-11 leftmargin=* L4 text x 167.706 175.469 167.710
lm-10 leftmargin=* L2 text x 157.209 156.463 ok (<0.1)
lm-12 leftmargin=* L4 text x 165.062 164.185 165.057
enumitem-item-text K10j bullet x 87.499 not gated ok (<0.1)

¹ At 12pt, LM Math's 6.0pt-wide bullet is centred in tcrm1200's 5.874pt advance, so the origin is 0.06bp left. The ink is 129.005–133.680 against pdflatex's 129.065–133.640, which puts the centres 0.01bp apart.

Before the src change, the new oracle reported 78 mismatches (label and text checks over the 9 fixtures). After it, it reports none.

Why

#625's Not done: without lmodern, the itemize bullet sat about 3bp left, and leftmargin=* item text sat the same amount right. Measuring the full matrix showed three more errors:

  • the level-4 centred period was 5pt too wide;
  • the bold level-2 dash was measured regular for leftmargin=*, in all setups;
  • T1 documents at 11pt took the class list margins in the wrong em.

Overlap check

Test results

Run with CARGO_BUILD_JOBS=4 CARGO_TARGET_DIR=target-bullet, in crates/render-pipeline.

cargo test --release --no-fail-fast (full render-pipeline release suite) exited 0: 82 test binaries, 378 passed, 0 failed, 3 ignored. The list oracles, re-run on f4294de:

itemize_ts1_symbols: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s
enumitem_item_text: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
enumitem_keys_oracle: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
itemize_label_offset: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
list_items: test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
description_env: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
description_display: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
lib: test result: ok. 137 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.02s

Not done

  • Times documents (times/mathptmx): their TS1 symbols and the class \leftmargin em are unmeasured and left as they were.
  • \textbullet in running text (not a list label) is unchanged. Only list labels and leftmargin=* widths use tcrm.
  • tcrm1200's bullet and period are slightly smaller designs than LM Math's 10pt-design glyphs (period ink 1.15 vs 1.28bp wide at 12pt). Only centring is matched there.

🤖 Generated with Claude Code

https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

What changed:
- Preserve list-symbol weight and glyph identity from the compiler.
- Use Latin Modern font dimensions for list margins and honor left-extending label boxes.
- Add pdflatex-pinned itemize, enumerate, and description origin probes.

What was run:
- CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-itemlabel CARGO_BUILD_JOBS=4 cargo build --bin flashtex-render
- Focused render-pipeline list oracle tests
- CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-itemlabel CARGO_BUILD_JOBS=4 cargo test --lib

Next step:
- Parent lane can review and integrate this commit.

Implementation-Agent: codex gpt-5.6-luna (max)
Commit-Executor: codex (this session)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
…eftmargin follow \enit@calcleft

What changed:
- Read enumitem `labelsep=`, `itemindent=` and `widest=` per list level
  (itemize/enumerate). With `leftmargin=*` the margin is
  `\labelwidth + \labelsep - \itemindent` (new `ListMargin::WidestSep`);
  otherwise `labelsep` moves only the label and `itemindent` the first
  line and its label. `\labelsep` is inherited by nested lists.
- `leftmargin=\len` resolves a preamble `\setlength` or `\settowidth`
  register (new `ListMargin::TextWidth`).
- `ListGeom` gains `labelsep_pt` and `itemindent_pt` at the end.
- New pdflatex-pinned oracle `tests/enumitem_item_text.rs` (10/11/12pt).
- The enumitem-worksheet +1.17bp item-text shift from the #609 sweep is
  already gone on #611's head (it was `\leftmargin<i>` in a 12pt em rather
  than lmr12's 11.74994pt quad); rows a-c pin it.

What was run:
- cargo test --release --test enumitem_item_text: test result: ok. 1 passed; 0 failed
- Without the src change the same test fails on 37 rows (e.g. K12e text: 101.265 vs pdflatex 112.981).

Next step:
- Full render-pipeline release suite, then PR stacked on #611.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
What changed:
- Without lmodern (OT1 or T1 body text), \textbullet, \textasteriskcentered
  and \textperiodcentered are TS1 tcrm, whose widths are the cmsy designs
  (0.499878/0.499878/0.27771 at 10pt), not ts1-lmr's 0.7778em bullet and
  period. Label boxes now take the tcrm advance (transcribed tcrm CHARWD at
  all 14 EC sizes, fonts::tcrm_symbol_width). The bullet and centred period
  are drawn with Latin Modern Math's U+2022/U+00B7, which are cmsy's glyphs
  (ink matches pdflatex's SFRM1000 to 0.03bp); the asterisk keeps LM Roman.
- leftmargin=* on itemize measures the class labels as \labelitemi..iv set
  them: the tcrm widths, and \labelitemii's en dash in bold (was regular,
  0.75pt short even with lmodern).
- Class \leftmargin<i> under T1 cmr use OT1 cmr's em (the class sets them
  before fontenc), fixing a 0.15bp shift at 11pt.
- New oracle tests/itemize_ts1_symbols.rs (OT1/T1/lmodern x 10/11/12pt,
  levels 1-4, default and leftmargin=*); enumitem_item_text now gates the
  K..j bullet x.

What was run:
- cargo test --release --no-fail-fast (render-pipeline): 82 binaries, 378 passed, 0 failed, 3 ignored
- itemize_ts1_symbols: test result: ok. 1 passed; 0 failed (78 mismatches before the src change)
- enumitem_item_text, enumitem_keys_oracle, itemize_label_offset, list_items, description_env, description_display: all ok

Next step: Times documents' TS1 symbols and class em are unmeasured.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
GoKubar added a commit that referenced this pull request Sep 15, 2026
… (#649)

* render-pipeline: long arrows are pdfTeX joins; heading spaces after \normalfont are medium

What changed:
- The six long arrows (and so \implies, \iff, \impliedby) are built as
  LaTeX builds them: one relation holding the two cmr/cmsy pieces with
  \joinrel's -3mu between them. They were Latin Modern Math's single
  U+27F5..U+27FA glyphs, 1.457em wide against pdfTeX's 1.611em. On HW1
  Problem 4(b) that shifted the centred display by +0.84/-0.84bp.
- In a directly written heading title, a space with \normalfont words on
  both sides uses the medium font's \fontdimen2 (3.91571pt at \large),
  not the head's bold 4.4989pt. On HW1 "Bonus Problem [1 bonus point]",
  "[1" was 1.15bp left of pdfTeX's position.
- New tests/long_arrows.rs pins pdfTeX's x-to-y distance for all nine
  commands. heading_macros.rs pins the Bonus heading's positions and
  checks the bold/medium spaces around {\normalfont B}. math_symbols.rs
  now expects the composed pieces instead of the fallback glyph.

What was run:
- cargo test --test long_arrows: test result: ok. 1 passed; 0 failed
- cargo test --test heading_macros: test result: ok. 5 passed; 0 failed
- cargo test --test math_symbols: test result: ok. 12 passed; 0 failed
- HW1 glyph diff against pdflatex (TeX Live 2026): lines over 0.5bp went
  from 6 to 2. The 2 left are math-mode TFM kerns (r+comma). 3 pages and
  4 diagnostics, both unchanged.

Next step: math-mode Ord kerns (tex.web §752) in crates/math-layout, then a
vendor re-pin by the integration lane.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

* compiler: implement \obeylines as group-scoped forced line breaks (#588)

Each source newline lowers to the existing \\-primitive (Inline::LineBreak), scoped like the centering/ragged declarations; blank lines still end the paragraph and surrounding spaces are not preserved. Adds crates/compiler/tests/obeylines.rs and regenerates the supported-LaTeX inventory. Nothing under crates/render-pipeline/ touched.

Implementation-Agent: muse-spark-1.3-contributor

* render-pipeline: build \longmapsto from pieces like the other long arrows (GH-LONGMAPSTO-PIECES)

U+27FC explodes in symbol_atoms to the flag (U+2223, this compiler's \mid
glyph) backed up by its own advance (cmsy10 slot "6A is 5.00002mu, so -5mu
nets ~1e-5pt) plus the usual relbar + joinrel + rightarrow join, matching
pdfTeX's \mapstochar\longrightarrow: the x-to-y span is 29.9832pt,
bit-for-bit the \longrightarrow width. long_arrow_pieces/long_arrow now
take (glyph, kern-before-mu) lists so the 3-piece arrow shares the 2-piece
path. The new long_arrows.rs case spells U+27FC literally until
vendor/compiler is re-pinned past PR #603's ("longmapsto", U+27FC) row.

Implementation-Agent: muse-spark-1.3-contributor

* render-pipeline: align list labels with pdflatex

What changed:
- Preserve list-symbol weight and glyph identity from the compiler.
- Use Latin Modern font dimensions for list margins and honor left-extending label boxes.
- Add pdflatex-pinned itemize, enumerate, and description origin probes.

What was run:
- CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-itemlabel CARGO_BUILD_JOBS=4 cargo build --bin flashtex-render
- Focused render-pipeline list oracle tests
- CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-itemlabel CARGO_BUILD_JOBS=4 cargo test --lib

Next step:
- Parent lane can review and integrate this commit.

Implementation-Agent: codex gpt-5.6-luna (max)
Commit-Executor: codex (this session)
Lane-Owner: daniel-parent (mac-m5pro-dq222)

* pdf: add marked ActualText groups

What changed:
- Added typed exact-route marked-content operators with UTF-16BE ActualText encoding.
- Added optional v2 glyph_run actual_text grouping across font and BT/ET switches.
- Documented the field and added syntax, byte-identity, and PyMuPDF tests.

What was run:
- CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-actualtext CARGO_BUILD_JOBS=4 cargo test --manifest-path crates/pdf/Cargo.toml --lib --tests
- git diff --cached --check

Next step:
- render-pipeline can populate actual_text after the vendor/pdf re-pin.

Implementation-Agent: codex gpt-5.6-luna (max)
Commit-Executor: codex (this session)
Lane-Owner: daniel-parent (mac-m5pro-dq222)

* render-pipeline: enumitem labelsep, itemindent, widest and register leftmargin follow \enit@calcleft

What changed:
- Read enumitem `labelsep=`, `itemindent=` and `widest=` per list level
  (itemize/enumerate). With `leftmargin=*` the margin is
  `\labelwidth + \labelsep - \itemindent` (new `ListMargin::WidestSep`);
  otherwise `labelsep` moves only the label and `itemindent` the first
  line and its label. `\labelsep` is inherited by nested lists.
- `leftmargin=\len` resolves a preamble `\setlength` or `\settowidth`
  register (new `ListMargin::TextWidth`).
- `ListGeom` gains `labelsep_pt` and `itemindent_pt` at the end.
- New pdflatex-pinned oracle `tests/enumitem_item_text.rs` (10/11/12pt).
- The enumitem-worksheet +1.17bp item-text shift from the #609 sweep is
  already gone on #611's head (it was `\leftmargin<i>` in a 12pt em rather
  than lmr12's 11.74994pt quad); rows a-c pin it.

What was run:
- cargo test --release --test enumitem_item_text: test result: ok. 1 passed; 0 failed
- Without the src change the same test fails on 37 rows (e.g. K12e text: 101.265 vs pdflatex 112.981).

Next step:
- Full render-pipeline release suite, then PR stacked on #611.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

* render-pipeline: itemize TS1 symbols take tcrm's widths without lmodern

What changed:
- Without lmodern (OT1 or T1 body text), \textbullet, \textasteriskcentered
  and \textperiodcentered are TS1 tcrm, whose widths are the cmsy designs
  (0.499878/0.499878/0.27771 at 10pt), not ts1-lmr's 0.7778em bullet and
  period. Label boxes now take the tcrm advance (transcribed tcrm CHARWD at
  all 14 EC sizes, fonts::tcrm_symbol_width). The bullet and centred period
  are drawn with Latin Modern Math's U+2022/U+00B7, which are cmsy's glyphs
  (ink matches pdflatex's SFRM1000 to 0.03bp); the asterisk keeps LM Roman.
- leftmargin=* on itemize measures the class labels as \labelitemi..iv set
  them: the tcrm widths, and \labelitemii's en dash in bold (was regular,
  0.75pt short even with lmodern).
- Class \leftmargin<i> under T1 cmr use OT1 cmr's em (the class sets them
  before fontenc), fixing a 0.15bp shift at 11pt.
- New oracle tests/itemize_ts1_symbols.rs (OT1/T1/lmodern x 10/11/12pt,
  levels 1-4, default and leftmargin=*); enumitem_item_text now gates the
  K..j bullet x.

What was run:
- cargo test --release --no-fail-fast (render-pipeline): 82 binaries, 378 passed, 0 failed, 3 ignored
- itemize_ts1_symbols: test result: ok. 1 passed; 0 failed (78 mismatches before the src change)
- enumitem_item_text, enumitem_keys_oracle, itemize_label_offset, list_items, description_env, description_display: all ok

Next step: Times documents' TS1 symbols and class em are unmeasured.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

* integration fix: math_symbols reads Page::items through #294's accessor

#294 replaced Page's items field with PageContent plus an items()
accessor; tests/math_symbols.rs still took the field, so the test
target failed to compile (E0615) and its 18 tests silently did not run.
Broken on main itself as well -- fixed there in #664.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

---------

Co-authored-by: d-q222 <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
@GoKubar

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Closing: landed on main via integration PR #649 (commit 79c83aa7).

Verified by feature content, not ancestry (origin/agent/daniel-parent/ot1-bullet-width is not an ancestor of main after the squash): this PR's test ts1_itemize_symbols_match_pdflatex is on main in crates/render-pipeline/tests/itemize_ts1_symbols.rs, with the #611/#625 tests it stacks on also present.

@GoKubar GoKubar closed this Sep 15, 2026
GoKubar added a commit that referenced this pull request Sep 15, 2026
…ests only) (#668)

The output-identity gate is a hard fail, and main itself has been failing
it: the committed digests predate #295/#296 (negated relations) and #649
(list label and item-text geometry, /ActualText groups), so every PR
touching layout tripped a gate that main could not pass either.

Re-recorded on the reference host at main 35ead1c over the full 26-case
corpus. 14 cases move, 116 digest values in all; 12 are byte-identical,
including both synthetic documents and math-heavy/tikz-heavy.

ONLY the per-case `digests` maps change. `meta`, `targets`, every
per-case `metrics` map and `load1_max` are byte-identical to #206's
capture, verified field by field -- no timing number here is claimed to
have been measured on this host, and none has been replaced.

Attribution, by re-recording at 44b21ad (main immediately before #649)
and diffing both ways:

  pre-#649 (#295 \ne paint position, #296 \not as a zero-width
  \mathrel): hw2, inline-math, math-sheet, ps-calculus, twelvept-plain
  -- every corpus document containing \ne, \neq or \not, which is two
  more than a \ne-only grep finds.

  #649 (#611/#625/#628 list label and item-text offsets; #614
  /ActualText): cv, enumitem-worksheet, hyperref-toc, lab-report,
  lecture-notes, listings-manual, lmodern-report, plain-article,
  ps-calculus, thesis-chapter, twelvept-plain.

The changed set is exactly the documents using itemize/description or a
negated relation. hw1 is unchanged and uses only enumerate, which the
list work did not move; lecture-notes changed only its export.pdf and v2
keys, from #614 grouping the \gcd/\lcm multi-glyph runs.

Digests are independent of --runs: a control at --runs 5 (CI's setting)
over hw1, math-sheet and plain-article reproduces the --runs 1 digests
exactly.

Gate after the re-record, at main, full corpus: 601 metrics compared, no
digest change, exit 0.


Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

Co-authored-by: Claude Opus 5 <[email protected]>
@GoKubar
GoKubar deleted the agent/daniel-parent/ot1-bullet-width branch September 16, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants