Ads by Google

Thursday, November 13, 2008

Encrypting your Authinfo file

The authinfo file is used by Gnus to connect to various mail servers.  Putting the connection details, userid and passwords in it lets you login into different mail servers and download or access your mail and News without having to type in your userid and password everytime.

But the data is stored in plain text.  And if you feel uncomfortable with the file have all the details in plain text, encrypt it using EasyPG.

The emacswiki page on GnusEncryptedAuthInfo provides clear instructions on how to configure your EasyPG setup to encrypt your authinfo file.  Do note that you need to have gnupg installed to make it all work.  Of course.

And a little idea about what is a pass phrase, public, provate keys would help you in understanding the instructions better rather than following arcane (seemingly) instructions.

Sunday, November 9, 2008

Closing and Opening server connections in Gnus

When using Gnus, it sometimes happens that the server is flaky or there is a problem with your internet connections and the entire Gnus session sort of hangs.   And you have problems reconnecting.

Perhaps the simplest method is to, close the server connection and open it again as mentioned in this post.  To get to your *Server* buffer, use ^ in your Group buffer.

It's much cleaner than killing your Emacs session and taking other drastic measures.

Saturday, November 8, 2008

Emacs in the NYT

I never thought I'd see a mention of GNU Emacs in the New York Times, albeit in the comments section.

But it is there, mentioned as one of the oldest software around by some knowledgeable commenter.

PSTricks or PGF/Tikz?

Right now, you have a choice of learning PSTricks or PGF/Tikz for all your drawing needs. Both are large pieces of work which require you to read the manual over and over again. At least till you get it.

For myself, while I've known about PSTricks, I've stuck to PGF/Tikz. But if you need to have better plotting and more features than the already extensive one in PGF/Tikz, then PSTricks is the way to go. Again, the choice is dependant on your needs and the level of programming you'd like to get into.

This thread on comp.text.tex might help you decide.

EDIT: As the note in the comments mentioned there is also METAPOST and one other graphical language called Asymptote.

Tuesday, November 4, 2008

An eviscerating review of OpenOffice 3.0

Man, I'd be gutted if something I developed was reviewed and savaged like this.

I'd still use OpenOffice though.  It's not like I use Office suites frequently but when I receive the odd doc and I want to make some changes, save as PDF etc., I use Oo.  I'm anyway going to download and install it in a few days.

Sunday, November 2, 2008

Emacs command equivalents for Vi users

On the gnu.emacs.help newsgroup, there is this thread on Emacs equivalent of some vi commands.  The poster had helpfully created a emacswiki page called ViEmacsTable and listed some of the answers he received.

Well, I've just edited it to add some equivalents that I think are the closest to vi's commands.  Feel free to correct them if they're in error and add anything that you think might be useful.

Friday, October 31, 2008

Determine the greatest depth of subdirectories in a hierarchy

I found this thread on comp.unix.shell interesting.  And I particularly liked this solution.

$ x=./a/b/c/d/e/f
$ y=${x//[^\/]}
$ echo $y ${#y}
////// 6


Nicely done within the shell itself without calling anything anew.  And the thread itself has other solutions that may be of use to people who need to traverse and check files in directories.

Monday, October 27, 2008

List of packages included in the TeXLive 2008 Distribution

This might be useful information for those using TeXLive 2008.  Apparently, if you need to know the list of the packages, issuing

tlmgr list

will provide such a list.  There is also this link.

From a post on the comp.text.tex newsgroup.

Strange, there is no archive of the posts since the 25th on google groups.  So, when the archives come back, look for a post with the following information

From: Rolf Niepraschk <Rolf.Niepraschk@gmx.de>
Newsgroups: comp.text.tex
Subject: Re: List of packages in TeXLive 2008
Date: Mon, 27 Oct 2008 12:07:17 +0100
Lines: 16
Message-ID: <6mlln5FhashuU1@mid.individual.net>

Let's hope this gets sorted out fast.

Sunday, October 26, 2008

Placing images next to each other by stitching them together

Most people learn that when using LaTeX, that images and figures can move all over the place when used in a document. The standard advice is to make your document final and then try to tweak the placement of the figure.

Good advice.

And it never works for me. I always want to correct a sentence here, clarify a point there and soon the figure drifts to the next page.

Maddening.

So, the other day I was plotting some graphs of financial data using gnuplot and wanted to put all 6 PNGs in 1 A4 page. My first instinct was to generate a LaTeX template and use subfigure (superseded by Subfig) to place the images.

hmmm....this is going to take a long time I thought.

Each PNG image is 480 x 360 pixels in size.
An A4 paper is 210 by 297 mm in size

Got to do some math to figure out placement....

Screw that, I'll just use ImageMagick to do that.

montage `ls $OUTDIR/${base}*.png` -geometry 100x100% -frame 5 -tile 2x3 $OUTDIR/${base}_merged.png
...
convert -page A4 $OUTDIR/${base}_merged.png $OUTDIR/${base}_merged.pdf

montage and convert are part of the ImageMagick tool suite

So, the above montage command draws a frame around each image and produces a 2 column by 3 row single image of the 6 PNGs. And convert resizes the image to fit into an A4 pdf file.

Obviously there are plenty of drawbacks with my approach, chief among them is lack of flexibility in adding text and such. You can do it over the image though and a bit of captioning with montage but that's about it.

In this case, my needs were simple; all I wanted was all the 6 images in 1 A4 sheet with very little text. montage fits my needs perfectly well.

An example image stitched by montage is


This is then converted to PDF using convert.

Monday, October 20, 2008

Finding the right LaTeX font

If you're new to LaTeX, it is highly possible that you end up having to learn far more than you ever wanted to know about fonts.  Personally, apart from a cursory understanding of fonts, I never bothered learning more about fonts in LaTeX.

Too much to learn and very little benefits.  I mean try talking to your colleagues about Arial and Helvetica differences and watch them edge away with "hey, almost missed my meeting, see you".

I jest.

It's not that you need to know that much into fonts in LaTeX but it helps.  But with all packaging done now by TeXLive and MikTeX, there is very little you need to know.

  1. Ask for a font that fits your specific needs in the comp.text.tex newsgroup.  Read the replies, links and FAQs
  2. Download and install from your distribution through the package manager.
That's it;in most cases.   I haven't installed a single font manually in over 6 or 7 years.  That's how well you can manage with the default installation

OR a sign of my laziness as I have NEVER installed a single font manually

In order to save you sometime over agonizing over font choices, you could always check out the LaTeX font catalogue to see whether you like any of the fonts under different categories.  It also provides the methods of using it in your document when you click on a link.

It would also dispel the notion that there aren't enough font choices in LaTeX.  And if you're a neophyte in font taste like me, pretty soon, your eyes glaze over and everything looks the same to you.  Trust me on that.  10 minutes into all that choices, I'm like "What am I looking for?"

But I digress.  Do take a look there to pick a good font for your posters, reports and special needs.