SLaTeX for Second Life

slatex1_001.jpg

It has long been a problem that one of the biggest obstacles to doing mathematics in Second Life was the inability to write equations. Of course, there is a counter argument that this forces you to be more imaginative in finding ways to get the same ideas across and there is a huge amount to say about the benefits of being able to create complex 3D objects to get mathematical concepts across. But, there comes a point when you really need to be able to discuss equations to get the full picture.

Well, this is a problem no more with a little gadget I’ve come up with: say hello to SLaTeX! Or $S\LaTeX$ if you prefer. It’s still in an experimental stage and has a few small bugs to iron out, but it seems to be quite robust.It currently uses either mathtex, mimetex or MathJax depending on how the serverside processing is done as I play around with options… it’s a little rough and ready, but it works!

The current version allows you to type in your LaTeX source to a dedicated channel after pressing the “SLaTeX” button, or it can be set to listen on public chat for code inserted between a “\[” and a “/]” which seemed a natural way to do it. This is demonstrated in the picture below:

Until there is a finished release, you can pick up a beta version at Warwick University Maths, my workplace island in Second Life. Just right-click on it and buy for L$0. But make sure you keep checking back for updates! For the full current information notecard on the SLaTeX viewer read the rest of this post!

This is SLaTeX 0.27 – Very much in development!

(last change Ee Maculate 1st May 2009)

A simple LaTeX equation renderer for use in Second Life. The backend currently uses either Mimetex or Mathtex to render images

(http://www.forkosh.com/mathtex.html).

Setting Up:

– The SLaTeX viewer uses a parcel’s media settings so make sure that there are no other objects using media on the same parcel

– On land owned by you, rez the viewer and you’re ready to go.

– On group owned land rez the viewer and deed it to the group.

Using the viewer:

I have tried to make it as easy as possible to use, permissions depend on whether it is owned, set to group, or deeded to group. By “owner” for the rest of this notecard I mean the owner if it is not set to a group, or any member of the group if it is set or deeded to a group.

The viewer receives LaTeX formatted equations in two ways:

1 SLaTeX Button

Press the “SLaTeX” button and it waits for 30 seconds for you to enter an equation via chat on the channel given by the object’s description (default is channel 5). E.g. in the chat window type “/5 f(x)=\int_{-\infty}^x e^{-t^2}dt”.

In this time no one else can enter an equation. If you run of time press the SLaTeX button again.

You will also be shown the previous equation’s LaTeX source so you can cut, paste and edit into the chat window.

2 Eavesdropping

If eavesdropping is enabled (the button with an ear on doesn’t have a cross over it) then the viewer listens on the public chat channel 0. If it hears someone use the symbols $\verb1\[1$ and $\verb1\]1$ then it interprets what is in between as a LaTeX equation. Eg if you say the following in public chat:

“I think the equation $\mbox{\[ f(x)=\int_{-\infty}^x e^{-t^2}dt \]}$ is very interesting!”

Then the equation $f(x)=\int_{-\infty}^x e^{-t^2}dt$ will be rendered.

WARNING: listens on channel 0 can cause lag in busy sims.

Options

Zoom in and zoom out of the display using the magnifying glass buttons.

Touching the screen itself will spawn a pointer which will vanish after 3 seconds, or if another pointer is spawned. If screen locked then only person who can enter formulae can use pointer (see below).

The “refresh” button next to them resets the viewer to it’s default state (owner) or clears screen and resets zoom (anyone else).

Locking the viewer (padlock button) will only allow owner(s) to enter formulae.

Turn eavesdropping on and off (only owners can do this).

Information button will either give this notecard, or open an equation editor in the default browser… from where LaTeX can be cut and pasted into chat.

Limitations

The viewer will understand most standard LaTeX shortcuts, including arrays, but there is a size limit of 250 odd characters imposed by the viewer. Currently the equation is sent to the server as a variable to a php page, and html addresses are limited to 254 characters.

In future I may develop a more sophisticated method, as well as importing equations from an external equation editor that can be accessed from the internal browser.

I am also aware of the griefing possibilities… rude messages being left for example… I hope to implement some kind of swear filter sever side soon.

Examples

Try these examples from the Mimetex guide:

$e^x=\sum_{n=0}^\infty\frac{x^n}{n!}$

$e^x=\lim_{n\to\infty} \left(1+\frac~xn\right)^n$

$\left.\begin{eqnarray}    x+y+z&=&3\\2y&=&x+z\\2x+y&=&z\end{eqnarray}\right\}$

$\large\underbrace{\overbrace{a…a}^{\text{k a’s}},    \overbrace{b…b}^{\text{l b’s}}}_{\text{k+l elements}}$

$A\ =\ \left(\begin{array}{c.cccc}&1&2&\cdots&n\\ 1&a_{11}&a_{12}&\cdots&a_{1n}\\ 2&a_{21}&a_{22}&\cdots&a_{2n}\\\vdots&\vdots&\vdots&\ddots&\vdots\\ n&a_{n1}&a_{n2}&\cdots&a_{nn}\end{array}\right)$

Related posts:

  • Virtual Mathematics Update Following on from last term when the bulk of the discussion on web tools to disseminate mathematics happened, this term is where the individual projects are developed and produced (with a deadline for final submission over the Easter vacation). There is still a weekly seminar, but now only an hour, and primarily to discuss how ...
  • Virtual Mathematics  Recently saw the final lecture of a new and innovative module which I’ve been teaching at the University of Warwick. “Virtual Mathematics”, the main thrust of which was to discuss various ways of disseminating mathematics online. The module is technically only half way through, next term will be spent developing individual online projects which form ...
  • Second Life Maths Sculptures This post is to highlight the various sculptures scattered around the Second Life “Warwick University Maths” island, which can be accessed at this SLURL. There is always a lot of discussion over the impact of education using Virtual Worlds (usually against a backdrop of the bad publicity that always makes the tabloids), but what cannot ...
  • Ee’s SLideshow Viewer and Second Life 2.0 So, Linden Labs caught everyone by surprise and made the Beta 2.0 viewer the main release for new residents, despite there being numerous bugs that still need to be fixed. Pertinent to Ee’s SLideshow viewer are the new shared media facilities, or more precisely changes to parcel media.
  • Christmas on Warwick University Maths Island A freak snowstorm has hit the tropical Second Life island of the Warwick University Maths department (SLURL: http://tinyurl.com/56ykb2), conincidentally just in time for the Christmas break!
  • Second Life + LaTeX = SLaTeX It has long been a problem that one of the biggest obstacles to doing mathematics in Second Life was the inability to write equations. Of course, there is a counter argument that this forces you to be more imaginative in finding ways to get the same ideas across and there is a huge amount to ...

Comments are closed