Repository navigation
Release 1.15.1 - #60
Merged
Merged
Conversation
… characters (#59) In `cases`, `pmatrix`, `bmatrix` and anything between \left and \right, "20" was drawn as "200" and "2x" as "2xx"; the limits of a \sum inside delimiters were dropped. Cause (vendored SwiftMath): the step that merges neighbouring characters rewrote the caller's atoms, and makeLeftRight typeset its content twice (once to size the delimiters, once to place it), so the second pass merged again. Same changes as upstream SwiftMath #70 and #75: - typesetting preprocesses a copy of the list, never the caller's atoms; - makeLeftRight typesets its content once and reuses the display. Tests: the engine is now compiled into the test target (MathEngineTests reads what a formula draws; the fonts come from the source tree through MathFontsBundle.overrideURL). Seven of the nine tests fail without the fix. The engine's `backgroundColor` extension moves from every NSView to its own label: with the engine in the test target it shadowed NSTextView's property wherever an optional colour was expected. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…acing, space widths Found while fixing #59, all in the vendored SwiftMath: - Crash: `b^\\` inside aligned / matrix / cases took the row break as the exponent, advanced the row count twice and the table parser indexed a row it never made (a trap that closed the app). Rows now grow to the row the parser is on (upstream SwiftMath #76). - Signs: TeX rule 5 looks at the previous atom; a style change or a space is not one. `\displaystyle -x`, `\quad -x` and every matrix or cases cell starting with `-` (cells begin with a style) were spaced like a subtraction. A subtraction keeps its spacing. - Spaces: a space command is as wide as it asks for (`\,` 3mu, `\;` 5mu, `\quad` 18mu, `\qquad` 36mu, `\!` -3mu). The tokenizer measured the atom's type, so every one of them was a thin space. Tests: MathEngineTests (crash inputs parse and typeset; widths compared with each other, never with numbers). The sign and space tests fail without the two changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Formulas: no more repeated characters inside brackets, a crash on a malformed formula, signs and spaces as LaTeX sets them.
Fixed
^or_insidealigned,matrixorcases(for exampleb^\\) closed QuickMD.cases,pmatrix,bmatrixand anything between\leftand\right,20was drawn as200and2xas2xx(LaTeX: characters duplicated inside \begin{cases} (20 renders as 200, 12 as 122) #59).\left…\rightare drawn again.casescell, or right after\displaystyleor a space command, sits against its number instead of being spaced like a subtraction.\quad,\qquad,\;and\!were all drawn as narrow as\,.How
All in the vendored SwiftMath: typesetting preprocesses a copy of the list and
\left…\righttypesets its content once (as upstream #70 and #75), the table parser grows its rows to the row it is on (upstream #76), rule 5 looks at the previous atom, and a space command is measured by its own width.Tests
The math engine is now compiled into the test target (
MathEngineTests, 13 tests that read what a formula draws). 1234 tests pass locally on a clean build; Debug, Release and Release with-DAPPSTOREbuild.Closes #59