ShareLaTeX: Collaborative LaTeX editing with style

For anyone who is a fan of \LaTeX, there is a great site, ShareLaTeX, that allows editing of LaTeX files via the browser. Never used \LaTeX? Well, it’s a rich typesetting system that among other things, allows for pretty printing of mathematics, like this: P(A|B) = \frac{P(B|A)P(A)}{P(B)}. (Bayes’ theorem has been on my mind a lot lately…).

Ok, that looks cool, but why would one anyone use this? Well, you might have to if you are a grad student. 😉 The \LaTeX learning curve can be quite steep, since it’s a completely different philosophy to editing documents than the “Microsoft Word” way. It is not a WYSIWYG system. Similar to how one compiles source code, \LaTeX documents are compiled into pdfs, dvis, etc…

ShareLaTeX closes the write / compile / view loop and has a nice side-by-side edit and view display. In the spirit of Bret Victor’s life principle that creator’s need an immediate connection, ShareLaTeX allows for instant feedback with the typesetting process.

Lastly, they just incorporated some pretty advanced features. Their blog has the latest news, but latexdiff looks especially cool.

latexdiff in action
Wow! Let’s see Word do this! :p

If you are an Emacs/ AUCTeX user there is still a good use case for shareLaTeX.  Until you get Emacs on your Chromebook, you’ll need an online \LaTeX editor. 😉  And they even support Emacs key bindings! (and also cough vi cough)


Ich liebe Freie Software

Today’s title is a tip of the hat to the Free Software Foundation Europe (FSFE), which celebrates “I love Free Software Day” each Valentine’s Day.

I love Free Software!
…and everybody loves ASCII art 🙂

Much of the software I use on a daily basis is free software, including Emacs which I’m using to compose this post and WordPress, the software running this blog. Free software lives on as a result of dedicated volunteers all over the world. Without them, I would not be enjoying Emacs on my Chromebook!

Lots of other people love free software too. So show your support for free software today. But if you have spouse, partner, significant other, or whatever, you may want to wish them Happy Valentine’s Day first. Don’t worry, free software will understand…

My personal emacs doctor was not as supportive as I would have thought.  Maybe she's just maintaining a professional boundary...
My personal emacs doctor was not as supportive as I would have thought. Maybe she’s just maintaining a professional boundary…

Emacs24 in ChrUbuntu on Samsung ARM Chromebook

All good things happen while procrastinating… In this case I now have emacs24 running in ChrUbuntu on my Chromebook!

Emacs 24 on the ARM chromebook
Emacs 24 on the ARM chromebook under ChrUbuntu

Here’s what I did:

  1. Make sure to run apt-get update and refresh all of your packages.
  2. I used the update manager gui to update a ton of packages.
  3. Download the emacs 24 source: emacs-24.2.tar.gz
  4. There are a few other packages missing, which I learned through multiple configure grumblings. But this line should get you all the required dependencies: sudo apt-get install libgtk2.0-dev libjpeg-dev libxpm-dev libgif-dev libtiff-dev libncurses-dev
  5. Then fire off the normal build steps of: configure; make; sudo make install

Enjoy 🙂

The first configure error I ran into
The first configure error I ran into

Ubuntu is just a keypress away with crouton

Last weekend I tried another Ubuntu approach on my Samsung Chromebook. On the same blog where I found the ChrUbuntu trackpad fix, Craig provides instructions on how to run crouton. What’s crouton: it’s a ‘Chromium OS Ubuntu Chroot Environment’ originally found here.

The advantage of this method over the dual-boot method is that dual booting is not required! Instead, one can install linux to an SD card, launch X, and then switch between ChromeOS and Ubuntu with Ctrl-Alt-Shift-Back. And if you can master this key chord, Emacs commands are just one step away :p

So, I followed Craig’s instructions and setup XFCE as my window manager. However, I am still going to keep ChrUbuntu and my dual-boot for the time being. First let’s look at what’s cool about crouton:

  1. Swap between ChromeOS and Ubuntu without rebooting.
  2. apt-get install emacs works and installs emacs23 no problem. (I haven’t figured out how to get emacs24 on this device yet…)
  3. Ubuntu and ChromeOS can share files together by mounting your ChromeOS directory into the Ubuntu chroot environment. (See bottom of this post)

Here’s what didn’t work for me:

  1. I did not like XFCE. It was my first experience with this window manager and I had a few issues that I could not easily fix: the resolution was set too high and I could not seem to change it and I could not switch the super key to ctrl in XFCE. Using ctrl on the home row is a blessing and curse. It is SO NICE to use that nice big button for something useful besides caps lock, but on the other hand, it drives me bonkers to type on the default keymap… ARGH!
  2. Something odd was going on with my SD card. After a reboot, all that was visible was “lost and found.” So, I just reformatted my card back to its regular self.

I may try this experiment again, but I might pick KDE as the target not xfce. But since I already have the dual-boot setup, there is not much motivation for me to change at this moment. If you don’t have Ubuntu running at all on your Chromebook, it may be better to start with the crouton approach since you don’t have to re-partition your internal drive at all.

Creeping Emacs: Imma (Bitl)bee

In the continuing progression of Emacs taking over my life, I’ve found another service that can be replaced by Emacs: Google Talk!

For the rest of the world out there that has been using this for the last three years, please excuse my late discovery. Lately I’ve been lurking on the #emacs channel on freenode, keeping tabs on the conversation stream in the background. I was using Colloquy at first, which is a nice graphical IRC client on the mac, but I switched to ERC, an IRC client inside Emacs, and I was very impressed with how nicely it has integrated inside Emacs. Continue reading “Creeping Emacs: Imma (Bitl)bee”

Hello world from ChrUbuntu!

After following these instructions, my Chromebook is now running ChrUbuntu!  The install is fairly painless and the instructions worked for me without any modifications.  It took about 15 minutes for my Chromebook to switch into “developer mode,” but after running the script and a few reboots later, I can dual-boot into Linux!

Emacs on chrubuntu with some disk usage stats in the corner.
Emacs on ChrUbuntu with some disk usage stats in the corner.

Thanks to the great work over at that blog and to this motivated reader for posting some awesome links to some Linux on the Chromebook material!  At the moment, I just have the vanilla ChrUbuntu sources but per the comments there seems to be active community members trying to fix various issues.  Most notable is that the touchpad is less responsive than in ChromeOS… [Update 21JAN13: I’ve post a script to fix this issue here]

While I don’t support Canonical decision to leave in its surveillance search feature, ChrUbuntu seemed the easiest Linux distro to get up and running right now.  Plus, ChrUbuntu is based from Ubuntu 12.04 and I don’t think Canonical’s search appeared until 12.10.  Thankfully, thanks to the diligent work from the EFF (this is a great organization, I just re-upped my membership), they have a post on how to remove this “feature.”

My first apt-get was for Emacs of course, in which I’m happily typing away.  The Chromebook’s “search” key acts like a “super” key (Windows key) in ChrUbuntu so I found this post which shows how to switch it.  Once you get used to the ctrl key located to the left of the “a” key, it’s very hard to switch back…  I tried to get emacs24 but there were some issues.  For some reason, I couldn’t add the ppa for emacs24 to apt-get and when I tried to build by source there were a lot of missing depends on x-windows and various ncurses libraries.  So, I decided not to push it too far right now and be content with emacs 23 (which installed with apt-get just fine).

If you plan on using the Chromebook as a pure consumption device or if you never heard of Linux(?!) than ChromeOS may be fine for you.  But actually, if that’s the case, a tablet may be better because you probably don’t need a keyboard.  Otherwise, if you want to do *anything* else, try ChrUbuntu.  Firefox is the default browser, but it may be possible to install Chromium if you really want.  And if you have never tried Linux, the Chromebook is a well priced laptop, with which you can experiment.  Just be sure to understand what’s working and not before you make the plunge.

Feeding Pythons

In these last few weeks, I’ve been working in a slew of programming languages. My OS course involves hacking around in the Linux kernel, so that’s in C. The projects in my AI course have been in Lisp, Java and the next one is in Prolog. At work, I mainly dabble in C++, but I’ve been helping with some continuous integration scripts in Perl and Python.

Out of all these languages, I think Lisp has permanently changed the way I think about programming. Unfortunately, it didn’t really click until after I submitted my project… After working a bit in Lisp and then going back to other imperative languages I found myself thinking of a Lisp-like solution and then realizing, “oh, this is was a lot easier in Lisp!” For example, trying to pass functions as parameters is very easy in Lisp since functions are first-class objects, but to do this in C one has defined a function pointer, which has very specific type definitions and some messy syntax, etc…

So, that led me to find this Google Tech Talk by Peter Seibel on “Practical Common Lisp.” This lecture further cleared up some of the concepts about Lisp (again, after I submitted my project, which I’m still waiting for the grade…) and that lead me to buy Peter’s book: Coders at Work, which is an amazing collection of interviews from great programmers. Anybody who is interested in

Cover of "Coders at Work"
Cover of Coders at Work

programming would find this book intriguing. After I finish it, I’ll put up a post specifically on that book.

Then I set out to make a small project in Lisp and ended up using Python 🙂 I wanted to integrate my Google Reader feeds with Emacs gnus and I found libgreader which pretty much handled all of the details with the still-unofficial Google Reader API. Inspired by reader2maildir, which does the same thing in Ruby, I set out to essentially port this to Python.

And I was able to download my feeds and read them in gnus, but since a lot of the feeds using embedded HTML or simply links to the main article (i.e. they don’t contain a summary) and would require me opening a web browser anyway, I figured the gnus approach wasn’t the best, for me.

But I learned a few things about programming in Python along the way. First of all, one has to be a little more specific while searching Google. Working with RSS Feeds, I realized it’s not adequate to search “python feed” due to the homograph “python.” Unappetizing images aside, I really like the interactive python interpreter. I didn’t really understand the point of using the interpreter directly and I thought it was useful only for toy programs, but it really helps in prototyping. Like Lisp’s REPL (read-veal-print-loop), interactive programming feels like precognitive debugging; it allows one to step through a debugger while the program is being written.

And while Python is not Lisp, it does have some functional style artifacts (much to the chagrin of its designer from what I understand). Python has a filter(function, sequence) function that:

returns a sequence consisting of those items from the sequence for which function(item) is true.

Combine this with a lambda expression, and I was able to write something like this:

filter(lambda x: x.unread != 0, reader.getSubscriptionList())

In this example, this line returns a list of feeds from Google Reader that contain unread items. So, I thought that was pretty cool 🙂 So while I would like to do some more stuff in Lisp, I was impressed on just how easy it was to get python running. That and with some Emacs-python integration, the development environment was very nice to work in.