ในการเขียนบทความบนเว็บไซต์ แล้วมีการอ้างอิงสูตรทางคณิตศาสตร์ ถ้าเราต้องการนำสูตรเหล่านี้มาใส่ในหน้าเว็บ ให้แสดงผล สมการ ตัวอักษรกรีก และเครื่องหมายพิเศษต่าง ๆ ได้อย่างถูกต้อง เราจะทำได้อย่างไร

ติดตั้ง Plugin MathJax-LaTeX

เข้าไปที่หน้า Plugins / Add New แล้ว Search หา MathJax-LaTeX

กดปุ่ม Install Now

กำหนดค่า Settings ให้ Plugin MathJax-LaTeX

ไปที่ wp-admin / Settings / MathJax-LaTeX

ในช่อง MathJax Configuration ให้เลือก TeX-AMS-MML_HTMLorMML

แล้วกด Save Changes

ใช้ Short Code

สร้าง Post ใหม่แล้วใช้ Short Code [latex] formula [/latex] ดังตัวอย่างด้านล่าง

Mass–energy equivalence

[latex] E = mc^2 [/latex]

จะได้เป็น

\( E = mc^2 \)

หรือสูตรที่ซับซ้อนขึ้น

Einstein field equations

[latex]R_{\mu \nu} – \tfrac{1}{2}R g_{\mu \nu} + \Lambda g_{\mu \nu} = \frac{8 \pi G }{c^4} T_{\mu \nu}[/latex]

จะได้เป็น

\(
R_{\mu \nu} – \tfrac{1}{2}R g_{\mu \nu} + \Lambda g_{\mu \nu} = \frac{8 \pi G }{c^4} T_{\mu \nu}
\)

d’Alembert’s formula

[latex]u(x,t) = \frac{1}{2}\left[u(x-ct, 0) + u(x+ct, 0)\right] + \frac{1}{2c} \int_{x-ct}^{x+ct} u_t(\xi, 0) \, d\xi.[/latex]

จะได้เป็น

\(u(x,t) = \frac{1}{2}\left[u(x-ct, 0) + u(x+ct, 0)\right] + \frac{1}{2c} \int_{x-ct}^{x+ct} u_t(\xi, 0) \, d\xi.\)

แชร์ให้เพื่อน:

Surapong Kanoktipsatharporn on FacebookSurapong Kanoktipsatharporn on LinkedinSurapong Kanoktipsatharporn on Rss
Surapong Kanoktipsatharporn
Solutions Architect at Bua Labs
The ultimate test of your knowledge is your capacity to convey it to another.

Published by Surapong Kanoktipsatharporn

The ultimate test of your knowledge is your capacity to convey it to another.