Repository navigation
LaTeX: brackets alone as scripts, bars in text, \vert and \bigm| - #32
Merged
Merged
Conversation
… a default and empty macro bodies
\DeclareMathOperator{\name}{text} (and \DeclareMathOperator\name, starred or not) defines
\name as \operatorname{text} (\operatorname*{text}); a macro of \newcommand{\f}[n][default]
takes its first argument optional, [given] or the default, as \newenvironment does; an
empty body (\newcommand{\e}{}, \def\e{}) expands to nothing, not to an empty group. The
latex2mathml macro cases that were not expanded now are, but for
newcommand-optional-default, where latex2mathml takes the group after a macro whose one
argument is optional as that argument: LaTeX gives it its default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyVio98rJkziNnwWW9T1Mn
…ts alone in a group
Two bars with nothing between them (||, | |) are bars alone, but for two such pairs
around something, a norm (||x||) as UnicodeMath reads it; one bar alone between
brackets with an empty side holds the placeholder there ({|} is {⬚│⬚}, as \middle| is);
the pairs of bars between \left and \right are grouped, which UnicodeMath would otherwise
close at \right (├(x|a|b┤)); {|}, the ordinary bar of TeX, is a bar alone, and the
writer writes so a bar alone before other bars that the reader would pair it with. A
bracket that a group opens and does not close (\phantom{(}, \mathstrut) is escaped,
where UnicodeMath closed it with an empty fence. An mrow between bars or brackets that
are text has no default intent (no absolute value of bars alone). The latex2mathml
cases spaces, middle and mathstrut now write LaTeX that reads back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyVio98rJkziNnwWW9T1Mn
…and \bigm| as LaTeX means them
- A bracket alone as a script: x_( and x^{)} are escaped, where UnicodeMath read the opening of what follows or lost
the bracket (\) and \] would end the LaTeX: the closing brackets are held as noncharacters until the end); a
script in brackets that close, Word's x^(a+b), is left as it is. The writer braces a script that is a bracket
(x_{[}, not x_[).
- The bars of \text are text, not escaped (\text{a|b}).
- \vert outside angles is the bar |, which EscapeOddBars pairs or escapes (a\vert b threw).
- \bigm| outside brackets is a relation, {|}, a bar alone that no other bar pairs with (|a \bigm| b|).
- The writer writes {|} for a bar alone between brackets, which the reader would read as their separator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyVio98rJkziNnwWW9T1Mn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyVio98rJkziNnwWW9T1Mn
|
|
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.
On main. The stack it was part of (#22, #23, #29) is merged. Continued by #35.
These four bugs were found while working on #29 and were already there before it:
x_{[}x_[, which reads back asx_([)x_{[}, reads back the samex_(,x^{)}𝑥_((()┤),𝑥^(()\))𝑥_\(,𝑥^\)\text{a|b}"a|b", written back with a backslash in it"a|b"a\vert b𝑎|𝑏|a \bigm| b||𝑎|𝑏|: the\bigmbar was paired with the first bar|(𝑎|𝑏)|x^(a+b), where the brackets close, is still read as a group.{)}, is escaped too.\)and\]would end the LaTeX, so escaped closing brackets are held as noncharacters until the end, as the escapes of\textalready are.\textand the like are left alone.\vertis|, which is then paired or escaped like any other bar.\bigm|outside brackets becomes{|}, a bar alone. Between brackets it stays the separator, so\{x \bigm| x>0\}still reads as{𝑥│𝑥>0}.{|}for a bar alone between brackets, which would otherwise read back as their separator:\{x {|} x>0\}did not read back the same.ReadsSlashesAndBarsAsLaTeX. 6950/6950 pass on net10.0 and net8.0, after merging main.🤖 Generated with Claude Code
https://claude.ai/code/session_01SyVio98rJkziNnwWW9T1Mn