Repository navigation
Conversation
Problem: rgroup_sep is documented as "t" = line above each row group, "b" = line below, "tb" = both. Typst, Word and HTML output follow that, but LaTeX output was identical for "tb", "t" and "b": one \midrule between consecutive row groups. Cause: _output_tex only checked rgroup_sep != "". Fix: draw the \midrule between groups only when "t" is in rgroup_sep (above every group but the first, as in Typst), and add a \midrule directly below each displayed row-group name when "b" is in rgroup_sep. With the default "tb" and visible group names this adds a rule under each name, matching the default Typst rendering. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem do you want to solve?
The
rgroup_sepdocs say"t"draws a line above each row group,"b"a line below, and"tb"both. Typst, Word and HTML output follow that. LaTeX output is the same for all three:Rule placement in the body (
RULE=\midrule,\addlinespaceomitted):rgroup_sep"tb"G1 a b RULE G2 c dG1 RULE a b RULE G2 RULE c d"t"G1 a b RULE G2 c dG1 a b RULE G2 c d(unchanged)"b"G1 a b RULE G2 c dG1 RULE a b G2 RULE c d""G1 a b G2 c dFix
This matches
_output_typst:t: the\midrulebetween groups (above every group but the first, where the header rule already sits) is drawn only when"t"is inrgroup_sep.rgroup_addlinespacearound it is unchanged.b: a\midruledirectly below each displayed row-group name, including the first.No rule is added for
bwhenrgroup_display=False, which matches Word and HTML. Typst draws it even then, so with hidden names under the default"tb"it shows a rule at the top of the first data row of the first group, right under the header rule. That is why ETable output, which hides group names, is unchanged.Behaviour change to flag: with the default
"tb"and visible group names (DTable(byrow=...), a groupedMTable), LaTeX output now has a rule under each group name, as the default Typst/Word/HTML output already does. No existing snapshot covers that case, so no snapshot changes.Tests
test_tex_rgroup_sep_places_rules_like_typst(intests/api/test_mtable_outputs.py) is parametrized over"tb","t","b"and"". It checks the sequence of rules and rows in the LaTeX body, and checks that the number of rules equals the number of row-grouptable.hlines in the Typst output for the same table. 2 of the 4 cases ("tb","b") fail on main, and all 4 pass with the fix. The"t"and""cases are guards. The four variants also compile with pdflatex. Full suite: 502 passed, and all 135 snapshots are unchanged. pre-commit andtyare clean.Open question
If the rule under the group name should not become the LaTeX default, the alternative is to change
DEFAULT_RGROUP_SEPto"t". That keeps today's LaTeX look, but it changes the default Typst/Word/HTML rendering instead.🤖 Generated with Claude Code