Skip to content

Typst tables framed by rules, with row-header columns, widths, topic labels, and raw cells - #9

Merged
billdenney merged 2 commits into
mainfrom
feat/typst-rules-topic-names-raw-cells
Oct 6, 2026
Merged

billdenney merged 2 commits into
mainfrom
feat/typst-rules-topic-names-raw-cells

Conversation

@billdenney

Copy link
Copy Markdown
Member

The "typst" backend now frames each table's data with a rule under the column header and one at the end of the table. The header rule sits inside table.header, so it repeats with the header on every page. Four optional table attributes, beside the existing tabtibble_align, adjust a table further:

  • tabtibble_header_cols: the number of leading columns that label their rows, separated from the rest by a vertical rule.
  • tabtibble_widths: Typst column widths ("auto", a length such as "3cm", or a fraction such as "2fr"), named by column or in column order.
  • tabtibble_topic_labels: TRUE shows each topic header as ": ", so a listing's subject row reads "Subject: S001".
  • tabtibble_typst_raw: columns whose cells are Typst markup (such as $r^2$), written without escaping.

Each attribute is validated with an error naming it, and column header names are now escaped like cell text. Unit tests pin the exact Typst for each, a Quarto render test compiles a table that uses all of them (asserting the typeset math and the repeating header on a multi-page table), and the workflow installs Quarto so that test runs in CI. nca.reporter uses these for its report tables (Bill's report review items 4, 12, 13 and 14).

🤖 Generated with Claude Code

billdenney and others added 2 commits October 6, 2026 17:59
…topic labels, and raw cells

The "typst" backend now draws a rule under the column header (inside
table.header, so it repeats with the header on every page) and one at the
end of the table, framing the data. Four optional table attributes adjust
a table further, each beside the existing tabtibble_align:

- tabtibble_header_cols: the number of leading columns that label their
  rows; a table.vline() separates them from the rest.
- tabtibble_widths: Typst column widths ("auto", a length, or a fraction),
  named by column or in column order.
- tabtibble_topic_labels: TRUE shows each topic header as
  "<column name>: <value>", so a subject row reads "Subject: S001".
- tabtibble_typst_raw: columns whose cells are Typst markup (such as
  $r^2$), written without escaping.

Each is validated with an error naming the attribute. A Quarto render test
compiles a table that uses all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and compile the backend in CI

Review fixes to the Typst table attributes:

- tabtibble_topic_labels must be a single TRUE or FALSE; anything else is
  an error naming the attribute (it was read with isTRUE()).
- tabtibble_widths is named for every column or for none: a partly named
  vector, a name that is not a data column, and a column named twice are
  each an error naming the attribute and the name. A length or fraction
  may start with a decimal point (".5in").
- Column names are escaped in the column header, as they are in topic
  headers.
- tabtibble_header_cols on a table whose every column is a topic column
  says so.
- The other backends ignore the four attributes; under them, and the
  markdown fallback outside Quarto, a raw column is escaped (documented).

The R-CMD-check workflow installs Quarto, so the render tests compile the
Typst in CI rather than skip. The render tests now check the typeset math
and that a long table's header repeats on every page. The vignette
documents each attribute with an example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
R/typst_topic_table.R 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@billdenney
billdenney merged commit e32ed78 into main Oct 6, 2026
8 checks passed
@billdenney
billdenney deleted the feat/typst-rules-topic-names-raw-cells branch October 6, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant