Add footnote insertion area and thanks

This commit is contained in:
gloamxun committed 2026-10-19 13:11:17 +08:00
1 parent 5fa301fdcd
commit 1da46c61d6
11 files changed
+486 -28

No files matched your search

+5 -14
View File
@@ -5,19 +5,10 @@ are still missing. Each item names the files/functions to touch.
Completed: paragraph indentation (`\parindent`) and `\hfill`/`\hfil`; sans
family and true scaled small caps; inline box geometry (`\fbox`, `\makebox`,
`\raisebox`), `\minipage`, and `\vbox`/`\vtop` block approximations (see
`docs/STATUS.md`).
`\raisebox`), `\minipage`, `\vbox`/`\vtop` block approximations, and
footnotes/`\thanks` (see `docs/STATUS.md`).
## 1. Footnotes
- Parser: capture `\footnote{...}`/`\thanks{...}` into a per-paragraph list
with a number marker run (superscript approximation via smaller raised text
once y offsets exist).
- Page model: add a footnote area to the page goal; the planner must reduce the
text height and place footnotes with a separator rule at the bottom.
- Paint footnotes as normal positioned lines after the page's content.
## 2. Floats
## 1. Floats
- Classify figure/table blocks as floats with `[htbp]` placement hints.
- Planner: maintain pending floats and try top/bottom/page placements; keep
@@ -25,13 +16,13 @@ family and true scaled small caps; inline box geometry (`\fbox`, `\makebox`,
- Renderer: place deferred floats at the saved slots; page keys must include
float placement decisions.
## 3. Page styles / headers-footers
## 2. Page styles / headers-footers
- `DocumentModel` fields for header/footer runs and `\pagestyle`/`\thispagestyle`.
- Paint headers/footers in the page margins in both PDF and SVG; page numbers
need a page index placeholder resolved at paint time.
## 4. Unified pagination
## 3. Unified pagination
- Extract the current duplicated planner (`build_page_break_plan`) and renderer
(`build_positioned_pages`) vertical logic into one page builder returning an
+8 -3
View File
@@ -24,6 +24,8 @@ the source changes; the SVG preview is refreshed per page.
`\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`.
- 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,
`\DeclareOption`/`\ProcessOptions`/`\ExecuteOptions`/option passing.
- Compatibility: spacing macros (quad/qquad/thin/en/med/thick, `\vspace*`,
@@ -40,8 +42,11 @@ 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 footnote insertion area, no floats, no headers/footers (fancyhdr
commands are accepted as no-ops), planner and renderer are separate.
- Pages: no floats, no headers/footers (fancyhdr commands are accepted as
no-ops), planner and renderer are 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.
- Lengths: `\textwidth`/`\textheight`/`\linewidth`/`\columnwidth` are fixed
A4-content defaults, not geometry-aware.
- Miscellaneous: `\tableofcontents`/list commands are no-ops; base font-size
@@ -52,7 +57,7 @@ See `docs/ROADMAP.md` for concrete implementation plans.
- `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` (21 tests) covers the three
- `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.