Repository navigation
Fix DVI operand lengths for y1–y4 and xxx1–xxx4, and the fnt1–fnt4 range - #398
Merged
Merged
Conversation
- y1..y4 (162-165) read cmd-152 (10-13) operand bytes instead of cmd-161 (1-4), desynchronising the stream. Any formula whose DVI uses y1, e.g. \matrix and \pmatrix, failed with 'stack is empty'. - fnt1..fnt4 are 235-238, but the branch covered 235-242 and swallowed the xxx1..xxx4 specials (239-242), whose operand length was also off (cmd-242 instead of cmd-238).
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.
Three opcode bugs in
DVI2Path(latex_dvi.go), checked against the DVI format (Knuth, TeX: The Program §585):y1–y4(162–165)cmd-152= 10–13 operand bytescmd-161= 1–4fnt1–fnt4xxx1–xxx4(239–242)fntbranch), and its length wascmd-242cmd-238The
ybug desynchronises the byte stream, so any formula whose DVI usesy1fails. For example,ParseLaTeX(\matrix{a & b \cr c & d})returnsbad command: stack is empty at position 172, and so does\pmatrix.Test: a new
latex_test.go(build tag!latex, the default pure-Go path) withTestLaTeXMatrix. It fails on master with the error above and passes with the fix.go test .passes.Found while adding Markdown math to inkcap, following up on #397.