Skip to content

Fix/bussproofs#1525

Open
zorkow wants to merge 6 commits into
developfrom
fix/bussproofs
Open

Fix/bussproofs#1525
zorkow wants to merge 6 commits into
developfrom
fix/bussproofs

Conversation

@zorkow

@zorkow zorkow commented Jul 8, 2026

Copy link
Copy Markdown
Member

New Commands for (partially) complete Package

\DisplayProof / \DP was unsupported: proof commands used outside a
prooftree environment now open an implicit proof tree on the parser stack, and
\DisplayProof terminates and displays it — so plain-TeX-style
\AxiomC{$A$}\UnaryInfC{$B$}\DisplayProof works, including inline within
other math, e.g. X + \AxiomC...\DP + Y. Inside the environment \DisplayProof
is redundant and ignored. Forgetting it produces a "Missing \DisplayProof"
error; using it with a malformed tree gives the .stys "Proof tree badly
specified"`.

All remaining abbreviations: \AX, \UI, \BI, \TI (the \fCenter
sequent forms), \QI, \QIC, \QuI, \QuIC, \DP, plus
\EnableBpAbbreviations as an empty operation as abbreviations are always
enabled but we don`t want to throw an error.

\dottedLine / \alwaysDottedLine works now in CHTML and SVG. \doubleLine
works in CHTML, although with less spacing than in LaTeX, but does not work in
SVG. What does not work are combinations as in the actual package (e.g.,
\dottedLine\doubelLine leads to double dotted lines)

\insertBetweenHyps: inserts spacing between hyps in the usually empty mtd element.

\kernHyps: adds an mspace to the first premise, sliding the rule premises to the right.

\bottomAlignProof / \centerAlignProof / \normalAlignProof: applied at proof
finalization as the root mtable`s align attribute.

Sequent Calculus Fix

Alignment along \fCenter over multiple sequents was only ever applied to a
pair of sequent lines, and only when the upper line of the pair was an axiom. So
it worked for a two-line axiom-plus-inference proof but not really anywhere
else.

Consequently, I have replaced adjustSequentPairwise with alignSequents,
which measures every sequent in the chain once, takes the maximum antecedent
width and maximum succedent width, and pads each line's narrower sides up to
those maxima.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.64286% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.71%. Comparing base (05c4055) to head (e01f1c6).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
ts/input/tex/bussproofs/BussproofsItems.ts 73.68% 10 Missing ⚠️
ts/input/tex/bussproofs/BussproofsMethods.ts 97.26% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1525      +/-   ##
===========================================
+ Coverage    86.47%   86.71%   +0.23%     
===========================================
  Files          340      340              
  Lines        86178    86262      +84     
  Branches      4856     3246    -1610     
===========================================
+ Hits         74520    74799     +279     
+ Misses       11658    11463     -195     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zorkow zorkow marked this pull request as ready for review July 12, 2026 08:02
@zorkow zorkow requested a review from dpvc July 12, 2026 08:02

@dpvc dpvc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor request, otherwise looks good. (I admit that I don't know these proof trees, so I can't really check anything myself.)

*
* @param {MmlNode} tree The proof tree.
*/
private alignProof(tree: MmlNode) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer protected to private for these, so that the item class could be subclassed and the subclass could have access to the method, if needed (e.g., if toMml() is being replaced and needs to call it).

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.

2 participants