Commit Graph
167 Commits
Author SHA1 Message Date
gloamxun 003d5d8726 Resolve FitR destinations using shipped box geometry 2026-11-21 05:18:07 +08:00
gloamxun 22154b53a6 Resolve native PDF structure destinations and local actions 2026-11-21 05:04:54 +08:00
gloamxun e113033b8a Expand native PDF checksums over resolved input bytes 2026-11-21 04:41:46 +08:00
gloamxun 413939911f Save the TeX cursor in native shipout order 2026-11-21 04:27:06 +08:00
gloamxun 555a029505 Import PNG images in the native PDF device 2026-11-21 04:13:18 +08:00
gloamxun 7f74251c8a Track PDF literal transforms in native source maps 2026-11-21 02:23:12 +08:00
gloamxun 361e8d070f Reuse decoded Type 1 fonts across native revisions 2026-11-20 16:55:48 +08:00
gloamxun b5e87a8706 Stop obsolete draft rendering between pages 2026-11-19 17:28:55 +08:00
gloamxun eda01fb689 Show native preview during durable file publication 2026-11-19 17:19:11 +08:00
gloamxun 393fba42d8 Reuse closed events and line breaking after a checkpoint 2026-11-19 16:39:08 +08:00
gloamxun 5aa7dc7331 Stream native failure manifests during publication 2026-11-19 14:50:11 +08:00
gloamxun 72ed779749 Promote verified native PDF and box capacity support 2026-11-19 14:39:39 +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 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 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 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 c5bf150449 Draw the rule body of fbox figures
Parse the first non-zero \rule{width}{height} in a figure without a decoded
image and use it as the float dimensions, so the arXiv sample gets its black
rule body instead of a caption-only float. The fbox frame and vector images are
still unsupported.

This changes the arXiv corpus preview to 3 pages, matching TeX; update the
corpus expectation. Test count stays 1073.
2026-10-27 22:55:52 +08:00
gloamxun 9231c3a7d6 Return dirty-page preview patches
Project previews accept ?patch=1 and only include pages listed in changedPages.
Cache hits return an empty patch list. The web client applies sparse patches by
page index instead of rebuilding every page.

Add a two-page server test that edits only the second page and checks that the
patched payload contains exactly the changed page indices. Measure the arXiv
heading edit: 2 of 3 pages still changed (315 KB vs 396 KB full, 2.66 s), so
dirty-page transfer is in place but incremental layout latency is not.

Test count is 1073 (67 server).
2026-10-27 21:18:39 +08:00
gloamxun e2e80e8728 Compile editor buffers without waiting for a save
Project preview accepts ?buffer=1 and reads the editor text from the POST body.
The source is still expanded with project includes/packages/images, but the file
on disk is not touched, so typing can drive layout immediately while the normal
450 ms save timer runs independently.

Add a server test that previews buffer text, finds it in the SVG, and verifies
hello.tex on disk was not rewritten. Roadmap notes that warm buffer previews
are still ~430 ms (article) and ~2.1 s (arXiv), and that dirty-page streaming
is the next latency step.
2026-10-27 21:01:24 +08:00
gloamxun b1e3e03f00 Fix the arXiv-template PDF output
The user-supplied template PDF exposed four concrete problems:

- title/headings were letter-spaced: plain text in a large paragraph took the
  SizedText segment path and was scaled twice; the fallback run now stays at
  the base size and is scaled once by the paragraph;
- the table lost its third column because unsupported math glyphs were sent
  through the PDF fallback font; table-cell math now has a readable ASCII
  fallback (Size (um), approx. 100, 10**6);
- fancyhdr's \cfoot{\thepage} was painted together with route-D's default page
  number; default numbering is skipped for a fancy pagestyle;
- .bib data was ignored; simple @article/@inproceedings entries are now parsed
  from project .bib files, inlined as thebibliography entries, and resolved by
  the existing citation pass, producing References and [1]-[3].

The regenerated 3-page PDF was checked for title/heading spacing, table text,
references and a single page number per page. A project regression test covers
the .bib path, and the table/heading fixes have unit tests.

Remaining visible limits in this template: the complex display equation, the
\fbox/rule figure body, vector/PDF images and the author block layout.
Test count moves to 1069 (444 core, 432 engine, 65 server).
2026-10-27 13:38:36 +08:00
gloamxun 1058122388 Add route-D web contract and experiment matrix
Route-D preview JSON now reports durationMs on the flat, project and edit
paths, and project preview/PDF responses carry X-Preview-Engine (route-d or
v1), including cache hits and silent fallback. The server tests assert the
headers, the duration field and both PDF engines.

docs/WEB_ROUTE_D_EXPERIMENT.md records the audit verdict, the initial contract
probe, the supported/gap matrix, the three-project trial plan and the
prioritised backlog; ROUTE_D_STATUS.md links to it and the test counts move to
1063.
2026-10-27 12:23:04 +08:00
gloamxun e8f7e37cf7 Pin the corpus page counts
The corpus guard only checked that each document produced at least one page.
It now asserts the exact counts (hello 1, boxes 1, compat 1, arXiv template 2)
alongside the empty warnings array, so a layout regression that drops or adds a
page fails the server test even when no warning is emitted.

The status document's verification paragraph mentions the exact-count check.
2026-10-27 03:02:30 +08:00
gloamxun 28aed153fe Guard corpus previews against warnings
The warning-free corpus sweep was only a manual check. Add a server test that
previews examples/hello.tex, boxes.tex, compat.tex and the arXiv template
through /api/route-d/preview and asserts each returns 200, at least one page
and an empty warnings array, so the corpus guard runs with the normal suite.
2026-10-27 01:39:32 +08:00
gloamxun 371f05baaa Default project previews and PDFs to route-D
uses_route_d still treated v1 as the default unless TEXRRA_ENGINE=route-d was
set, so only the flat /preview endpoint had switched. Make route-D the default
there too: an explicit engine parameter still wins, TEXRRA_ENGINE=v1 forces the
old pipeline, and a route-D error now falls through to the v1 compiler instead
of answering 422 (both preview and PDF).

Because route-D follows pdfLaTeX's Letter default for geometry-less documents,
the two server tests that asserted the v1 A4 page now ask for ?engine=v1 or
expect 215.9mm. A new test starts a server without the environment variable and
checks a project preview uses route-D's italic math face with no literal $.
2026-10-27 00:32:45 +08:00
gloamxun a56d441513 Make route-D the default flat preview engine
POST /preview served the v1 pipeline while route-D lived behind /api/route-d
and the project engine switch. Try route_d::preview_json first and keep the v1
compiler as the fallback when route-D rejects the source; ?engine=v1 forces the
old path and the project endpoints are unchanged.

Both paths now answer with an X-Preview-Engine header (route-d or v1) so the
choice is observable, and the server test helper compares header names
case-insensitively because tiny-http lowercases them.

A server test posts a document and checks route-d by default plus v1 when the
query asks for it.
2026-10-27 00:27:59 +08:00
gloamxun 1bb28cf141 Skip the SIVP test when its project fixture is absent
projects/ is gitignored, so a fresh clone has no projects/_sivp__/sn-article.tex. Return early like the neighbouring front-matter test instead of panicking on the missing file.
2026-10-26 22:03:25 +08:00
gloamxun 1d891b2c6a Verify test server identity before accepting it 2026-10-26 20:34:20 +08:00
gloamxun 090f389589 Reject test servers that exit after a port race 2026-10-26 04:26:17 +08:00
gloamxun 697d84aab3 Cover FIFO eviction in the flat route-D caches 2026-10-25 01:58:23 +08:00
gloamxun 0a91f7e9db Exercise PDF cache concurrency and retry test requests 2026-10-25 01:56:37 +08:00
gloamxun 25eef7097b Capture longtable sources through the tabular path 2026-10-25 01:50:28 +08:00
gloamxun 4d71094fba Exercise the flat preview cache under concurrent requests 2026-10-25 01:46:17 +08:00
gloamxun a11a9ec641 Cover the engine parameter matrix over the environment default 2026-10-25 01:44:26 +08:00
gloamxun a969b5acdf Retry test server startup on occupied ports 2026-10-25 01:11:31 +08:00
gloamxun de00eadcad Keep placeholders for missing or undecodable images 2026-10-25 00:46:00 +08:00
gloamxun 3723036710 Run package document hooks and strip makeat 2026-10-25 00:41:24 +08:00
gloamxun e3e230042a Answer flat route-D errors with JSON messages 2026-10-25 00:39:04 +08:00
gloamxun 9195d090de Merge passed package and class options
Preamble \PassOptionsToPackage and \PassOptionsToClass declarations are
collected and merged into the next \usepackage or \documentclass request,
so the shared option lists in article-class projects reach the local
class and package option protocol.
2026-10-25 00:07:39 +08:00
gloamxun 9ae86d9c86 Retry transient test server requests 2026-10-24 23:59:20 +08:00
gloamxun 04446e673f Inline input files inside project classes and packages 2026-10-24 23:47:57 +08:00
gloamxun cca108dc15 Memoise the flat route-D render endpoints 2026-10-24 23:45:28 +08:00
gloamxun 9aacb91184 Resolve graphics through graphicspath directories 2026-10-24 23:35:14 +08:00
GloamXun 0f8aff7290 Embed project images in route-D previews and PDFs 2026-10-24 23:29:15 +08:00
gloamxun 00f95fdd09 Execute option declarations in local packages 2026-10-24 23:18:28 +08:00
gloamxun fe9e93f796 Inline local base classes from LoadClass 2026-10-24 23:14:01 +08:00
gloamxun 4b0e4eba0c Cache route-D project PDF exports 2026-10-24 23:10:09 +08:00
gloamxun 6d5a3eb686 Run local class option declarations 2026-10-24 23:07:51 +08:00
gloamxun 11cfa44c2b Test link annotations in route-D PDFs 2026-10-24 23:05:05 +08:00
gloamxun 91a75820a4 Default to route-D with TEXRRA_ENGINE 2026-10-24 23:03:34 +08:00