Latest news 2024-07-03: Ebook sale (1st – 31st July 2024): short story cybercrime fiction Unsocial Media free; short story cybercrime fiction Smile for the Camera free; short story noir crime fiction I’ve Heard the Mermaid Sing free; crime fiction novel The Private Enemy US$1.99; illustrated children’s story The Foolish Hedgehog US$0.99.

datatool package FAQ

This is the FAQ for the datatool package. See also the datatool user guide and the bug tracker (datatool category)

Error Messages

Undefined \@dtlifhaskey 🔗

This has been fixed in version 2.02.

2020-07-03 12:05:27


Undefined \dtl@getcolumnindex 🔗

This has been fixed in version 2.02.

2020-07-03 12:05:38


! Missing number, treated as zero (math=pgfmath option) 🔗

This has been fixed in version 2.12.

2020-07-03 12:05:50


General Queries

LaTeX is very slow with large databases 🔗

Version 2.0 uses a more efficient way of storing the data which should speed things up. Also, the latest version of the xfor package (which datatool uses) has a more efficient loop, so also consider updating xfor. If it’s too slow for your requirements, consider using a data processing tool (e.g. MatLab or Perl) to write the TeX code to an external file.

See also: Gallery: datatool performance.

2020-07-03 12:07:24


Unexpected output

Databases are always sorted in ascending order even when descending is specified 🔗

This bug appeared in version 2.0 and was fixed in version 2.01.

2013-12-08 16:47:04


\DTLsavedb ignores the file name and always uses the name .tex 🔗

This has been fixed in version 2.02.

2020-07-03 12:08:18


All my rows have the last assigned value 🔗

When you add an entry to a database (either explicitly using \DTLnewdbentry or implicitly by loading an external file), by default the value isn’t expanded. This protects any fragile commands that may be contained in the value, however if you are programatically adding values, for example, you want to do something like

then the content for that cell will be set to \SampleValue, which means that whenever you use this entry it will do whatever’s the current definition of \SampleValue at the time of use not at the time the value was stored.

If you actually want to expand the command when you add it to the database, you must enable expansion using \dtlexpandnewvalue before you add the value to the database, but you will then need to take care to protect fragile commands.

2020-07-03 12:08:57