News

SMF - Neu installiert!

LaTeX rendering via MathJax

admin · 8375

admin

  • Administrator
  • Neuling
  • *****
    • Posts: 9
    • View Profile
    • CogNovo Network
on: 13. October 2018, 12:17:43
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


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

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

\[  E=mc^2  \]
Some text before \(  E=mc^2  \) some text after

Here is Bayes' theorem theorem:
Code: [Select]
[latex]{\displaystyle P(A\mid B)={\frac {P(B\mid A)\,P(A)}{P(B)}},}[/latex]
\[ {\displaystyle P(A\mid B)={\frac {P(B\mid A)\,P(A)}{P(B)}},} \]

...and a more complex example - Bayes' theorem applied to drug testing:

Code: [Select]
[latex]{\displaystyle {\begin{aligned}P({\text{User}}\mid {\text{+}})&={\frac {P({\text{+}}\mid {\text{User}})P({\text{User}})}{P(+)}}\\&={\frac {P({\text{+}}\mid {\text{User}})P({\text{User}})}{P({\text{+}}\mid {\text{User}})P({\text{User}})+P({\text{+}}\mid {\text{Non-user}})P({\text{Non-user}})}}\\[8pt]&={\frac {0.99\times 0.005}{0.99\times 0.005+0.01\times 0.995}}\\[8pt]&\approx 33.2\%\end{aligned}}}
[/latex]

\[ {\displaystyle {\begin{aligned}P({\text{User}}\mid {\text{+}})&={\frac {P({\text{+}}\mid {\text{User}})P({\text{User}})}{P(+)}}\\&={\frac {P({\text{+}}\mid {\text{User}})P({\text{User}})}{P({\text{+}}\mid {\text{User}})P({\text{User}})+P({\text{+}}\mid {\text{Non-user}})P({\text{Non-user}})}}\\[8pt]&={\frac {0.99\times 0.005}{0.99\times 0.005+0.01\times 0.995}}\\[8pt]&\approx 33.2\%\end{aligned}}}
 \]

Features of MathJax JavaScript-based LaTeX rendering

High-quality typography.
MathJaxTM uses modern CSS and web fonts, instead of equation images or Flash, so equations scale with surrounding text at all zoom levels. See how this works in the scaling math demo.

Works in all modern browsers.
This allows the math in your content to be seen clearly by virtually all readers, even those using smart phones. See supported browsers.

Simple integration.
Using MathJax with blogs, wikis, web pages and other web apps is easy. Learn more about installing MathJax with popular platforms like WordPress, MediaWiki, Drupal, and more.

Copy and paste math.

Let readers copy equations from your web pages into Word and LaTeX documents, science blogs, research wikis, calculation software like Maple, Mathematica and more. Watch the copy and paste demo.

A rich API.
Allows developers to create interactive course materials, advanced authoring tools, and math-enabled web apps. Learn how more about programming with MathJax.

Accessible math.
MathJax is compatible with screenreaders used by people with vision disabilities, and the Zoom feature allows all readers to see small details like scripts, primes and hats. See how to make your math accessible.
« Last Edit: 13. October 2018, 12:45:05 by admin »