Customize your date format in latex : french dates

On my CV, there is the date at which it was lastly modified… like February 2012 for instance. I’m not a huge fan of Latex, and I’m not a guru in Latex either, in fact I didn’t write the CV class, just grabed it on the internet and modified it the way I wanted it to look like. Recently I had to translate it into french… boring. One part took a little longer than expected : translating the date ! Ok I know February is Février in french… the problem was how to make it automatic ? Like each time you compile your CV, you actually don’t have to modify the date, latex does it for you.

Well that worked well in english, but as soon as I wanted it to write Février 2012 instead of February 2012, I got troubles… So here is the solution I found :

first include the babel package with the french option :

\usepackage[french]{babel}

Then include the datetime package :

\usepackage{datetime}

Then customize your date format. In my case I just want “Février 2012″, i.e. “Month_name year_in_number. The way to do that is :

\newdateformat{mydateformat}{\monthname~\THEYEAR}

and then, where you want to insert your date :

\mydateformat\today

And that’s it !

Installing python, numpy and matplotlib on MacOS 10.7 Lion

I can’t understand how it is still possible, in the 21st century, when we send rovers on Mars etc. that  installing a bunch of software on my computer turns out to be soooo difficult. I have Mac OS 10.7 (didn’t choose… work computer) and I very well may be a complete incompetent, but installing python+numpy+matplotlib on my computer was a pain !

So, for those who feel the same, here is a solution I found on the web, it worked for me. It was very easy as it only requires to download/install MacPort and then run the command :

sudo port install python27 py27-numpy py27-scipy py27-matplotlib py27-ipython

It took approximately 2 hours to download and install whatever packages needed to make it work but in the end, all was ok, without any error. Note it might requires you to install X code and the developer packages before, I had it so I don’t really know.

Anyway… after it is finished, everything is installed in

/opt/local/bin/

so I just had to add an alias python=”/opt/local/bin/python2.7″ in my ~/.profile, so that python points to the correct version and not the apple default version.

 

Edit : I tried the method on my iMac, which runs Mac OS 10.6.8 and it didn’t work. I had the following error after running the macport command :

No index(es) found! Have you synced your source indexes?

To solves this, I had to edit the file

sudo vi /opt/local/etc/macports/sources.conf

and change the last line :

#rsync://rsync.macports.org/release/tarballs/ports.tar [default]
http://www.macports.org/files/ports.tar.gz [default]

so that ‘port’ uses http instead ot rsync, and then run the command :

sudo port sync

then I could run

sudo port install python27 py27-numpy py27-scipy py27-matplotlib py27-ipython