Rename the crate, binary, core crate, font families, env vars, and internal commands from texcraft/tex-engine to texrra. Serve the separately versioned texrra-web frontend from TEXRRA_WEB_DIR, ../web, or ./web instead of embedding index.html. Add starred section heading support and an arXiv template conformance fixture.
3.3 KiB
3.3 KiB
Roadmap: remaining structural work
This file lists the concrete implementation plans for the foundational items that are still missing. Each item names the files/functions to touch.
1. Paragraph indentation (\parindent)
- Add
parindent: ScaledtoDocumentModel(with the 11pt article default 17pt) and aParindentfrontend event. - Feed
\setlength{\parindent}{...}through an engine-side named length register (the adapter already stores named lengths); when the register is written, emit the event. Do not use a prelude\ifxconditional: it broke preamble loading when tried. - Apply indentation inside the paragraph breaker: the first line's available
width is
line_width - parindentand its start x isparindent.boxworks_line_break/cached_paragraph_linescurrently take only a width; extend the signature with a first-line indent and carry the per-line x offset intotext_layout::LineBox/PositionedLine.x. - Suppress after headings, after
\maketitle, and for\noindent; track asuppress_indentflag in the parser.
2. Sans family (\sffamily)
- Load Liberation Sans in
latin_diralongside serif/mono (seefont_inputs/register_box_font_familyinsrc/rust_typeset/pdf.rs). - Add
sans: booltoRunand to the style map key;paragraph_font_idselects the sans family when set. - Thread a
sans_familythroughTextLine/TextLine::newand the SVG font-family choice (TexrraSans), and add a@font-facein the preview. \sffamily/\textsf{...}become declaration primitives like\ttfamily.
3. Inline framed boxes / \raisebox
- Add
y_offset: MmtoPositionedSpanandPositionedRule; PDF/SVG painters add it to the baseline. - Represent inline boxes as a nested
LineItem::Box { items, width, ascent, depth, inset, raise, frame }; the line breaker measures the content once and advances by its width. - Paint child items at
x + inset, baseline- raise; draw frame rules at the box rectangle whenframeis set. \raisebox{lift}{...}reuses the same nested item withraise = lift.
4. 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.
5. Floats
- Classify figure/table blocks as floats with
[htbp]placement hints. - Planner: maintain pending floats and try top/bottom/page placements; keep reading order for text and defer floats when they do not fit.
- Renderer: place deferred floats at the saved slots; page keys must include float placement decisions.
6. Page styles / headers-footers
DocumentModelfields 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.
7. Unified pagination
- Extract the current duplicated planner (
build_page_break_plan) and renderer (build_positioned_pages) vertical logic into one page builder returning an ordered list of placed items, then use it for both page-break decisions and final painting.