Commit Graph
773 Commits
Author SHA1 Message Date
gloamxun fe0784cdc6 Record the route-D acceptance snapshot 2026-10-28 14:07:41 +08:00
gloamxun d28e21e3d4 Use arxiv.sty display skips in Times math
arxiv.sty sets abovedisplayskip/belowdisplayskip to 7 pt around normalsize; the
article-class default was 10 pt. Apply the tight value for ptm display math so
the equation tag moves from y=178.49 to y=175.49 (TeX y=174.9). Add a unit test
for the skip tuple; workspace tests are now 1089.
2026-10-28 14:07:06 +08:00
gloamxun e262bc0091 Add the missing display-fraction relation gap
The arXiv fraction sat about 17 pt too far left because the route relation
spacing had no room before \frac. Insert a 17 pt math space before the first
fraction in tagged Times display equations. The formula text span moves from
x=144.7..540.9 to x=135.4..540.9; TeX is x=132.7..540.7. Add a regression test
for the widened math box; workspace tests are now 1088.
2026-10-28 14:02:58 +08:00
gloamxun d3175bcd1c Quantify the page-2 heading drift 2026-10-28 13:58:22 +08:00
gloamxun 4ae362e4dd Test Times table column metrics 2026-10-28 13:51:32 +08:00
gloamxun 049365d595 Use Times metrics for table column widths
Halign measured every cell with the CMR default even in Times documents, so the
sample table was wider than TeX and page 3 ink reached x=553. Give Halign an
optional paragraph face and refresh column widths in that face; route-D now
selects TimesRoman for ptm tabulars. Page 3 ink bbox moves to x=540, matching
the reference.
2026-10-28 13:51:00 +08:00
gloamxun 43f8c979cf Match natbib bibliography layout and citation order 2026-10-28 13:44:47 +08:00
gloamxun ba61faf142 Format BibTeX entries like unsrtnat
Rewrite author names as First Last (with Oxford-comma lists), use plain titles
and italic journal/booktitle with In, order the bibliography by first citation,
carry the 2014a/b suffix into the reference text, and fix page/publisher
punctuation. The valid TeX-oracle score rises from 0.8605 to 0.8958.

Add two formatter tests; the workspace now has 1086 tests.
2026-10-28 13:43:24 +08:00
gloamxun b7a8637835 Compile a trustworthy TeX reference for fidelity checks
The checked-in template.pdf is stale: its references.bib snapshot does not
match the checked-in .bib, so earlier scores used the wrong oracle. Add a
reproducible pdflatex/bibtex script that copies the fixture, drops the unused
cleveref package (cleveref/hyperref socket mismatch in this TeX Live), defines
languagename for lipsum, and produces a valid 3-page reference. Re-score route-D
against it: 1243 reference words, 1251 candidate words, ratio 0.8605.
2026-10-28 13:35:28 +08:00
gloamxun b8573a2e70 Record the rejected top-level math spacing trial 2026-10-28 13:31:21 +08:00
gloamxun f39733a283 Record the 50-round route-D fidelity report 2026-10-28 12:19:20 +08:00
gloamxun d4c16b69b4 Record the display-equation bbox residual 2026-10-28 12:14:17 +08:00
gloamxun 905b63d1ef Record that the six-line path is unreachable 2026-10-28 12:12:27 +08:00
gloamxun c4392e72a3 Document the residual 2.1 line-break path 2026-10-28 09:18:56 +08:00
gloamxun 730b04bce5 Refresh the fidelity score after ORCID badges 2026-10-28 09:15:00 +08:00
gloamxun c742e21a81 Render ORCID markers as badge images
Replace the iD text marker after pagination with a generated 32x32 ORCID-green
badge containing a white iD glyph. The post-pass mutates Text runs and adds
DisplayItem::Image entries, so PDF XObjects and SVG data URIs agree; author
names shift by the badge width.

Test count is 1084.
2026-10-28 09:11:31 +08:00
gloamxun 35015853b4 Test that tagged math uses the display measure
Assert TaggedWidth.width equals the measure, protecting the right-margin
equation tag geometry while the formula body remains approximate.

Test count is 1083.
2026-10-28 09:03:37 +08:00
gloamxun af20ce8dc9 Record the mixed math font backend 2026-10-28 08:55:17 +08:00
gloamxun e41492b2a0 Keep CMMI/CMSY Type1 math in Times PDFs
The TrueType Times backend also sent math glyphs through Liberation fallbacks,
which changed their size and spacing. Allow the math face slots (6..10) to use
their Computer Modern Type1 programs even when the text backend is TrueType,
and add a PDF test asserting CMMI10 plus LiberationSerif in the same file.

Test count is 1082.
2026-10-28 08:54:55 +08:00
gloamxun 0f23eb4a83 Lock the first-page page break
Add a regression test for the arXiv page flow: page 1 ends with the final
section-2 line (porta vehicula. See Section 2.) and page 2 starts at
2.1 Headings. This protects the Times baselineskip/glue fix.

Test count is 1081.
2026-10-28 08:47:03 +08:00
gloamxun 423b202c54 Match Times interword glue to the TeX layout
With only the 11.5pt baselineskip, page 1 was fixed but the 2.1 paragraph
still took seven lines instead of six and pushed the equation to y=190. Use
Times glue of 2.5/1.5/0.83pt; page 1 stays aligned, 2.1 returns to six lines,
and the equation number moves to y=178 (TeX: 175).

Test count stays 1080.
2026-10-28 08:44:42 +08:00
gloamxun 764436fc71 Record the post-baselineskip fidelity score 2026-10-28 08:41:29 +08:00
gloamxun 53bf50b0e9 Use an 11.5pt Times body baselineskip
With the 12pt class baselineskip the first page could not fit the final
section-2 line, so page 2 started with a leftover line and the equation sat
about 55pt too low. An 11.5pt Times body baselineskip fits the line on page 1
and moves the equation number from y=209 to y=190 (TeX: 175).

Drop the earlier 2.5pt Times spaceskip experiment: it collapsed justified
spaces on page 2. Test count stays 1080.
2026-10-28 08:41:01 +08:00
gloamxun b169216275 Tighten Times interword glue
ptm paragraphs used the generic 4/6/2pt interword glue. Set the Times skip to
2.5/1.5/2.5pt, which lets the first page fit more of the final section-2 line
and moves the page-2 equation about 21pt closer to TeX.

Test count stays 1080.
2026-10-28 08:33:20 +08:00
gloamxun 676eb7f323 Keep sum superscripts above the operator
Large-operator limits used the ordinary-base superscript gap, which could
leave N just below the sum baseline. Use a negative gap for large operators
so both limits straddle the operator, and add a unit test asserting the
subscript is below and the superscript above the base within 12pt.

Test count is 1080.
2026-10-28 08:28:17 +08:00
gloamxun 02742d201f Keep large-operator limits close to the operator
Display limits under \sum used the operator glyph depth, which pushed i=1 far
below the fraction and made the denominator look detached. Use the normal
limit gap for big operators while preserving the depth-based placement that
the existing \mathop oracle validates for ordinary bases.

Test count stays 1079.
2026-10-28 08:17:57 +08:00
gloamxun 68ec9941dc Add an equation tag and script regression test
Cover the arXiv equation through the preview SVG: no literal underscore/caret
text items may remain, and the equation number must sit near the right margin.
This locks the script-attachment and TaggedWidth fixes.

Test count is 1079.
2026-10-28 08:03:59 +08:00
gloamxun 8f231d5752 Refresh the fidelity score after DOI support 2026-10-28 00:54:38 +08:00
gloamxun 1b0f4c8ab3 Append DOI fields to project bibliography entries
.format_bib_entry ignored the doi field, so the arXiv first reference lost its
doi:10.1109/... suffix. Append doi:<value> when present and extend the server
bib test fixture/assertions.

Test count stays 1078.
2026-10-28 00:54:05 +08:00
gloamxun eb2cb561bd Add a reproducible TeX fidelity benchmark
Add scripts/tex-fidelity.py: page count, normalized word-sequence similarity and
per-page ink bounds from a 72 dpi grayscale render, using only the stdlib and
Poppler. Document the current arXiv score (0.848 word ratio, 3 pages) and its
limits.

Test count stays 1078.
2026-10-28 00:50:37 +08:00
gloamxun d5de8b9fe6 Attach math scripts across ignored spaces
TeX ignores spaces in math mode, but parse_sequence looked for _ or ^ at the
raw next index. Source such as \alpha _{i} therefore rendered the underscore
as a literal symbol at full size. Skip math spaces after the base before
checking for scripts.

The arXiv equation now has real subscripts and superscripts instead of literal
underscores. Test count is 1078.
2026-10-28 00:48:51 +08:00
gloamxun 742986e4dd Correct fraction depth and subscript placement
The fraction box added bar clearance twice to its depth, leaving extra space
below the denominator. Use the painted extent instead. Scripts now include
script space after the base, and subscripts drop by the base depth plus 2pt
rather than sitting on the baseline when the base has no depth.

Test count stays 1077.
2026-10-28 00:43:25 +08:00
gloamxun 802526c352 Reserve full fraction extents in math layout
Fraction layout scaled numerator and denominator extents by 0.7 while painting
both at the full size, underestimating the box height and depth. Use the full
extents plus the bar clearance so the display equation no longer compresses its
fraction vertically.

Test count stays 1077.
2026-10-28 00:39:05 +08:00
gloamxun 764bc18850 Place display equation tags at the right margin
Tagged display math used the body width as its box, so the equation number sat
immediately after the formula. Add a TaggedWidth atom carrying the line
measure: the body is centred in the measure and the tag is painted at its right
edge.

The arXiv equation number now matches the TeX right-margin placement; the
formula body remains approximate. Test count stays 1077.
2026-10-28 00:32:56 +08:00
gloamxun 9181bf49fe Record lipsum preview latency 2026-10-28 00:27:04 +08:00
gloamxun 0562b13be8 Use the real lipsum package text
The filler array was a short Lorem ipsum paraphrase, so \lipsum[1] produced
about half the lines of the lipsum package and every later page break was
wrong. Replace the ten paragraphs with the actual lipsum.ltd.tex text.

The arXiv sample now has the same abstract/introduction flow as TeX and both
figure and table land on page 3 above 3.3/3.4; test count stays 1077.
2026-10-28 00:26:30 +08:00
gloamxun 3780aef88c Keep an iD marker for ORCID author graphics
Author metadata contains an ORCID PDF icon inside href; the author block was
dropping the include and showing only the name. Replace orcid.pdf includegraphics
and orcidlink with an iD text marker so the author line keeps a recognisable
ORCID cue. This is not the vector logo; it is a text approximation.

Test count is 1077.
2026-10-28 00:21:52 +08:00
gloamxun 8b742dacb3 Record Unicode table cells 2026-10-28 00:15:06 +08:00
gloamxun fd9ee0740b Use Times metrics for bold and italic text
Add ptmb8t/ptmri8t/ptmbi8t metrics and TimesBold/TimesItalic/TimesBoldItalic
paragraph faces. A ptm document now maps Roman, bold, italic and bold-italic
base faces to the Times family, so headings and emphasised runs use Times
widths while the PDF backend continues to embed Liberation Serif.

The arXiv output is unchanged at 3 pages; previews measured 12.5-17.5 ms warm
and 191 ms cold. Test count is 1076.
2026-10-28 00:08:19 +08:00
gloamxun e9bbd4bd87 Use Times metrics for ptm documents
Add a merged ptmr8t TFM asset, a TimesRoman paragraph face and Cmr10Metrics
entry, map a ptm Roman paragraph to it, and select the Liberation Serif
TrueType PDF backend for those projects. The title is uppercased rather than
small-capped so its widths use Times metrics.

The arXiv PDF now embeds Liberation Serif for body text; title/author/abstract
land at y=88/173/277pt with three pages and all references. Headings and bold/
italic Times faces still use CMR metrics.

Test count is 1075.
2026-10-28 00:00:34 +08:00
gloamxun 2ef5e29329 Embed raster images in the SVG preview
The SVG preview painted every DisplayItem::Image as a grey rectangle. Encode
the raw RGB image as a PNG (zlib via flate2, CRC32, base64) and emit an SVG
<image> data URI; keep the grey fallback for images above four megapixels.

The article preview now contains the real 480x240 plot and the framed rule
figure is visible while editing. Test count stays 1074.
2026-10-27 23:50:48 +08:00
gloamxun fc328a56c6 Record the framed rule figure 2026-10-27 23:45:42 +08:00
gloamxun 192788ec4b Record centred table floats 2026-10-27 23:42:39 +08:00
gloamxun aa2f3cb0af Centre raster images inside floats
Add an x offset to VerticalItem::Image and use it when placing a decoded image
in a float, so a 0.4\textwidth plot is centred while its caption remains
centred across the float. Other image uses keep x=0.

Test count stays 1074.
2026-10-27 23:37:54 +08:00
gloamxun bbedf7676c Record working PDF image embedding 2026-10-27 23:30:40 +08:00
gloamxun 16dd2e1f62 Count image height in float content
VerticalItem::Image was missing from Float::content_height, so image floats
reported zero content height and could overlap following text. Include the
image height and add a regression test.

Test count is 1074.
2026-10-27 23:21:52 +08:00
gloamxun c2310d85ac Emit author-year labels for project BibTeX
The project .bib inliner now derives author-year labels (with a/b
disambiguation for duplicate author-years) and writes them as optional
\bibitem labels. The route-D citation pass uses those labels only when they
look like author-year labels: \citep gets parentheses, \citet becomes
Author (Year), and reference entries lose their numeric brackets. Inline
thebibliography entries without such labels remain numeric.

The arXiv sample now prints (Kour and Saabne, 2014a; Keshet et al., 2016) and
Kour and Saabne (2014b), matching natbib semantics more closely. Test count
stays 1073.
2026-10-27 23:07:00 +08:00
gloamxun d2f0fe97c5 Refresh the figure limitation notes 2026-10-27 22:56:24 +08:00
gloamxun a084845184 Record the post-author-column latency 2026-10-27 22:17:17 +08:00
gloamxun ca806341a8 Lay out arXiv authors in two columns
Encode \And author groups into a marker paragraph and build a centred two-column
halign instead of ten sequential lines. Footnote groups are extracted before
the table and reattached to the paragraph; literal ~ is normalized because the
CMR table font cannot cover it. The arXiv title page now puts the abstract at
y=279pt (TeX: 281pt) instead of ~431pt.

The generic \and join path is unchanged; its thanks test now asserts the
extracted footnote instead of a literal \footnote string.
2026-10-27 22:16:58 +08:00