Ramblings of a math and CS teacher

April 7, 2008

Typesetting Math in Wikispaces and WordPress

Filed under: Math, Technology — danschellenberg @ 10:08 pm

One difficulty I have had as a math teacher using the internet a lot is that typesetting math is frustrating. This is especially true when students begin typing math, as you have to teach them a whole new math notation; ^ means exponent, ** is also exponent, etc. It’s just messy.

There are a few tools available to make things better. If you are using a word processor, such as Microsoft Word, there is usually a built in math equation editor that allows you to typeset equations quite nicely. If you memorize the shortcut keys (such as Cmd-F for a fraction, Cmd-H for exponent, etc.), you can actually type math at a respectable speed. If you, or your school, are willing to put out some cash (~$60), you can also buy the big brother version of equation editor called MathType. Another option is to use LaTeX, which is a professional typesetting language, though it is a steep learning curve, and more work than it’s worth for many teachers.

It may not be immediately obvious how this relates to typesetting math on the web. As it turns out, some web services allow the use of LaTeX math equations. Here on wikispaces, you can use LaTeX to typeset something that isn’t normally fun to type, like:
\lim_{x\to\infty}f(x)=0

Or perhaps a basic fraction, like this:

\frac{a+2}{b+4}

The LaTeX code for these isn’t a lot of fun — it looks like this:

\lim_{x\to\infty}f(x)=0

and this:

\frac{a+2}{b+4}

Who wants to memorize how to do that, anyhow? (Full disclosure: at one point, I did actually memorize this…) So, rather than writing LaTeX code directly, you have two options:

- if you own MathType, simply change the Export settings to LaTeX. Then, select the part of the equation you’d like to use and copy and paste it into wikispaces. Instead of copying an image, you are now copying the LaTeX code.

- if you don’t own MathType, and are working on a Windows machine, you can use TexAide. It’s freeware, from the same company that makes MathType, and it lets you type your math, then simply copy and paste it as LaTeX code. It’s really handy, especially since it uses the same engine as MathType, so all the same keyboard shortcuts work, just like Equation Editor.

If you are on a Mac, the only really nice way I’ve found to easily generate LaTeX code is through the full version of MathType. If anyone knows of a nice, free solution, please do share.

How to embed the math into your website of choice will depend entirely on which site you are using. On Wikispaces, the first equation above is simply surrounded by math tags. It therefore looks like:

[[math]]
\lim_{x\to\infty}f(x)=0
[[math]]

On WordPress.com, you will need to surround the LaTeX code with $ symbols, and declare the code to be LaTeX. The same equation from above would therefore be:

latex \lim_{x\to\infty}f(x)=0  (should have $ on either end of that)

Hopefully someone else finds this useful.

Cross-posted to the T4L wiki at http://t4tl.wikispaces.com/Typesetting+Math+in+Wikispaces

7 Comments »

  1. Thanks! I have always thought there must be a better way to type exponents and fractions than using the insert symbol function.

    Comment by lgatzke — April 8, 2008 @ 7:00 am

  2. Not sure how powerful it is, but http://www.sitmo.com/latex/might be of interest too.

    Comment by Scott Leslie — April 8, 2008 @ 9:38 am

  3. Dan, you make some good points. I’d like to point out something that will enhance the use of LaTeX in WordPress & Wikispaces blogs. I’m using MathType 6 in a Windows XP environment, and I can select your fraction in the post above (or the matrix in the companion post on Wikispaces), copy it, then paste it into MathType and use this expression anywhere I can use MathType (such as in a Word document, a PowerPoint presentation, or an InDesign layout). The key to this is that the equation image have LaTeX alt text attached to it. This is the case for WordPress blogs (with the proper plugin or hosting site), Wikispaces, and others. Currently this is a Windows-only feature for MathType, but since you’re a Mac guy you’d be interested to know we’re well on-track to the release of MathType 6 for Macintosh, which should be in the July timeframe this year.

    This feature works not only on WordPress & Wikispaces blogs, but on any site that utilizes LaTeX alt text for equation images. Wikipedia and PlanetMath are two websites in this category. For more information on this feature, see our Application Note Using MathType with Moodle.

    (Oh, and don’t try Cmd+H under OS X if you want a superscript. That will hide your window. Try Cmd+E.)

    Bob Mathews
    Design Science, Inc.

    Comment by afwings — April 8, 2008 @ 10:37 am

  4. One way to learn LaTeX from the absolute beginning and completely alone is to use Scientific Word as I did.

    It uses palettes of symbols like Math Type or shortcuts as well. Then generates a DVI file or in the latest versions a pdf file too. How to use it to produce automatically the appropriate code to use in a web site is a question I do not know how to answer.

    I currently use the method indicated above for WordPress ( latex my-LaTeX-code and initial and final $) in my blog.

    This feature was the main reason to locate my blog at wordpress.com.

    Please excuse any errors in my English.

    Comment by Américo Tavares — April 8, 2008 @ 6:10 pm

  5. Ummmmm. O.K. Sheesh.

    Comment by Shaun Loeppky — April 9, 2008 @ 11:28 am

  6. [...] typesetting math in wikispaces is better than many places on the web, but the lack of inline equations is still frustrating (ie. an equation needs to be on its own line) [...]

    Pingback by ECI 831 Reflections « Ramblings of a math and CS teacher — April 9, 2008 @ 5:10 pm

  7. [...] Typesetting Math in Wikispaces and WordPress « Ramblings of a math and CS teacher [...]

    Pingback by Mathematik-Schule online » Blog Archive » Mathematische Fundstellen 07/29/2008 (a.m.) — July 28, 2008 @ 9:32 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.