We talked about LaTeX before. This Full Guide on LaTeX in WordPress Explains the Js, Self Hosted & Rendered Solutions for the Users Seeking For Math, 2D or 3D Graphs. To self host the LaTeX original package, you need minimum a virtual server or cloud server. Depending on the amount of workload, that self hosted LaTeX option can go pathetic. As it is assumed that most of the WordPress users know very less about server backend, pre-rendered WordPress Plugins actually commonly classically offered for showing LaTeX in WordPress.
LaTeX in WordPress Options : Js, Self Hosted & Rendered
By default, wordpress.com
supports LaTeX via their pre-rendering on their servers. For self-hosted wordpress.org
software users like us, JetPack Plugin enables that wordpress.com
like feature. wordpress.com
users have this official guide :
1 | https://en.support.wordpress.com/latex/ |
That is closest to what JetPack Plugin also do.
---
WP LaTeX
is the WordPress Plugin which offers 2 options – using wordpress.com
‘s LaTeX Sever or using your server’s installation of LaTeX. We are discussing it later in the separate section. Let us see the other options.
There is another plugin named WP QuickLaTeX
. This plugin pre-render on QuickLaTeX.com
‘s LaTeX server. It supports TikZ and pgfplots graphics packages. QuickLaTeX.com
is a linkware, it is free for personal and non-commercial use in exchange to backlink.
Now, among the JavaScript’s most advanced and beautiful at this moment is KaTeX. MathJax is older option. It is a separate project :
1 | https://github.com/Khan/KaTeX |
WP-KaTeX
is their plugin and KaTeX in short is a JavaScript library for TeX math rendering on the web. So, including just JavaScripts will do the trick. Its usage is limited to Math formulas. It is really beautiful, you can see their GitHub page :
1 | https://khan.github.io/KaTeX/ |
They used this as example :
1 2 3 | f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} \,d\xi |
That I can write in this way :
1 | f(x)%20=%20\int_{-\infty}^\infty\hat%20f(\xi)\,e^{2%20\pi%20i%20\xi%20x}\,d\xi |
and append in front of this URL :
1 | https://chart.googleapis.com/chart?cht=tx&chl= |
Result will be this. Just copy-paste this URL on your browser that same thing :
1 | https://chart.googleapis.com/chart?cht=tx&chl=f(x)%20=%20\int_{-\infty}^\infty\hat%20f(\xi)\,e^{2%20\pi%20i%20\xi%20x}\,d\xi |
Funny. That is old Google API which can convert the formula to image. This API is deprecated, Google Chart API can do that. However that is a different topic.
LaTeX in WordPress : Installing LaTeX Packages on Ubuntu Server for WordPress Plugin
We told you that WP LaTeX
is the WordPress Plugin which offers using your server’s installation of LaTeX. We can install with this command :
1 | sudo apt-get install texlive-latex-base texlive-latex-recommended dvipng imagemagick texlive-latex-extra texlive-science texlive-fonts-recommended texlive-fonts-extra |
That combo thing I got from here by deduction :
1 | http://www.tug.org/texlive/ |
Be careful about self hosting LaTeX packages. Server needs good RAM and CPU.