engine: assignments and stretch carry no maths - #173
Merged
Conversation
Three families reached the maths layer as unknown commands, and an unknown command
costs the WHOLE formula:
- \setlength{\len}{dim} is \def\setlength#1#2{#1 #2\relax} (latex.ltx:7347), an
assignment with two arguments — \addtolength beside it (:7348);
- \hfil and its kin are \hskip with a fixed glue:
primitive("hfil",hskip,fil_code) with fil_glue = 0pt plus 1fil (tex.web:20547,
§3318), so they take no argument at all. The maths layer cannot stretch, so what
they contribute here is nothing;
- \leftskip and the other glue PARAMETERS are assignments that read a <glue>
(tex.web §224), with TeX's optional equals before it, which scanMathGlue now
accepts.
Measured over 200 arXiv papers and 200 beamer talks: 11 documents change and 3
repaginate for +1290 glyphs; the page error against the 157 tectonic renders falls
656 -> 655. beamer gains 17 glyphs on one talk.
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 families reached the maths layer as unknown commands, and an unknown command costs the whole formula.
\setlength{\len}{dim}\def\setlength#1#2{#1 #2\relax}latex.ltx:7347\hfil\hfill\hss\hfilneg(and the v-forms)\hskipwith a fixed glue, so no argumentprimitive("hfil",hskip,fil_code),fil_glue = 0pt plus 1fil— tex.web:20547, §3318\leftskip\parskip\baselineskip…<glue>The maths layer cannot stretch, so what
\hfillcontributes inside a formula is nothing — and the glue parameters take TeX's optional equals, whichscanMathGluenow accepts (\leftskip=0ptas well as\leftskip 0pt).Measured — 200 arXiv papers, 200 beamer talks
11 documents change and 3 repaginate for +1290 glyphs; the page error against the 157 tectonic renders falls 656 → 655. beamer gains 17 glyphs on one talk.
Test
mathskips_test.go: eight shapes —\hfill,\hss,\vfil,\setlength,\addtolength,\leftskip=0pt,\leftskip 0pt,\parskip\medskipamount— must each leave the maths layer with nothing to drop. All eight fail onmain.