ratexdb Version 0.14

Database Access in LaTeX
Copyright (C) 2007-2010 Robin Höns, Integranova GmbH

Important notice

Unfortunately the Ruby people seem to have decided that DBI is deprecated. Well, I couldn't be bothered to repair all this Ruby stuff, install new packages etc. So, I cannot go on developing ratexdb; instead I wrote an improved clone in C# called nlatexdb.

Why ratexdb?

So there I was, wanting to do database reports. MS reporting services gave me tendovaginitis, so why not use Latex, I thought? Quickly I found latexdb by Hans-Georg Eßer, and I liked the idea very much.

However, I needed it under Windows with an ODBC data source, and latexdb is written in Python and Bash. My attempts to get it to run failed, and I decided it would be more fun to rewrite it in Ruby and include some improvements on the way.

Improvements over latexdb

Requirements

You need a Latex distribution and Ruby above version 1.8. I used MiKTeX and Ruby 1.8.6.

Download

Ratexdb is published under the GNU General Public License and available here:

Download ratexdb 0.14 (2010-09-30)

Added \texdbcommand.

Replaced ftools by FileUtils.

Removed an umlaut which seemed to give trouble.

Download ratexdb 0.13 (2010-03-03)

Added "~" to LaTeX special characters, and changed "\" replacement from "$\backslash$" to "\ensuremath{\backslash}".

After a \texdb... command, the first character after the last closing } was lost. Fixed.

Download ratexdb 0.12 (2008-08-01)

Changed ordering in postprocessing: First replace the special characters, then the regular expressions. Like this, the regular expressions can contain LaTeX commands.

Fixed bug in command line arguments parsing.

Download ratexdb 0.11 (2008-06-24)

Changed line breaks from "\r\n" to "\n" to make it work on Unix and Mac.

Download ratexdb 0.1 (2007-11-29)

Initial release.

Please read the README file for more information.

Installation

Just copy the Ruby script to a place where it is found. Under Unix-like systems, you might have to give it execute permission using chmod.

Examples

counters.tex shows a possibility to fill a tabular environment with data, using a LaTeX counter and the ifthen package.

Helper Tools

Ratexdb is just a preprocessor. So it won't work with multi-part documents (joined by the Latex "\input" command). You can put the query definitions in each file, and run ratexdb on all of them. But you won't be able to use SQL variables of one file in another file.

Therefore, a kind user sent me an awk script which combines all Latex files in one resulting file: latexmerge.awk

Contact

If you have a question, find a bug, like to propose an improvement, or just wish to tell me you used this script successfully, contact me!

Acknowledgements

Many thanks to Hans-Georg Eßer for LatexDb.

Many thanks to Oscar van Eijk and his SQLTeX for inspiring the LaTeX characters change in version 0.13. In fact, I'm considering adopting his "-r" command-line parameter, which reads the LaTeX replacements from a file. Is there anybody who would find this useful?

Many thanks to François Boone for helpful comments and bugfixes.

Many thanks to my employer, Integranova, for making software development a breeze with the programming machine, and for allowing me to publish this script under GPL. Speaking of which:

ratexdb is Copyright © 2007-2010 Robin Höns, Integranova GmbH.

It is released under the GNU GPL, a copy of which you find in the package after downloading. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Last Change: 5. August 2011 by Robin Höns