Adding LaTeX to Notes with Ruby

February 15, 2008

I’ve finally come up with a some what novel use of ruby that is saving me a bunch of time at school, so now I’ll pass the savings on to you!

The Problem:

I want to take notes in class using my Mac. More specifically, I want to use OmniOutliner (though this method should be adaptable to any editor that can embed images). However, in more than a few computer science classes I’ve had, the mathematics get pretty heavy. And thus far summations, fractions, large equations, etc. don’t like to be typed out. They hate it. This has limited my ability to use my afore mentioned Mac as a note taking center for those classes.

So how can I still use OmniOutliner to take notes that include a large mathematical component?

The Solution:

In a word LaTeX. Let me explain.

Hopefully everyone’s familiar with LaTeX – a markup language used to format books, papers, etc. What its really good at is creating equations. The syntax is different, but not difficult, and it allows you to basically write out as complicated mathematical formula as you like in plain text. This gets converted to your actual equation using the TeX typesetting program.

I’d used LaTeX before a semester or so ago for writing up my homework for a particular class. For this, I’d installed the requisite packages via MacPorts and used the best editor of all time, TextMate, to write up the document and convert it to pdf.

But how do we add formatted LaTeX equations to a program like OmniOutliner, which doesn’t know how to parse LaTeX? Well, thats what this post is about.

conversion

More after the break.

Read the rest of this entry »

Advertisements

Control Your Subversion: Tips for Setting up Subversion on the Mac

July 4, 2006

subversion_logo_hor-468x64.pngThis is just a little post to help me remember how I got this stuff working.

Subversion is a revision control system that is being developed to replace older similar systems. Revision control lets you update your projects in an iterative fashion and allows you to keep track of these changes. This is perfect for when you have a bunch of people working on the same thing and want an easy way that everyone can work on the same stuff without stepping on other peoples toes.

I have used version control systems on a Java application we developed as a team last semester, and I plan on using it soon to develop web applications, but it really could be used for almost anything: a big proposal, documents for a conference, anything that you might work on in a step-wise fashion.

Plus, it doesn’t have to be a group project to use Subversion. You can use it as an easy backup system so you can work on your stuff from any machine and use it in case you want to revert to an earlier version of something.

They have a free book about how to use / setup Subversion, and there is a lot of info out there on how to use it.

Client

If you have the server set up, using a client to check-in and check-out projects is easy. For Windows there is a client called tortoisesvn that comes highly recommended. I guess it integrates with Windows Explorer to make things easy. For Mac you can use a precompiled command-line version (this one is the most popular and put out by Martin Ott of SubEthaEdit fame) or search for a GUI version. My favorite so far has been ZigVersion. SvnX is also recommended, but froze up when trying to connect to my server (probably because I was initially typing the location wrong).

Server

This is the tricky part. The easiest way to install it on a Mac that I’ve found is using Darwinports and this tutorial. I followed it excatly without any issues. Darwinports is so handy, everyone should have it installed by now. Then I used this section of the book to add basic authentication to my Subversion repository.

New Repository
Now to add a new repository I simply use:

sudo mkdir reposName

sudo svnadmin create –fs-type fsfs reposName

make template and import

cd ~

mkdir svn-template

cd svn-template

mkdir trunk branches tags

Import your template directory into the “reposName” repository using

svn import .http://localhost/svnrepo/reposName -m “Initial import.”

And you should be ready to go. Here’s a list of commands from the book commonly used in messing with the repository:

 

  • Update your working copy

     

    • svn update
  • Make changes

     

    • svn add
    • svn delete
    • svn copy
    • svn move
  • Examine your changes

     

    • svn status
    • svn diff
    • svn revert
  • Merge others’ changes into your working copy

     

    • svn update
    • svn resolved
  • Commit your changes

     

    • svn commit

So that brings together most of what you would need to set up a Subversion server on a Mac, and mess with it. Hope this can help somebody