Skip to content

Commit

Permalink
Refinements & clarifications suggested by D.Ginev
Browse files Browse the repository at this point in the history
  • Loading branch information
brucemiller committed Oct 10, 2024
1 parent 1f35791 commit 76b13c3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
9 changes: 9 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
0.8.9 2024-Winter
- This release addresses a large variety of usability, fidelity, robustness,
portability and output-quality issues.
-
Incompatible changes: The API of several low-level internal functions have changed.
In the unlikely event you have used these in your own bindings, they will need to be
updated.
- LaTeXML::Core::CharDef->new($cs,$mode,$value)
- decodeMathCode($mathcode,$reversion) returns ($glyph,$font,$reversion,%mathproperties)
0.8.8 2024-02-29
- This release addresses a large variety of usability, fidelity, robustness,
portability and output-quality issues.
Expand Down
2 changes: 1 addition & 1 deletion lib/LaTeXML/Core/Definition/CharDef.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub invoke {
($local ? Tokens(T_CS('\char'), $value->revert, T_CS('\relax')) : $$self{cs})); }
else { # Else math mode, mathDecode!
my ($glyph, $f, $rev, %props) = LaTeXML::Package::decodeMathChar($nvalue);
if (!defined $props{name}) { # TEMPORARY HACK ?????
if (!defined $props{name}) { # Synthesize name attribute from CS, if needed (Clarify purpose of name!)
my $n = $self->getCSName;
$n =~ s/^\\//;
$props{name} = $n if !$props{meaning} || ($n ne $props{meaning}); }
Expand Down
5 changes: 3 additions & 2 deletions lib/LaTeXML/Engine/TeX_Math.pool.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,13 @@ DefRegister('\fam' => Number(-1),
# Add an XMWrap, adjusting the math role unless it's already a sub-class of the requested coarse TeX math classes
# Is XMWrap the right thing to wrap with (instead of XMArg)?
our %mathclass_subclass = (
BIGOP => { ARROW => 1 },
BIGOP => { ARROW => 1, SUMOP => 1, INTOP => 1, DIFFOP => 1 },
BINOP => { ADDOP => 1, MULOP => 1 },
RELOP => {},
OPEN => {},
CLOSE => {},
PUNCT => {},
PUNCT => { PERIOD => 1 },
ID => { NUMBER => 1 },
ATOM => {}, # really any role
);

Expand Down
2 changes: 1 addition & 1 deletion lib/LaTeXML/Package.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2863,7 +2863,7 @@ sub decodeMathChar {
elsif ($fontdef = LookupValue('textfont_' . $fam)) { $downsize = 2; } }
my $defn = $STATE->lookupDefinition($fontdef);
$fontinfo = $defn && $defn->isFontDef;
if ($$basefontinfo{size} != $curfont->getSize) { # If we've gotten an explicit font SIZE change; Adjust!
if ($fontinfo && ($$basefontinfo{size} != $curfont->getSize)) { # If we've gotten an explicit font SIZE change; Adjust!
$fontinfo = {%$fontinfo}; $$fontinfo{size} = $curfont->getSize; } }
my $font = $curfont->merge(%$fontinfo);
if ($downsize > 0) { $font = $curfont->merge(scripted => 1); }
Expand Down
31 changes: 13 additions & 18 deletions lib/LaTeXML/Util/Unicode.pm
Original file line number Diff line number Diff line change
Expand Up @@ -362,29 +362,24 @@ our %math_props = (

#======================================================================
UTF(0x5C) => { role => 'ADDOP', meaning => 'set-minus' }, # \backslash
UTF(0xAC) => { role => 'BIGOP', meaning => 'not' }, # \lnot
UTF(0xAC) => { role => 'BIGOP', meaning => 'not' }, # \neg, \lnot
UTF(0xAC) => { role => 'BIGOP', meaning => 'not' }, # \neg
UTF(0xB1) => { role => 'ADDOP', meaning => 'plus-or-minus' }, # \pm
UTF(0xD7) => { role => 'MULOP', meaning => 'times' }, # \times
UTF(0xF7) => { role => 'MULOP', meaning => 'divide' }, # \div

UTF(0xAC) => { role => 'BIGOP', meaning => 'not' }, # \neg,\lnot
UTF(0x5C) => { role => 'ADDOP', meaning => 'set-minus' }, # \backslash
UTF(0xB1) => { role => 'ADDOP', meaning => 'plus-or-minus' }, # \pm
UTF(0xD7) => { role => 'MULOP', meaning => 'times' }, # \times
UTF(0xF7) => { role => 'MULOP', meaning => 'divide' }, # \div
#======================================================================
"\x{2020}" => { role => 'MULOP' }, # \dagger
"\x{2021}" => { role => 'MULOP' }, # \ddagger
"\x{2032}" => { role => 'SUPOP', }, # \prime
#======================================================================
"\x{2020}" => { role => 'MULOP' }, # \dagger
"\x{2021}" => { role => 'MULOP' }, # \ddagger
"\x{2032}" => { role => 'SUPOP', }, # \prime
"\x{2061}" => { role => 'APPLYOP', name => '', reversion => '' },
"\x{2062}" => { role => 'MULOP', meaning => 'times', name => '', reversion => '' },
"\x{2063}" => { role => 'PUNCT', name => '', reversion => '' },
"\x{2064}" => { role => 'ADDOP', meaning => 'plus', name => '', reversion => '' },
"\x{210F}" => { role => 'ID', meaning => 'Planck-constant-over-2-pi' }, # \hbar
"\x{2111}" => { role => 'OPFUNCTION', meaning => 'imaginary-part' }, # \Im
"\x{2118}" => { role => 'OPFUNCTION', meaning => 'Weierstrass-p' }, # \wp
"\x{211C}" => { role => 'OPFUNCTION', meaning => 'real-part' }, # \Re
"\x{210F}" => { role => 'ID', meaning => 'Planck-constant-over-2-pi' }, # \hbar
"\x{2111}" => { role => 'OPFUNCTION', meaning => 'imaginary-part' }, # \Im
"\x{2118}" => { role => 'OPFUNCTION', meaning => 'Weierstrass-p' }, # \wp
"\x{211C}" => { role => 'OPFUNCTION', meaning => 'real-part' }, # \Re
"\x{2190}" => { role => 'ARROW' }, # \leftarrow # LEFTWARDS ARROW
"\x{2191}" => { role => 'ARROW', name => 'uparrow' }, # \uparrow # UPWARDS ARROW
"\x{2192}" => { role => 'ARROW' }, # \to, \rightarrow # RIGHTWARDS ARROW
Expand All @@ -407,7 +402,7 @@ our %math_props = (
"\x{21D0}" => { role => 'ARROW' }, # \Leftarrow # LEFTWARDS DOUBLE ARROW
"\x{21D1}" => { role => 'ARROW', name => 'Uparrow' }, # \Uparrow # UPWARDS DOUBLE ARROW
"\x{21D2}" => { role => 'ARROW' }, # \Rightarrow # RIGHTWARDS DOUBLE ARROW
"\x{21D3}" => { role => 'ARROW', name => 'Downarrow' }, # \Downarrow # DOWNWARDS DOUBLE ARROW
"\x{21D3}" => { role => 'ARROW', name => 'Downarrow' }, # \Downarrow # DOWNWARDS DOUBLE ARROW
"\x{21D4}" => { role => 'METARELOP', meaning => 'iff' }, # ,\Leftrightarrow, \iff # LEFT RIGHT DOUBLE ARROW
"\x{21D5}" => { role => 'ARROW', name => 'Updownarror' }, # \Updownarrow # UP DOWN DOUBLE ARROW
"\x{2200}" => { role => 'BIGOP', meaning => 'for-all' }, # \forall
Expand Down Expand Up @@ -533,9 +528,9 @@ our %math_props = (
"exp" => { role => 'OPFUNCTION', meaning => 'exponential' }, # \exp #
"gcd" => { role => 'OPFUNCTION', meaning => 'gcd', need_scriptpos => 1 }, # \gcd #
"hom" => { role => 'OPFUNCTION', need_scriptpos => 1 }, # \hom #
"inf" => { role => 'LIMITOP', meaning => 'infimum', need_scriptpos => 1 }, # \inf #
"ker" => { role => 'OPFUNCTION', meaning => 'kernel' }, # \ker #
"lg" => { role => 'OPFUNCTION' }, # \lg #
"inf" => { role => 'LIMITOP', meaning => 'infimum', need_scriptpos => 1 }, # \inf #
"ker" => { role => 'OPFUNCTION', meaning => 'kernel' }, # \ker #
"lg" => { role => 'OPFUNCTION' }, # \lg #
"lim" => { role => 'LIMITOP', meaning => 'limit', need_scriptpos => 1 }, # \lim #
"lim inf" => { role => 'LIMITOP', meaning => 'limit-infimum', need_scriptpos => 1 }, # \liminf #
"lim sup" => { role => 'LIMITOP', meaning => 'limit-supremum', need_scriptpos => 1 }, # \limsup #
Expand Down

0 comments on commit 76b13c3

Please sign in to comment.