Allow semantic wrappers around matrix TeX - #1852
Closed
adamant-pwn wants to merge 1 commit into
Closed
Conversation
Extend stack_matrix_disp with an optional TeX command. When present, pass the configured left and right delimiters and the delimiter-free array as three arguments so a surrounding renderer can override presentation while retaining per-question fallbacks. Preserve one-argument output exactly and document and test all five delimiter settings.
Author
|
Closing this for now. The optional wrapper is only useful for our intended case once STACK can provide a stable default command that may be overridden by the surrounding context. Without that part, this adds author-facing API without delivering the complete mechanism. I’ll retain the prototype and revisit it with a complete proposal. |
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.
Summary
stack_matrix_disp(m)with an optional TeX wrapper argument.stack_matrix_disp(m, "\\stackmatrix"), emit\stackmatrix{left}{right}{array}.Motivation
This provides a small platform-neutral hook for late-bound notation. A wrapper can use the first two arguments as the question's configured fallback or ignore them in favour of another presentation. Different wrappers can distinguish semantic matrices, column vectors and row vectors without making STACK inspect Moodle course context or changing compilation, grading or input syntax.
This PR only changes the TeX emitted when an author opts in; it does not install or order wrapper definitions. The ordinary one-argument call remains unchanged.
The corresponding HTML-input distinction remains in #1848. A TeX wrapper cannot restyle STACK's ordinary HTML input grid.
The shared-question use case has also been discussed in #1327 and MathJax #3603.
Verification
git diff --checkpass.