2009-09-16 09:59

Cheatsheets: RST and Python

I never remember how to do footnotes right using ReStructured Text.

If that, or something similar, happens to you, get my rst cheatsheet and print it, it's a two-sided A4 page.

This is an early version, the left-hand columns need lots of love.

Also, you may want to take a look at this one-page python cheatsheet, too.

Both are created using restructured text and rst2pdf, and licensed under Creative Commons.

I would love to see translations to other languages. If you want to help, contact me!

2009-09-15 22:53

Preparing a rst2pdf release for next week

Since this is the first post that appears in Planet Python, a small intro is in order.

Hi, my name is Roberto Alsina, I am a former KDE developer, amateur programmer [1] , python fan.

This post (and many you will see from me) is about rst2pdf, a tool to convert restructured text to PDF. For example, it turns the python library reference into this PDF (not production quality yet).

If you are a rst2pdf 0.11 user, or a sphinx or docutils user who wants to try an alternative way to create PDFs, then I would like your help testing the SVN trunk code.

These are some of the new features since 0.11:

  • PDFBuilder, a Sphinx extension to generate PDFs.
  • Kerning (requires wordaxe from SVN)
  • AAFigure support (diagrams using ASCII Art)
  • PageBreaks can be odd/even/any
  • Support for advanced page counters (manual numbering, roman/arabic/letters)
  • Much better styling, specially for tables.
  • About two dozen bugfixes.

So, please, take a look, you may like it!

[1] That just means I love programming.

2009-09-08 11:30

Me at PyCon Argentina 2009

Here I am speaking...

Roberto y Alejandro

And here's the audience...

Audience laughing with Roberto Alsina

I really, really really hope they were laughing with me.

Pictures by Beatrice Murch licensed under creative commons.

And one more. This was the first day, when I was speaking about Norvig's 20-line spellchecker (slides here)

Charla Relampago Corrector Ortografico

Photo by Kant (Ariel Kanterewicz), CC:BY

2009-09-07 15:04

PyCon Argentina 2009 Day 2

Ha, I thought I was very tired after Day 1... not even close. Not after how tired I was after day 2!

First a short recap:

  • Got there (in time!)

  • Watched Facundo Batista's Entendiendo Unicode

  • Finally presented PyQt + WxPython + PyGtk. And here are my slides.

    A huge thank you to Mariano Reingart, Mariano Guerra, Daniel Moisset and Javier Castrillo who were there in representation of WxPython and PyGtk. It was a very cordial affair and lots of fun for everyone involved, I hope. Here are the Wx and PyGtk slides.

    On the other hand, this kind of thing is dead as future talk subjects, at least to me. There isn't much sizzle in it anymore.

  • Lunch

  • A bit late for Multiprocesamiento en Python by Claudio Freire

  • Then I completely didn't follow Behind the scenes: Python bytecode by Matías Bordese because...

  • I had yet another lightning talk to give!

    It was an old trusty friend of mine, Raymond Hettinger's spreadsheet thingie and I even did slides, there was even time to get a neat xkcd reference in it... and the netbook I was using crapped out in slide #3.

    I could tell the joke (Marcos Dione had a shirt with the exact needed xkcd strip in the back), but I really had a thing going and .. well, it sucked.

    What the heck, I will try again next time.

    And yes, here are the slides I couldn't show

  • Then, last conference, Unladen Swallow by Collin Winter, which was very nice.

  • Then conference closing, gifts for the lucky, some talking, and home to rest.

In other areas:

I finally got my copy of the python tutorial printed with rst2pdf. It's the first time ever a book has been typeset using rst2pdf.

While the printing and binding are (intentionally!) cheap, the typesetting was pretty good. Here are some pictures:


And finally, I congratulate all the organizers, it was a beautifully handled event!

2009-09-04 20:50

Pycon Argentina 2009 Day 1

I am tired as a dog, back home after day 1 of PyCon Argentina 2009.

So, what happened:

  • I was late with my brochures because the train got delayed (doors were not closing, so we had to change trains)

  • Anyway, I got there kinda in time (about 30 minutes after registration started)

  • Saw Leito Monk's lecture

  • Saw Alejandro Cura's lecture

  • Saw the final printed version of the python tutorial in spanish. He is experimenting with very low cost printing to use for educational purposes. It looks nice, and I am a very proud uncle, since it was typeset using rst2pdf!

    I hope I can get a copy tomorrow!

  • Then the lights went out, so had a coke with Leito

  • Then lunch

  • Saw Karucha's Juegos educativos con PyGame

  • Grabbed a precious seat near a power outlet and worked in...

  • My A spellchecker in 5 minutes lightning talk! Based in this Norvig code

    I think it went fine. At least it lasted EXACTLY 5 minutes and covered all the slides :-)

  • Talked a minute with Jacob Kaplan-Moss, told him I wrote rst2pdf, he said he likes it (blush) and maybe something about using it to generate custom books to sell via lulu.com

Now, to finish writing my slides for tomorrow!

2009-08-09 22:35

Not only is Argentina not like this: it was never like this.

I just stumbled into this video in The argentine post, which is a "documentary" from 1932 about traveling in Argentina.

There you can see: a bandoneón and guitar duo playing (for some reason) on a speeding boat.

Folkloric dancers in high heels. Very, very very bad ones, too, specially the women wearing said high heels.

A real life crazy law: coats were mandatory, so men wore pyjama coats in the streets (no, they were not mandatory on the streets although you wouldn't get into almost any bussiness without one).

A man selling milk from a cow in the street. Riiiiight. Ok, that is almost plausible. Could happen sometimes.

The world's worst mate, with about as much sugar as yerba (believe me, that's not even good for tourists).

A comment like this "It is seldom that an argentine woman is troubled about the rights of her sex".

If this was paid for by some tourism promotion agency: they really pushed it. If it was paid by MGM: crappy production values in the staged scenes, dudes!

The really really bad side of this kind of thing you can see in the comments by people that seem to be argentines who say things like "It was such a country. What have they done with it?".

You know what? Argentina in the 1930s sucked as a place to live in for most people. It was ok if you were a member of the Jockey Club, I suppose, but the average guy lived like crap.

Sure, the per capita income was high... compared to a world ravaged by the great depression, and even then 70% of the people lived in poverty. And trust me, poverty in the 30s was a bad place to be! Read some freaking Arlt.

What was the life expectancy of the average argentine? How about 55? (see here) Yes, this "rich" place had a life expectancy 20 years lower than today.

Of course you had almost no political rights because less than 35% of the population over 18 years old had the right to vote.

Those who did vote could just as well not bother, since there was rampant fraud.

There was no public health system.

There were no retirements. You worked until you could work no more, then you lived with your kids, if you had them. If you didn't, they bad luck for you.

You lived under laws that would now seem draconian, the police could arrest you without cause and hold you almost forever.

But yeah, Palermo was a nice racetrack (Hell, it still is!) where the dissolute rich could waste the money they earned as absentee landlords of vast ranches, and you could swim in the Costanera (now polluted).

The gist? We are better off now. The average argentine citizen has more rights, lives better and longer than the average 1930s argentine.

The rest is touristy crap and false memories.

2009-07-02 11:25

Yay! sphinx-rst2pdf-builder works!

Ok, it kinda works a little.

I got commit rights in the mercurial repo, so now you can get the very very alpha version here.

This triggered several bugs in rst2pdf, so you need SVN rst2pdf for it to work.

What works:

  • Glossary
  • Plain restructured text ... with some caveats (example: footnotes are semi-broken)
  • Index generation (not 100%, but maybe 75%)

I don't know what other pieces of sphinx require specific rst2pdf support, but I will be hitting them as they come.

Contents © 2000-2019 Roberto Alsina