Freeze maths inside list items so the delimiter checks pass - #86
Open
peterbjohnson wants to merge 4 commits into
Open
peterbjohnson wants to merge 4 commits into
peterbjohnson wants to merge 4 commits into
Conversation
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.
Six of the nine PHYS40002 tex sheets fault on maths delimiters after t44, all in list items. Two causes, seen in the frozen markdown of a real sweep:
... given by $$U = 5 \times 10^{-21} \left( ... \right)then a continuation line indented past the item's content column, ending\text{J},$$ where $r$ is ...- is left as written, because_verbatim_linescounts the continuation line (indented four or more past the item's column) as a code block and_display_maths_blockedthen skips the match. A line inside an open$$ ... $$is never code: track open display maths while walking the lines, and treat every line of the span as maths. The rewrite then puts the$$on lines of their own, indented to the item, with the words before and after as their own paragraphs, as it does for a one-line match. Findings this removes:opening $$ must be followed by a newline,opening $$ must start its own line,closing $$ must start its own line.$ ... $whose author broke the line inside it -$\frac{1}{2} m v^2 = 576\,$written over two lines in the .tex - freezes with the newline inside, and the checks report it asdisplay $$ ... $$ closed with a single $ornewline inside an inline $ ... $. A newline inside inline maths carries nothing: join the lines of an inline$ ... $span with a space at the freeze, in a paragraph or a list item, before the display-maths rewrite runs, so that the check sees one line. Do not touch$$spans here.Fixtures: add both shapes to tests/fixtures/sources/display_maths/source.tex (a display maths over two lines inside an item with words either side; an inline maths broken over two lines) and re-freeze its expected.json; tests/test_source.py's delimiter assertion over every block then covers them. Done when the two shapes freeze to fields
math_delimiter_checkerpasses, and the existing fixtures re-freeze unchanged except display_maths.Workbench ticket t56.