Ok, so an equation editor is not quite as climactic as the appearance of the Great Eagles in Tolkien’s *The Return of the King*, but we’re pretty excited about getting this on the site for you to use.

It’s been about six months since we first put OpenStudy out there in its current form, and about a month since we left closed beta and let in anyone and everyone who wants to sign up. Since less than a month into the beta, we’ve heard from you that you wanted a way to put equations on our real-time studypads and questions. We’ve been refining our vision of what OpenStudy can be and what it can do to connect people in the meantime, but we didn’t forget that request, and now it’s finally here!

## Inserting Equations

From now on, whenever you want to insert an equation, you can click wherever you want it on the pad and then click on the equation button in the toolbar:

*Click the Sum symbol on the pad toolbar to insert an equation on the pad.*

Once you click on the equation button, you will get a dialog that will let you create and edit your equation:

*The equation dialog after entering an equation.*

You can type your equation directly — we’ve tried to make typing an equation as natural as possible. You can also use the input buttons on the right to insert various mathematical characters and functions. Just expand a group by clicking on it and see what is available:

*Clicking on a group in the equation dialog’s symbol toolbar expands it; above, the group containing math operators has been expanded.*

Whenever you’re done inputting your equation, you can click the close button or the X in the top right of the dialog to close the dialog. As with everything else on pads, everyone sees you develop your equation as you type.

## Editing Equations

Whenever you want to edit an equation that is already on the pad, you can click on it to bring up the equation dialog again:

*To edit an equation, click on it on the pad to bring up the equation dialog.*

You can edit an equation as many times as you want. You can also undo and redo your changes to equations while the dialog is open and once you have closed the dialog, just like your changes to anything else on the pad.

## Future Directions

We waited a while to put out an equation editor because we wanted one out there that integrated well with everything else on OpenStudy. We wanted it to work in real time, like everything else on the pad, and we wanted the interface to be straightforward to work with.

A lot of dedicated work by our designer Siddharth and his intern Alan have ensured that the equation editor looks as great as the rest of OpenStudy and works as naturally as possible.

There’s still work to be done, though, and we’ll be working on improving the equation functionality over the coming weeks and months, so keep an eye out for new improvements coming near you!

## Technical Underpinnings

For those who are interested, here’s a brief rundown of what underlies our equation functionality.

We’ve had our eye on the awesome open source library MathJax for some time. In particular, we wanted its enviable ability to take most LaTeX commands and typeset them beautifully in the browser. What we’ve built is an editor that leverages both our pads’ ability to push changes to every viewer in real time and MathJax’s beautiful math typesetting. The side-effect of this, for those who are familiar with LaTeX math notation, is that you should be able to use most of your knowledge to your advantage within our editor.

We’ve gone out of our way to make equation input natural by adding an extra layer of processing on top of LaTeX input, however. For example, most if not all LaTeX macros need not be prefixed with a backslash in the editor — they are automatically detected and the backslash is inserted on the way to MathJax’s processing. This does currently lead to some limitations. For example, the matrix environment isn’t supported — you should resort to the more antiquated matrix command from straight TeX. We’ll be fixing some of these issues soon.

Currently, the majority of our simplification work has gone into this aspect. Soon, however, we’ll be doing a few more things to improve equation input for both regular users and LaTeX power users who get to type less:

- Automatic large parentheses, brackets, etc. Instead of having to use \left(, \left[, etc, you’ll be able to just type ( and a \left will automatically be inserted.
- Smarter bracketing: we want sqrt(3x^2) to have roughly the same effect as sqrt{3x^2}.
- Easier matrices: we want (1 & 2 \ 3 & 4) to create a matrix, without having to define an entire matrix environment (though this will obviously happen in the background).
- Easier fractions: 1 / 2 will produce the equivalent of \frac{1}{2}.

We’re combining a lot of concepts for our actual implementation of equations. Pads already exist in a two-layer nested iframe context, with the outer layer containing the line numbers. Now, the outer layer also contains the rendered equations, while we’ve taken some ideas from CSS image replacement to keep the content on the pad matching what you type into the editor. The editor dialog exists in the main page, so there’s a lot of inter-iframe communication, too.

The good news is, this has let us explore the abilities of our pads in a lot more depth, and should open the doors to more tool improvements for pads on the site.

## Feedback

We’re always looking for more feedback, so let us know what you think of the new equation functionality, and the site, in the comments.

Davesaid April 25, 2012, 4:13 am:I love your equation editor: simple, elegant and very stylish – by far the best I’ve seen. Does openstudy open source?

Antonio Salazar Cardozosaid April 25, 2012, 5:35 am:Thanks! Actually we rather do want to open source our two editor components (the drawing and equation editors), but haven’t gotten a chance to extract them from our codebase yet!

Jim Masonsaid August 9, 2012, 2:35 pm:Is this open source? Are we able to download the source for your editor now?

Antonio Salazar Cardozosaid August 9, 2012, 3:05 pm:Ugh, actually, no :/ We’ve been working hard on other stuff and haven’t gotten around to this. I’ll mention it for sure though, we’ll see if we can’t put some time into open sourcing it.

Silvester Draaijersaid October 24, 2012, 3:00 pm:Dear OpenStudy,

I also wanted to know if the Equation Editor already is available as open source. It is truly an awesome editor.

Kind regards,

Silvester

Antonio Salazar Cardozosaid October 26, 2012, 12:56 am:Alas, still not. Hoping we get to it soon!