Jump to content

Topic on Extension talk:SimpleMathJax

Visual Editor Integration

7
Spas.Z.Spasov (talkcontribs)

Hello, @Jmnote.

I would like to announce a modified version of Extension:SimpleMathJax which has an integration with Extension:VisualEditor and Extension:Math. It is available in this fork of the main git repository of the extension. I will be happy if this modified version is the basis for further development of the main repository.


Best regards.

Kghbln (talkcontribs)

This sounds exciting to me. Thank you for sharing this information and the link to the fork. However, I also believe that it should be in this extension rather than in a fork.

110.141.255.56 (talkcontribs)

Similar behaviour can be acheived by using both but disabling the rendering of the math extension, this won't allow the math to be rendered in the visual editor with C-S but it will atleast give the dialog menu:

# LocalSettings.php

# This is needed to get the Formula menu item in Visual Editor
wfLoadExtension( 'Math' );
# This is needed to prevent sending all equations to CDN (which can be slow)
$wgDefaultUserOptions['math'] = 'source';

## Mathjax to render LaTeX
wfLoadExtension( 'SimpleMathJax' );
$wgSmjUseCDN = false;
Uvas magicas (talkcontribs)

don't work in mediawiki 1.37

Sm8ps (talkcontribs)

Having the following in LocalSettings.php makes it work with MW-1.39:

wfLoadExtension( 'Math' ) ;
$wgDefaultUserOptions['math'] = 'source';
$wgMathDisableTexFilter = 'always' ;
wfLoadExtension( 'SimpleMathJax' ) ;
$wgSmjExtraInlineMath = [ [ "$", "$" ] ] ;

L2 sets the output mode Math to no rendering ('source'); L3 is a necessary setting for this to work. In this mode, Math will forward the Latex input without rendering, presenting it in a span-element like $ :formula $.

L5 tells SimpleMathJax to interpret text included within dollar signs as formula which it will then render.

Many thanks to user @Kghbln for sharing his idea in the above post!

Sm8ps (talkcontribs)

When doing as described above, then the configuration settings from SimpleMathJax seemingly get over-ruled in the final CSS. Add the following lines to Comon.css to change that. L6 corresponds to the parameter $wgSmjScale.

.mwe-math-fallback-source-inline {
    vertical-align: baseline;
}
mjx-math {
    font-size: 81% !important;
}
Gota de agua (talkcontribs)

the configuration don't work for chem formules

Reply to "Visual Editor Integration"