Skip to main content

Ralsina.Me — Roberto Alsina's website

How pretty is rst2pdf's output? Take a look.

I am a big Alexan­dre Du­mas fan. He's the di­rect an­ces­tor of Neal Stephen­son, so many of you should like him too. So I used one of his best books to try some au­to­mat­ic type­set­ting of project guten­berg texts.

No, the whole book did not con­vert with­out er­rors, and yes, there is some man­u­al work in what you are about to see, but hey, take a look.

Here's a far look of the first two pages:


And here's some de­tail of the typset­ting:


Yes, the type­set­ting is not re­al­ly La­TeX qual­i­ty, but it's not bad, ei­ther.

Com­pare it with the HTML ver­sion at project Guten­berg. The type­set­ting is a thing of beau­ty com­pared to that :-(

The im­age is a pic­ture of Chateau d'If from flick­r, re­leased un­der Cre­ative Com­mon­s. The ti­tle font is Scripti­na, I chose it be­cause it looks 19th cen­tu­ry but mod­ern.

rst2pdf: release fever!

I did a re­lease yes­ter­day, and an­oth­er to­day of my rst-­to-pdf-with­out-la­tex tool. What's new? Here's an in­com­plete list:

New in 0,4

  • Fixed bul­let and item lists in­­­den­­ta­­tion/nest­ing.

  • Im­­ple­­men­t­ed ci­­ta­­tions

  • Work­ing links be­tween foot­notes and its re­f­er­ences

  • Jus­ti­­fi­­ca­­tion en­abled by de­­fault

  • Fixed ta­ble bug (de­­mo.txt works now)

  • Ti­­tle and au­thor sup­­port in PDF prop­er­ties

  • Sup­­port for doc­u­­ment ti­­tle in head­­er/­­foot­er

  • Cus­­tom page sizes in stylesheet

New in 0.3

  • Font em­bed­d­ing (use any True Type font in your PDF­s)

  • Syn­­tax high­­­lighter us­ing Pyg­­ments

  • User's man­u­al

  • Ex­ter­­nal/­­cus­­tom stylesheets

  • Sup­­port for page num­bers in head­­er/­­foot­er

Of course, since I said I would re­lease some­thing ev­ery fri­day, this means I need to find some­thing else to re­lease? ;-)

rstpdf love: syntax highlighting

This mini-sprint is do­ing won­ders for rst2pdf. Now on SVN: pyg­ments-based syn­tax high­light­ing. Ex­am­ple here: rst2pdf's code, in a PDF by rst2pdf.

This friday will see a new rst2pdf release

Fol­low­ing my new pol­i­cy of one re­lease ev­ery fri­day, in 6 days you will see a rst2pdf re­lease. But not any re­lease: a great re­lease.

What will be new?

  • Sup­­port for page num­ber/­sec­­tion names/­sec­­tion num­bers in head­­ers and foot­er­s.

  • Cus­­tom in­­ter­pret­ed text roles (that means in­­­line styling ;-)

  • Stylesheets de­fined in ex­ter­­nal files. The syn­­tax is JSON which may look a bit strange, but it works great.

  • A Man­u­al!

  • Easy True Type font em­bed­d­ing.

  • May­be: syn­­tax high­­­light­ing di­rec­­tive via pyg­­ments. I know I could make it work us­ing the Im­age­­For­­mat­ter, but then you can't copy the code. There is a do­cu­til­s-sand­box project that does ex­ac­t­­ly what I wan­t.

I in­tend to call this re­lease 0.3.0, but maybe I will jump high­er, since there is not much more left to im­ple­men­t.

Some more rst2pdf love, time-based releases of my code

Since re­vi­sion #17_ you can dis­play Page num­bers in head­ers and foot­ers (on­ly!) by us­ing this syn­tax:

.. header::

   This is the header. Page ###Page###

This is the content

.. footer::

   This is the footer. Page ###Page###

It has some is­sues if your page num­ber is big­ger than 99999999999 or your head­er/­foot­er is a lit­tle longer than one line when us­ing the place­hold­er, be­cause the space re­quired is cal­cu­lat­ed with the place­hold­er in­stead of with the num­ber, but those are re­al­ly mar­gin­al cas­es.

Next in line, a de­cent way to de­fine cus­tom stylesheet­s.

As for "time-based re­leas­es", I in­tend to re­lease a new ver­sion of some­thing ev­ery fri­day.

Since I have about a dozen projects in dif­fer­ent stages of us­abil­i­ty, I ex­pect this will push me a bit more to­wards show­ing this stuff in­stead of it rot­ting in my hard drive and un­known svn re­pos.

Contents © 2000-2023 Roberto Alsina