Advertisement:

Author Topic: MathJax  (Read 5075 times)

Offline digger

  • Sr. Member
  • ****
  • Posts: 761
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
MathJax
« on: February 29, 2016, 02:04:49 AM »
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:
Code: [Select]
\[ 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] с кнопками для размещения формулы между строк или в строке с обтеканием текстом.

Примеры использования:
Code: [Select]
\[ 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

Offline noisemarine

  • Newbie
  • *
  • Posts: 4
Re: MathJax
« Reply #1 on: March 11, 2016, 08:07:46 PM »
This is a really cool Mod. Thanks for making it available.  :)

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,699
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: MathJax
« Reply #2 on: March 12, 2016, 01:04:58 AM »
Is anyone else having a problem getting this to parse when clicking "preview" while posting?
« Last Edit: March 12, 2016, 02:03:03 AM by Shuban »

Offline noisemarine

  • Newbie
  • *
  • Posts: 4
Re: MathJax
« Reply #3 on: March 12, 2016, 02:05:37 AM »
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.

Offline digger

  • Sr. Member
  • ****
  • Posts: 761
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: MathJax
« Reply #4 on: April 30, 2016, 10:03:22 AM »
Is anyone else having a problem getting this to parse when clicking "preview" while posting?
Fixed in 1.4 version

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,699
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: MathJax
« Reply #5 on: May 13, 2016, 12:00:22 AM »
Still didn't preview it properly :-\

Offline gevv

  • Full Member
  • ***
  • Posts: 552
  • Gender: Male
  • ElkArte powerful forum software
    • elkarte on GitHub
    • https://www.elkarte.net/
Re: MathJax
« Reply #6 on: November 05, 2016, 04:15:09 AM »
hi,

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

Offline digger

  • Sr. Member
  • ****
  • Posts: 761
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: MathJax
« Reply #7 on: November 13, 2016, 05:51:43 PM »

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,699
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: MathJax
« Reply #8 on: October 05, 2017, 11:38:54 AM »
I'm looking at the difference between 1.3 and 1.4 and there are no differences that would suggest previews will work

Offline digger

  • Sr. Member
  • ****
  • Posts: 761
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: MathJax
« Reply #9 on: October 05, 2017, 11:44:10 AM »
I'm looking at the difference between 1.3 and 1.4 and there are no differences that would suggest previews will work
https://github.com/realdigger/SMF-MathJax/blob/7ed054b3cc34f15608cd2b86bc6bdc743dae7588/modification.xml

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,699
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: MathJax
« Reply #10 on: October 28, 2017, 12:30:33 AM »
Found the fix...

Needed to add:

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

Offline wunderbunny

  • Semi-Newbie
  • *
  • Posts: 10
MathJax CDN shut down
« Reply #11 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 [nofollow] that they have changed to a new host for their script:

So it might be necessary to change this:
Code: [Select]
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/2.7-latest/MathJax.js?config=default,Safe"></script>';
to this:
Code: [Select]
<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.

Offline digger

  • Sr. Member
  • ****
  • Posts: 761
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: MathJax CDN shut down
« Reply #12 on: November 27, 2017, 11:55:55 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:
Code: [Select]
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/2.7-latest/MathJax.js?config=default,Safe"></script>';
to this:
Code: [Select]
<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.

Offline jack001

  • Jr. Member
  • **
  • Posts: 195
  • Gender: Male
  • Edutainment Forum
    • @edutain_forum on Twitter
    • EDUTAINMENT FORUM - Education with Entertainment
Re: MathJax
« Reply #13 on: June 28, 2018, 10:39:51 AM »
I was able to install it on 2.1 beta 4. But how to uninstall it. Can't see under packages
https://www.edutainmentforum.com Edutainment forum - Education with Entertainment!