Mori Math

Tags ( | )

Mori Math is a plugin for Mori that renders LaTeX math in your documents. It depends on having TeX installed. It's designed to support several possible teTeX installations, but the plugin needs only know where pdflatex is. You can set this path in the Mori Math preference pane. If you don't have teTeX installed, I recommend the TeX i-Package found at http://ii2.sourceforge.net/tex-index.html (the default pdflatex path is for this).

To install Mori Math, copy or move Mori Math.plugin to ~/Library/Application Support/Mori/Plugins or simply drag Mori Math.plugin onto Mori. Then restart Mori and the plugin will be installed.

Mori Math can be used in three ways. You can type LaTeX math, select the text, and then choose the Render Math item from the Math submenu of the Text menu. Or, to avoid selecting text, you can prefix your math with a dollar sign, $. When you reach the end of your math, choose the Render Math menu item or use its keyboard shortcut, Command-/, to render all the math between the typing cursor position and the previous $. Finally, you can brace all your math with $ and then choose Render All Math to render all the math between dollarsigns. Note that you can't have '\$' render using the autoselect feature; the plugin will catch that $ and render the math after it.

If you type something that LaTeX doesn't understand or contains an error, that text will be replace with "the math you typed" in red. Just fix your error and rerender it.

If you need to retrieve the LaTeX you typed to produce a rendered equation, such as to change an equation, select that math and choose Unrender Math from the Math submenu of the Text menu. You can also choose Unrender All Math to unrender all the math in the entry.

Release Notes

Initial Release

Renders and unrenders math.

Release 2

Added ability to render all math and unrender all math in a document. Fixed bugs with rendering and unrendering more than one equation at a time via multiple selection. Added preferences to set the path to pdflatex and modify the LaTeX templet used to render math. Moved menu items under the Math menu. No longer unrenders non-math attachments.

If you are upgrading from the initial release, note that release 2 is partially incompatible. Your rendered math will, of course, still display properly, but you will not be able to unrender math created by the initial release. Similarly, math rendered by release 2 cannot be unrendered by the initial release. This was necessary to make Mori Math not unrender attachments that are not math (at least as far as Mori Math knows).

Release 3

Updated to a Mori 1.2 plugin (not compatible with earlier versions of Mori). Compiled as a Universal Binary. Added options to add $ markers around math when individual math images are unrendered.

Release 3a

Added warning if equation is longer than 255 characters long because it may cause problems when exporting entries.

For more information, visit the official Mori Math page.

Version: 3a
AttachmentSize
Mori Math Sources.zip61.69 KB
Mori Math 3a.zip45.33 KB

The first official plugin,

The first official plugin, nice work and thanks! I'll do a little write-up and make a front page post and drive our millions of users this way :)

Just a quick note, you can also install plugins by just dragging and dropping the plugin on Mori's application icon. The same thing will happen, plugin copied to ~/Library/Application Support/Mori/Plugins, but it's a little easier.

Thanks. I'll use those

Thanks. I'll use those install instructions in the next release or the next plugin I release, whichever might happen first (not that I know what that next plugin might be; folder actions :-))

If you decide to tackle this

If you decide to tackle this first take a look at the MIEntryDataKeywordFolderDelegate. It's not being compiled into the sources now, and might be a bit out of date, but it's one approach that you could take when implementing folder actions. It sort of a hard coded folder action that sets a keyword on any entries that are dropped onto it, and then queries entries based on that attributed.

You might also wait a bit to start this. Once I get the new column stuff working (still a while out) I'll probably add another extension point that allows a single plugin to get notified of all changes that happen in the outline (attribute changes, and tree structure changes) and that might be an easier place to implement folder action type behavior.

Thanks for the info,

Thanks for the info, although for the time being I think I'm going to work on adding features to Mori Math. I have a road-map out to release 4, and it's going to extend more places in the blocks framework (adding a preference pane, for example), so this should provide an even better plugin example.

I think doing folder actions should be relatively simple. I just want to call an AppleScript script when the contents of the folder changes, sending the name of the changed folder. So the code will look something like:


on changed contents of Mori folder [folder name]
  --do something interesting with entry [folder name]
end on changed Mori folder

Also supporting other kinds of changes would be good, including a generic on changed entry [entry name] responder; it just depends on what people need.

Thanks for the plugin. I was

Thanks for the plugin. I was wondering if you could post the xcode project too (source code) so that we would have another example of how to build a plugin.

Thanks,
Jeff

Yes, I intend to do that in

Yes, I intend to do that in the near future, I just haven't gotten a chance to yet. Probably sometime tomorrow.

Source code posted both here

Source code posted both here and on my Website.

Thanks, I'll take a look

Thanks,
I'll take a look this weekend.

Jeff

Release 2 has some important

Release 2 has some important bug fixes, but note that its not backwards compatible with the initial release. I had to do this because when I first created Mori Math I forgot that there might be attachments in entries other than math.

Nice. I'm glad to see you

Nice. I'm glad to see you were able to add a preferences pane. I hope that wasn't too hard, that part of the Blocks api seems pretty good to me, as opposed to the menu stuff.

Yeah, the preference pane

Yeah, the preference pane was really easy. Easier than writing a preference window for a stand-alone application.

Not loaded

Mori 1.2 beta & Mori Math 2.0, Mac OS X 10.4.6

The Mori Math Plugin is installed into ~/Library/Application Support/Mori/Plugins.
But there is Render Math in the Text menu. In the preference pane of Mori,
it showed that the plugins is not loaded.

Should I buy the lisence before evaluation of this plugin?

Try the Mori Math 3.0

Try the Mori Math 3.0 pre-release; it's made to work with Mori 1.2 beta.

http://www.hogbaysoftware.com/node/837

WorkingCorrectly

Thank you.

I could evaluate Mori 1.2 beta & Mori math 3.0
before the registration and find that they are good.

Thank you again.

Release 3

The new release is essentially just an update to work with Mori 1.2, but it adds the new feature of letting you specify whether or not to place $ before and after a single piece of unrendered math (unrender all math always places $ around the math). I added this in response to my own use; I find it easier to correct mistakes with just the opening $ present.

Really, really nice plugin.

Only thing I miss is that the standard path to pdflatex should be set matching the cpu platform (/usr/local/teTeX/bin/apple-powerpc-darwin-current/pdflatex or /usr/local/teTeX/bin/i386-apple-darwin-current/pdflatex).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.