• Welcome to Simple Machines Community Forum. Please login or sign up.
October 15, 2021, 04:27:51 PM

News:

Join the Facebook Fan Page.


MathJax

Started by digger, February 29, 2016, 02:04:49 AM

Previous topic - Next topic

digger

Link to Mod



This mod integrates the MathJax library into SMF forum. MathJax is the modern JavaScript-based LaTeX rendering solution for the Internet. Mod uses the MathJax CDN. The CDN will automatically arrange for your readers to download MathJax files from a fast, nearby server. And since bug fixes and patches are deployed to the CDN as soon as they become available, your pages will always be up to date with the latest browser and devices. https://www.mathjax.org

This mod is licensed under GPLv3 license.

Mod adds new bbcode [latex] with buttons for standard and inline placing.

Some examples:
\[ E=mc^2 \]
[latex] E=mc^2 [/latex]
Some text before [latex=inline] E=mc^2 [/latex] some text after


GitHub repository: https://github.com/realdigger/SMF-MathJax-Mod

Changelog:
1.4.3
Fix quick modify update issue for SMF 2.1.

1.4.2
Fix quick modify update issue. Change MathJax link to 2.7.2 version.

1.4.1
Change MathJax script url from cdn.mathjax.org to cdnjs.cloudflare.com. We recommend to update mod as soon as possible.

1.4
Fix message preview
Add support for SMF 2.1



Этот мод интегрирует библиотеку MathJax в SMF. MathJax это современное решение для рендеринга формул LaTeXis посредством JS в браузерах. Мод загружает библиотеку из официальной CDN разработчиков, так что у вас всегда будет самая актуальная версия с последними обновлениями и исправлениями. https://www.mathjax.org

Этот мод распространяется под лицензией GPLv3.

Мод добавляет новый бб-код [latex] с кнопками для размещения формулы между строк или в строке с обтеканием текстом.

Примеры использования:
\[ E=mc^2 \]
[latex] E=mc^2 [/latex]
Some text before [latex=inline] E=mc^2 [/latex] some text after


GitHub репо: https://github.com/realdigger/SMF-MathJax-Mod

История:
1.4.3
Исправлено обновление при быстром редактировании для SMF 2.1.

1.4.2
Исправлено обновление при быстром редактировании. Скрипт обновлен до версии 2.7.2.

1.4.1
Адрес загрузки скрипта изменен с cdn.mathjax.org на cdnjs.cloudflare.com. Рекомендуется обновить мод как можно скорее.

1.4
Исправлено отображение формул в предварительном просмотре
Добавлена поддержка SMF 2.1

noisemarine

This is a really cool Mod. Thanks for making it available.  :)

Biology Forums

March 12, 2016, 01:04:58 AM #2 Last Edit: March 12, 2016, 02:03:03 AM by Shuban
Is anyone else having a problem getting this to parse when clicking "preview" while posting?

noisemarine

I couldn't get it to preview, either. Thought it wasn't working.  :o

Still, I hit hxxp:en.wikibooks.org/wiki/LaTeX/Mathematics [nonactive] to brush up on LaTeX and it works fine.

digger

Quote from: Shuban on March 12, 2016, 01:04:58 AM
Is anyone else having a problem getting this to parse when clicking "preview" while posting?
Fixed in 1.4 version

Biology Forums

Still didn't preview it properly :-\

gevv

hi,

How can i disable text-align: center;
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/


Biology Forums

I'm looking at the difference between 1.3 and 1.4 and there are no differences that would suggest previews will work

digger


Biology Forums

Found the fix...

Needed to add:

<script type="text/x-mathjax-config">
window.setInterval(loadPreview, 100);
function loadPreview(){MathJax.Hub.Queue(["Typeset",MathJax.Hub]);}
</script>

wunderbunny

Hello digger, thank you very much for providing this mod.

I noticed on the MathJax web site [nofollow] that they have changed to a new host for their script:

So it might be necessary to change this:
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/2.7-latest/MathJax.js?config=default,Safe"></script>';

to this:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js??config=default,Safe"></script>';

I included the "https:" so that I could avoid having mixed content on my site.

digger

Quote from: wunderbunny on November 27, 2017, 11:51:09 AM
Hello digger, thank you very much for providing this mod.

I noticed on the MathJax web site that they have changed to a new host for their script:

So it might be necessary to change this:
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/2.7-latest/MathJax.js?config=default,Safe"></script>';

to this:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js??config=default,Safe"></script>';

I included the "https:" so that I could avoid having mixed content on my site.
Thanks for this report. Will change cdn host ASAP.

jack001

I was able to install it on 2.1 beta 4. But how to uninstall it. Can't see under packages
https://www.edufor.xyz Edutainment forum - Education with Entertainment!

Advertisement: