Repository navigation
Conversation
`\substack{i<n \\ j<m}` (amsmath) stacks lines in a subscript or a
superscript, most often the conditions of the limits of a `\sum`. It was an
unknown command, and the `\\` inside it another error.
`\substack` is `\begin{subarray}{c}...\end{subarray}`. Both are now arrays:
`subarray` is a tabular environment with one column, `l` or `c`; `\substack`
is a function whose argument is rows, as `\displaylines` is, and serializes as
`\substack{...}`. As amsmath and KaTeX set them, they are in script style,
with an `\arraystretch` of 0.5, no space before or after the column, and no
`\jot` between rows.
In the editor, adding a row (ctrl/cmd+Enter) in a subscript or superscript
that is not in an array, such as the lower limit of a `\sum`, splits it at
the caret into a two-line `\substack`; in a `\substack`, it adds a line.
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.
\substack{i<n \\ j<m}(amsmath), the usual way to stack the conditions under a\sum, is an unknown command, and the\\inside it is a second error. KaTeX, Temml and MathJax all support it.What this adds
subarrayis a tabular environment with one column,lorc, as in amsmath.\substack{…}is\begin{subarray}{c}…\end{subarray}. It's a function whose argument is rows, as\displaylinesalready is, and it serializes back as\substack{…}. A&inside it is ignored, since it has one column.\arraystretch0.5, no space before or after the column, and no\jotbetween rows.addRowAfter) in a subscript or superscript that isn't already in an array, such as the lower limit of a\sum, splits it at the caret into a two-line\substack. Inside a\substack, it adds a line. Before this,addRowAfterthere did nothing.Tests
SUBSTACK AND SUBARRAYblock intest/latex.test.tscovers round trips with no verbatim LaTeX kept, no parse errors, and that\substackdraws exactly as{subarray}{c}.test/playwright-tests/substack.spec.tschecks that ctrl+Enter in a sum's limit makes\sum_{\substack{i<n\\ j<m}}, and that ctrl+Enter in a\substackadds a line.Suggested changelog line:
\substackand thesubarrayenvironment are supported; adding a row in the limit of a\sumstacks it in a\substack.🤖 Generated with Claude Code