Showing posts with label howto. Show all posts
Showing posts with label howto. Show all posts

Monday, January 14, 2013

Using Emacs with ItsAllText on Fedora

ItsAllText (project website on GitHub) is a nifty Firefox add-on that allows you to edit the contents of a textbox with your favourite text editor, in my case Emacs. The configuration is quite simple. All you need to do is mention the path to the executable for your text-editor, and the add-on will use that to open the temporary file automatically. In the screen-shot below, I've used /usr/bin/emacs as the executable.


The trouble with using /usr/bin/emacs is that it opens a new Emacs window, which may become annoying after a while. To avoid this, you can use the emacsclient command, which opens the file in the Emacs instance that is running the Emacs server.

To enable the Emacs server, you need to add the following line to your .emacs file.

(server-start)

Or, if Emacs is already running, you can start the server using M-x server-start

Now, modify the ItsAllText configuration to use the emacsclient command instead of emacs, as shown in the screen-shot below.



On recent versions of Fedora, including FC 17 which I'm using, Firefox changes the default tmp directory to /var/tmp. Because of this, the emacsclient command cannot find the socket file used by the Emacs server, which is in /tmp. As a workaround, you can use the following script, that modifies the TMPDIR variable, to run emacsclient using /tmp.

#!/bin/sh
export TMPDIR=/tmp
/usr/bin/emacsclient "$@"

Now, set the path to this script as the editor in the ItsAllText preferences window. You can see the full description on the associated GitHub issue

Wednesday, December 30, 2009

How to include sub-floats in a list-of-floats in LaTeX

Been pottering around with LaTeX lately, after a long while, and came across this handy nugget I couldn't find adequately documented anywhere else.

I was trying to combine 2 images into a single float using the subfig package, but couldn't see them in the "List of Figures", despite adding individual captions. It turned out to be a simple fix. All you need to do is add the following line just before the \listoffigures command.

\setcounter{lofdepth}{2}

As you might have guessed looking at the command, it sets the depth for list-of-figures to 2, which meant that the captions of the sub-figures were displayed.

If you've combined 2 tables into a single float, you need to add the following line just before the \listoftables command.

\setcounter{lotdepth}{2}

You can find the full documentation for subfig as a PDF, here.

And, finally, I publish a post on this blog after ages!

Tuesday, June 03, 2008

Installing WordPress

Recently, I tried installing WordPress on my lab PC, Nogzone Mk II. The version I used was 2.5.1, the most recent release. It turned out to be a fairly easy install. I already had Apache, PHP, MySQL and the PHP-MySQL connector installed. After that, I just followed the instructions given here.

Installing plugins turned out to be a more painful process. The plugin I tried to install, WordPress.com stats, needed an API key. I followed the instructions given here to get the API key. They included creating an account at WordPress.com. Not a very painful task admittedly, but it seems to me to be rather pointless. It might be that I'm using some service of WordPress.com, but I can't reason what. It's my own database and webserver that I'm using.

Once I got the API key, I tried using it to activate the stats plugin. However, this required my WordPress install to access WordPress.com. This didn't work as my lab PC can't directly access the internet.

So, in the end, though WordPress is quite easy to install, getting plugins on it will only work if your server can contact WordPress.com.

Saturday, February 10, 2007

Nvidia drivers on Ubuntu

This goes out to all those unlucky people who still haven't managed to enable 3D acceleration on their Nvidia graphics cards. This is a link to the Ubuntu HOWTO on installing Nvidia drivers. It worked like a charm on the Riva TNT 2 on my KReSIT PC.