Add configurable piecewise and bounded operator shortcuts - #3056
Open
Shrookin wants to merge 4 commits into
Open
Add configurable piecewise and bounded operator shortcuts#3056Shrookin wants to merge 4 commits into
Shrookin wants to merge 4 commits into
Conversation
Shrookin
marked this pull request as ready for review
August 4, 2026 18:36
lofcz
added a commit
to lofcz/mathlive
that referenced
this pull request
Aug 9, 2026
Shrookin
marked this pull request as draft
August 11, 2026 02:03
Shrookin
marked this pull request as ready for review
August 11, 2026 04:39
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
Adds configurable piecewise and bounded-operator LaTeX shortcuts while preserving normal MathLive editing behavior:
\piecewise{n}creates an editable nativecasesstructure withnrows.\int{x}{y},\sum{x}{y}, and\prod{x}{y}create bounded operators.\placeholder{}instead of removing the bound.\piecewiseno longer commits\piwhile the command is incomplete.Why
MathLive users need parameterized structural shortcuts that remain editable after insertion. Prefix commands must also behave like ordinary LaTeX input: a shared prefix should remain pending until the command is complete or explicitly finalized. Structural deletion must preserve editable placeholders without making an empty operator impossible to remove.
Implementation
piecewiseparser that builds the same native cases-array structure used by regular editing.int,sum, andprodwhile preserving their existing unbounded forms.Consumer synchronization
The dependent applications remain compatible with MathLive 0.110 while consuming the shared behavior:
86eda86keeps structural LaTeX command caret handling visible and preserves bounded-operator editing through its adapter.976e0582marks the shared piecewise key ascompactwhile retaining the legacy styling hook.8edfa46applies the same keyboard-key compatibility update.Verification
npx tsc --noEmit -p tsconfig.json— passed.npx jest test/ --runInBand— 344 tests passed.The branch remains draft while the behavior is reviewed.