mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-12 01:08:55 +00:00
Render MathML for tripledash and ..arrows cmds from texfified mhchem
* already these are as mhchem macros in mappings, tbd adapt Bug: T340024 Change-Id: Ic604720c71de720b6959159cfd78d6b55fdf399d
This commit is contained in:
parent
ead9760e1f
commit
3c196ba389
|
@ -755,7 +755,7 @@ class BaseMappings {
|
|||
],
|
||||
"tripledash" => [
|
||||
'macro',
|
||||
'\\vphantom{-}\\raise2mu{\\kern2mu\\tiny\\text{-}\\kern1mu\\text{-}\\kern1mu\\text{-}\\kern2mu}'
|
||||
'\\vphantom{-}\\raise{2mu}\\\kern{2mu}\\tiny\\text{-}\\kern{1mu}\\text{-}\\kern{1mu}\\text{-}\\kern{2mu}}'
|
||||
],
|
||||
"xleftrightarrow" => [ 'xArrow', 0x2194, 6, 6 ],
|
||||
"xrightleftharpoons" => [ 'xArrow', 0x21CC, 5, 7 ],
|
||||
|
|
|
@ -46,6 +46,9 @@ class BaseMethods {
|
|||
$resFct = BaseMappings::getSpecialByKey( $input );
|
||||
if ( $resFct == null ) {
|
||||
$resFct = BaseMappings::getCancelByKey( $input );
|
||||
if ( $resFct == null ) {
|
||||
$resFct = BaseMappings::getMhChemByKey( $input );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ use MediaWiki\Extension\Math\TexVC\Nodes\Fun2sq;
|
|||
use MediaWiki\Extension\Math\TexVC\Nodes\Literal;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\TexArray;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\TexNode;
|
||||
use MediaWiki\Extension\Math\TexVC\TexVC;
|
||||
|
||||
/**
|
||||
* Parsing functions for specific recognized mappings.
|
||||
|
@ -358,7 +359,8 @@ class BaseParsing {
|
|||
// Prevent parsing in unmapped cases
|
||||
return null;
|
||||
}
|
||||
if ( $name == "mskip" || $name == "mkern" ) {
|
||||
// Added kern j4t
|
||||
if ( $name == "mskip" || $name == "mkern" || "kern" ) {
|
||||
$args = [ "width" => $em ];
|
||||
} else {
|
||||
return null;
|
||||
|
@ -483,6 +485,15 @@ class BaseParsing {
|
|||
$mo = new MMLmo();
|
||||
return $mstyle->encapsulateRaw( $mspace->getEmpty() ) . $mo->encapsulateRaw( "⟺" ) .
|
||||
$mstyle->encapsulateRaw( $mspace->getEmpty() );
|
||||
case "tripledash":
|
||||
print( "abc" );
|
||||
$texvc = new TexVC();
|
||||
$warnings = [];
|
||||
$macro = "\\vphantom{-}\\raise{2mu}";
|
||||
$checkRes = $texvc->check( $macro, [ "usemhchem" => true, "usemhchemtexified" => true ],
|
||||
$warnings, true );
|
||||
print( "res" );
|
||||
|
||||
}
|
||||
|
||||
// Removed all token based parsing, since macro resolution for the supported macros can be hardcoded in php
|
||||
|
|
|
@ -1215,6 +1215,10 @@
|
|||
"\\ker": {
|
||||
"latex_function_names": true
|
||||
},
|
||||
"\\kern": {
|
||||
"fun_ar1": true,
|
||||
"mhchemtexified_required": true
|
||||
},
|
||||
"\\koppa": {
|
||||
"nullary_macro_in_mbox": true,
|
||||
"teubner_required": true
|
||||
|
|
Loading…
Reference in a new issue