Add float placement and page headers/footers

This commit is contained in:
gloamxun committed 2026-10-19 13:41:29 +08:00
1 parent 1da46c61d6
commit ed1da06685
16 files changed
+974 -90

No files matched your search

+16 -8
View File
@@ -23,7 +23,12 @@ the source changes; the SVG preview is refreshed per page.
centering, first-line `\parindent` (17pt default, group-scoped, `\setlength`/
`\addtolength`/`\noindent` aware), and `\hfill`/`\hfil` infinite glue.
- Pages: A4/A5/B5/Letter/Legal/Executive, landscape, geometry margins and
text block, automatic pagination, `\newpage`/`\pagebreak`.
text block, automatic pagination, `\newpage`/`\pagebreak`; figures/tables
honor `[htbp]` hints with top/bottom/page/here approximations. Page styles:
default `plain` page numbers, `\pagestyle{empty|plain|fancy}`,
`\thispagestyle`, fancyhdr `\fancyhead`/`\fancyfoot` (L/C/R) and
`\lhead`/`\chead`/`\rhead`/`\lfoot`/`\cfoot`/`\rfoot`, with `\thepage`
resolved at paint time.
- Notes: `\footnote{...}` page-bottom insertion area with separator rule,
superscript markers, and title/author `\thanks`.
- Classes/packages: built-in classes, local `.cls`/`.sty`, paper options,
@@ -42,8 +47,9 @@ See `docs/ROADMAP.md` for concrete implementation plans.
- Boxes: `\parbox`/`\minipage` are block-level; `\vbox`/`\vtop` map to a
full-width block rather than true nested VBox material.
- Pages: no floats, no headers/footers (fancyhdr commands are accepted as
no-ops), planner and renderer are separate.
- Pages: float placement is immediate rather than a deferred float queue
(no `\textfraction` tuning, no reordering around later text); planner and
renderer are still separate.
- Notes: footnotes inside captions, floats, or arbitrary boxes are not
collected; the insertion area currently follows the page where the paragraph
ends rather than the exact reference line.
@@ -51,14 +57,16 @@ See `docs/ROADMAP.md` for concrete implementation plans.
A4-content defaults, not geometry-aware.
- Miscellaneous: `\tableofcontents`/list commands are no-ops; base font-size
class options (10/11/12pt) are parsed but unused; rules are painted with 1x1
images in PDF.
images in PDF; a document-level `\renewcommand{\maketitle}` is ignored in
favor of the engine title block.
## Verification
- `examples/hello.tex`, `examples/boxes.tex`, `examples/compat.tex` compile to
one A4 page each; the arXiv template project compiles to 3 Letter pages.
- `cargo fmt --check` passes; `cargo test --workspace` (23 tests) covers the three
examples, the arXiv fixture, SVG/PDF output, project API, static frontend
assets, path traversal, the legacy `/texrra` endpoint, and page-hash cache
stability.
- `cargo fmt --check` passes; `cargo test --offline` (26 tests: 22 compiler
integration tests + 4 server tests) covers the three examples, the arXiv
fixture, floats/newpage, page styles and `\thispagestyle`, SVG/PDF output,
project API, static frontend assets, path traversal, the legacy
`/texrra` endpoint, and page-hash cache stability.
- Warm preview: hello ~0.6ms, arXiv ~13ms (release server, page layout cached).