From 91b5a4f60be801e896cfdfeab08ffde6025c261a Mon Sep 17 00:00:00 2001 From: Deyan Ginev Date: Fri, 13 Oct 2023 13:58:44 -0400 Subject: [PATCH] \let skips more spaces than documented (#2231) * \let skips more spaces than documented * shorthanddef also has an implied skip of multiple spaces * \font also has an implied space skip * more space skips before an optional equal sign delimiter --- lib/LaTeXML/Package/TeX.pool.ltxml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/LaTeXML/Package/TeX.pool.ltxml b/lib/LaTeXML/Package/TeX.pool.ltxml index 150b10b7d..188fd8844 100644 --- a/lib/LaTeXML/Package/TeX.pool.ltxml +++ b/lib/LaTeXML/Package/TeX.pool.ltxml @@ -1324,7 +1324,7 @@ sub lookupFontinfo { # This should eventually actually load the font metrics, # and tie-in to the FontMetrics data used by Font. -DefPrimitive('\font Token SkipMatch:= SkipSpaces TeXFileName', sub { +DefPrimitive('\font SkipSpaces Token SkipSpaces SkipMatch:= SkipSpaces TeXFileName', sub { my ($stomach, $cs, $name) = @_; my $gullet = $stomach->getGullet; $name = ToString($name); @@ -1400,7 +1400,7 @@ DefPrimitive('\divide Variable SkipKeyword:by Number', sub { # = \futurelet # | \let -DefPrimitive('\let Token SkipMatch:= Skip1Space Token', sub { +DefPrimitive('\let SkipSpaces Token SkipSpaces SkipMatch:= Skip1Space Token', sub { my ($stomach, $token1, $token2) = @_; Let($token1, $token2); return; }); @@ -1430,19 +1430,19 @@ sub shorthandDef { AfterAssignment(); return; } -DefPrimitive('\countdef Token SkipMatch:=', sub { +DefPrimitive('\countdef SkipSpaces Token SkipSpaces SkipMatch:=', sub { shorthandDef($_[0], $_[1], '\count', Number(0)); }); -DefPrimitive('\dimendef Token SkipMatch:=', sub { +DefPrimitive('\dimendef SkipSpaces Token SkipSpaces SkipMatch:=', sub { shorthandDef($_[0], $_[1], '\dimen', Dimension(0)); }); -DefPrimitive('\skipdef Token SkipMatch:=', sub { +DefPrimitive('\skipdef SkipSpaces Token SkipSpaces SkipMatch:=', sub { shorthandDef($_[0], $_[1], '\skip', Glue(0)); }); -DefPrimitive('\muskipdef Token SkipMatch:=', sub { +DefPrimitive('\muskipdef SkipSpaces Token SkipSpaces SkipMatch:=', sub { shorthandDef($_[0], $_[1], '\muskip', MuGlue(0)); }); -DefPrimitive('\toksdef Token SkipMatch:=', sub { +DefPrimitive('\toksdef SkipSpaces Token SkipSpaces SkipMatch:=', sub { shorthandDef($_[0], $_[1], '\toks', Tokens()); }); # NOTE: Get all these handled as registers @@ -1454,7 +1454,7 @@ DefPrimitive('\toksdef Token SkipMatch:=', sub { DefRegister('\lastpenalty', Number(0), readonly => 1); # \parshape !?!?? -DefPrimitive('\parshape SkipMatch:= Number', sub { +DefPrimitive('\parshape SkipSpaces SkipMatch:= Number', sub { my ($stomach, $n) = @_; $n = $n->valueOf; my $gullet = $stomach->getGullet; @@ -1847,7 +1847,7 @@ DefPrimitive('\char Number', sub { # Almost like a register (and \countdef), but different... # (including the preassignment to \relax!) -DefPrimitive('\chardef Token SkipMatch:=', sub { +DefPrimitive('\chardef Token SkipSpaces SkipMatch:=', sub { my ($stomach, $newcs) = @_; $STATE->assignMeaning($newcs, $STATE->lookupMeaning(T_CS('\relax'))); # Let w/o AfterAssignment my $value = $stomach->getGullet->readNumber(); @@ -1895,7 +1895,7 @@ DefConstructor('\delimiter Number', return; }); # Almost like a register, but different... -DefPrimitive('\mathchardef Token SkipMatch:=', sub { +DefPrimitive('\mathchardef Token SkipSpaces SkipMatch:=', sub { my ($stomach, $newcs) = @_; $STATE->assignMeaning($newcs, $STATE->lookupMeaning(T_CS('\relax'))); # Let w/o AfterAssignment my $value = $stomach->getGullet->readNumber(); @@ -1927,7 +1927,7 @@ DefConstructor('\mathaccent Number Digested', DefPrimitive('\lastbox', sub { # Hopefully, the correct box got seen! return pop(@LaTeXML::LIST); }); -DefPrimitive('\setbox Number SkipMatch:=', sub { +DefPrimitive('\setbox Number SkipSpaces SkipMatch:=', sub { my ($stomach) = @_; no warnings 'recursion'; my $box = 'box' . $_[1]->valueOf; @@ -2554,7 +2554,7 @@ DefPrimitive('\errmessage{}', sub { return; }); # TeX I/O primitives -DefPrimitive('\openin Number SkipMatch:= SkipSpaces TeXFileName', sub { +DefPrimitive('\openin Number SkipSpaces SkipMatch:= SkipSpaces TeXFileName', sub { my ($stomach, $port, $filename) = @_; # possibly should close $port if it's already been opened? $port = ToString($port); @@ -2608,7 +2608,7 @@ DefConditional('\ifeof Number', sub { # For output files, we'll write the data to a cached internal copy # rather than to the actual file system. -DefPrimitive('\openout Number SkipMatch:= SkipSpaces TeXFileName', sub { +DefPrimitive('\openout Number SkipSpaces SkipMatch:= SkipSpaces TeXFileName', sub { my ($stomach, $port, $filename) = @_; $port = ToString($port); $filename = ToString($filename);