Files
business-suite/BUGS.md
T
Marc WäckerlinandClaude Opus 5.5 5f56145fb3 1.0.3: pictures fill the free width or height of their page, long table heads stay with their table
A picture takes the full line width or the full free height, whichever it reaches first; a drawing moves to the next page only below picturekeep of its full-page size; inside a sentence at most half the page, inside a figure at most the top float share. A long table is marked directly in front of its first head, so a page break before it prints no head or foot on the heading's page. Review findings fixed, full suite green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 00:03:38 +01:00

53 lines
6.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Bugs
Defects of the suite, each with its cause, its correction and the test that measures it.
## A table header appears before its heading
- **Found:** 2026-11-18, a table at a page boundary printed its header before its heading and again below it; a table with a continuation footer could also print that footer before the table.
- **Cause:** longtable had installed its output routine when TeX selected a break before the heading, so it treated that break as a table continuation.
- **Fix:** every long table gets a number of its own, set as a mark directly in front of its first head, and continuation output prints a header or footer only when the preceding page contains the current table. The mark stands after longtable's own break in front of the table, so a break there leaves no head or foot on the page of the heading, and a table with an empty `\LTcaptype`, which longtable's own counter skips, still gets its number. A patch that no longer matches a longtable release warns instead of stopping every build.
- **Test:** `tests/layout.py` › `longtable_boundary` checks both boundary cases and all rows, headers and footers of a separate multi-page table, and a table whose first rows are joined at the foot of a page (`tests/longtable-joined.tex`): it moves with its heading, with one head, no foot before it and all four rows.
## A picture shrinks until unreadable or leaves free room empty
- **Found:** 2026-11-18, twice: a diagram with a detailed legend became too small to read after preceding content moved it lower on the page; and a tall swimlane diagram under the title block stopped at half the text height and left the lower half of its page empty, with nothing after it on that page.
- **Cause:** the picture scaler reduced lying vector diagrams to any remaining page height, and capped upright pictures at half the text height whatever the page still had free. A picture made as high as the whole text height also did not fit under the invisible material a document starts with, and left its first page empty.
- **Fix:** every picture takes the full line width or the full free height, whichever it reaches first. A drawing moves to the next page and fills it only where it would keep less than `picturekeep` (default half) of its size on a page of its own, or where less than a quarter of the page is free; a raster keeps its remaining-space and enlargement limits. The height of a page of its own is the text height less the space between paragraphs and the line the picture stands on. Inside a sentence a picture takes at most half the page, because its line would otherwise break the paragraph; inside a figure at most the top share LaTeX allows a float, less the caption, because a larger figure waits for the end of the document.
- **Test:** `tests/layout.py` › `pictures` (F6.5, F6.7): an upright picture alone fills the text height, a lying one under 28 lines and an upright one under 10 lines fill the free room of their page, an upright one under 25 lines moves and fills the next page, the picture under 10 lines ends at the foot of the text, with `picturekeep=0.3` the picture under 25 lines stays, a lying picture under 40 lines moves, a picture inside a sentence stays within half the page, and an upright figure with `[!ht]` and with `[ht]` under 25 lines stands on the next page; isolated original/fixed comparison.
## Search through every folder below the document
- **Found:** 2026-11-14, converting a document at the root of a checkout of 68377 folders: the conversion took 56 minutes 24 seconds, of which the probe 12 minutes 39 seconds and the first of the two LaTeX runs of the document 21 minutes 41 seconds.
- **Cause:** the converter named the suite, the folder of the document and the build folder in `TEXINPUTS` with a trailing `//`. kpathsea expands such an entry into every folder below it and tries each file name in all of them before the TeX tree, which comes last: one lookup of `fontspec.sty` took 257 seconds instead of 0.15. A file named like a package of TeX Live anywhere below the document replaced that package, and a package in a test build of the suite could serve as the identity of a company.
- **Fix:** the converter names the package folder of the suite, the folder of the document and the build folder without `//`. The same document converts in 11.5 seconds.
- **Test:** `tests/md2pdf.py` › `subfolders` (F11.16).
## An HTML table opens the address of an iframe
- **Found:** 2026-11-14, in the security review of the HTML table filter: a cell with `<iframe src="http://127.0.0.1:…/page.html">` made the build send a GET to that address and put the page into the PDF.
- **Cause:** `bin/html.lua` read the raw table with the HTML reader of pandoc in the global environment, which fetches what an iframe names.
- **Fix:** the table is read in an empty sandbox.
- **Test:** `tests/md2pdf.py` › `html_sandbox` (F11.14).
## A form label is read as LaTeX
- **Found:** 2026-11-14, in the security review of the form filter: a label `Notes}\input{<file>}\iffalse` put the file into the PDF, and a `%`, `&` or `#` in a label stopped the build.
- **Cause:** `bin/forms.lua` wrote the label into `\businessremark`, `\businessline` and `\businesslabelwidth` as it stood.
- **Fix:** every label is written through the LaTeX writer of pandoc, which escapes it.
- **Test:** `tests/forms.py` › `labels` (F13.4).
## The form pattern takes quadratic time on a long line
- **Found:** 2026-11-14, in the security review of the converter: 0.29 seconds for a line of 20000 characters, 1.01 for 40000, 3.6 for 100000.
- **Cause:** `^.*\S.*:` in the pattern `FORM` of `bin/md2pdf.py` tried every split of a line between its two `.*`.
- **Fix:** the label part scans a line once and matches the same lines.
- **Test:** `tests/md2pdf.py` › `form_pattern` (F13.5).
## A kept build folder lays old drawing links over a new drawing
- **Found:** 2026-11-14, in the security review of the drawing filter.
- **Cause:** the drawings are numbered from one in every run, and `bin/svg.lua` wrote no link file for a drawing without links, so with `--keep-tex` the file of the earlier drawing of that number stayed and the template read it.
- **Fix:** the link file of the drawing is removed before the links are written.
- **Test:** `tests/md2pdf.py` › `stale_links` (F11.17).