$ $…$ $

Written by Waipot on April 17, 2008 – 11:41 am

ผมกำลังทดสอบ วิธีใหม่ ในการเขียนสมการ LaTeX ของ yourequations.com ด้วย (เวลาเขียนจริงๆ $$ ต้องติดกัน) แทนการใช้ <pre lang="eq.latex">...</pre> ซึ่งจำยากและใช้งานลำบากกับพวก Visual Editor

ตัวอย่าง

This is my first equation, \inline \int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi} and the second equation, \inline c=\sqrt{a^2+b^2} .
If I have $100, I will give you $20.

Output:

This is my first equation, $$ \inline \int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi} $$ and the second equation, $$ \inline c=\sqrt{a^2+b^2} $$.
If I have $100, I will give you $20.

Dowload:
สำหรับผู้ที่ใช้ WordPress ดาวน์โหลด plugin ที่นี่ และ ผู้ที่ใช้ Blogger สามารถนำ code นี้ไปติดตั้ง

<script type="text/javascript"
 src="http://tex.yourequations.com/d/"></script>

อ่านคู่มือ http://www.yourequations.com/docs/

[Update 17/04/2008] ต้องขอขอบคุณ คุณ Top แห่ง mathcenter.net - ศูนย์กลางคณิตศาสตร์ไทย ที่แนะนำ feature นี้เข้ามา และ ให้คำปรึกษาเกี่ยวกับเรื่องนี้

ปล. นี่เป็นการทดสอบเท่านั้น ยังไม่รับประกันผลเต็ม 100%

Tags:
Posted under Computers and Software | 4 Comments »

เขียนสมการ LaTeX บนเวบ

Written by Waipot on April 12, 2008 – 10:33 pm

ช่วงนี้ที่บ้านเราคงเริ่มเล่นสงกรานต์กันแล้ว นึกถึงบรรยายที่บ้านนอกบ้านเกิดผม ป่านนี้คงรวมญาติกันเต็มบ้าน คงขาดก็แต่ผม ส่วนผมอยู่ที่ Fargo ต้องผจญกับความหนาวกันต่อไป เมื่อวานนี้เพิ่งมีพายุหิมะเข้า คิดถึงสงกรานต์อยากสาดน้ำแก้ร้อน

ผมได้เขียนวิธีการติดตั้ง jsTeXrender ระบบแสดงสมการ LaTeX บน Web ด้วยการติดตั้ง JavaScript เพียงบรรทัดเดียว ซึ่งจะทำให้เวบไซต์ต่างๆ ที่อยู่บนระบบ Blogger, WordPress, phpBB สามารถเขียนสมการ LaTeX ได้อย่างง่ายดาย อ่านวิธีการติดตั้งบนระบบต่างๆ

ถ้าคุณมีเวบ บลอก หรือ ฟอรัม บนระบบนี้ และต้องการสนทนากันผ่านสมการคณิตศาสตร์ โปรดลองติดตั้ง jsTeXrender ตัวนี้ดู ผมหวังไว้สูงสุดว่า jsTeXrender จะเป็นเครื่องมือที่เป็นประโยชน์ต่อชุมชนเวบเพื่อการศึกษา

Link: yourequations.com

Tags:
Posted under Computers and Software | 4 Comments »

สนับสนุน <code> tag - YourEquations.com

Written by Waipot on April 11, 2008 – 9:01 am

ผมเพิ่งเพิ่ม feature ใหม่เข้าไปที่ http://yourequations.com - Online JavaScript TeX/LaTeX equation render for Webs นั่น คือ การสนับสนุน <code> tag ในการเขียน คำสั่ง LaTeX บนเวบ (อ่านคู่มือ) ดังนั้นเราจะสามารถเขียน LaTeX บนเวบได้ด้วย

<pre lang="eq.latex">
 your_LaTeX_code
</pre>

– หรือ –

<code lang="eq.latex">
 your_LaTeX_code
</code>

ข้อแตกต่างระหว่างการใช้ PRE และ CODE tag คือ PRE มักจะชอบขึ้นบรรทัดใหม่ แต่ CODE ไม่เป็นเช่นนั้น ทำให้ CODE tag นี้สามารถทำงานได้ดีกับสมการแบบ inline (โดยใช้คำสั่ง \inline) ลองพิจารณาตัวอย่างต่อไปนี้

1. Using PRE tag

Source:

The equation using PRE tag, <pre lang="eq.latex">
\int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
</pre>, and here is the following text.

Output:

The equation using PRE tag,

\int_{-\infty%20}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}

, and here is the following text.

2. Using CODE tag

Source:

The equation using CODE tag, <code lang="eq.latex">
\int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
</code>, and here is the following text.

Output:

The equation using CODE tag,
\int_{-\infty%20}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
, and here is the following text.

3. Using CODE tag with \inline command

Source:

The equation using CODE tag with \inline command, <code lang="eq.latex">
\inline \int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
</code>, and here is the following text.

Output:

The equation using CODE tag with \inline command,
\inline \int_{-\infty%20}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
, and here is the following text.

ดังนั้น CODE tag นี้ทำให้เราสามารถที่จะแทรกสมการระหว่างบรรทัดได้ จึงเพิ่มความสะดวกแก่การใช้งานมากขึ้น

ปล. http://yourequations.com ใช้ jsTeXrender ซึ่งเป็นระบบการแสดงสมการบนหน้าเวบแบบใหม่ที่ผมคิดขึ้น โดยอาศัย JavaScript และ DOM ในการแปลงโค๊ด LaTeX ในหน้า HTML เวบเพจ เป็น open-source ภายใต้ GPL หากท่านสนใจสามารถร่วมกันพัฒนาได้ ที่

http://code.google.com/p/jstexrender/

Tags:
Posted under Computers and Software | No Comments »

ทดสอบ LaTeX on the Web

Written by Waipot on March 29, 2008 – 9:33 pm

ติดตั้ง code นี้

<script type=”text/javascript” src=”http://tex.yourequations.com”/>
<script type=”text/javascript” src=”http://tex.yourequations.com/”></script>

ก่อน tag

</body>

ในเวบของคุณ แล้วมันจะเปลี่ยน LaTeX code

<pre lang="eq.latex">
\int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx=\frac{22}{7}-\pi
</pre>

ให้กลายเป็น

\int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx=\frac{22}{7}-\pi

ช่างน่าทึ่งแท้ javascript บรรทัดเดียว สามารถแสดง LaTeX บนโลกออนไลน์ได้อย่างน่าอัศจรรย์ แต่ใช้ได้เฉพาะ Firefox เท่านั้น ในตอนนี้ ซึ่งมันสนับสนุนทั้ง Firefox และ IE ได้เป็นอย่างดี

Tags: , , ,
Posted under Computers and Software | No Comments »