Latest news 2021-06-05: New blog post: Dickimaw Books Site Account.

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

Top

Undefined \dtl@getcolumnindex 🔗

This has been fixed in version 2.02.

2020-07-03 12:05:38

Top

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

This has been fixed in version 2.12.

2020-07-03 12:05:50

Top

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

Top

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

Top

\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

Top

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

\DTLnewdbentry{mydata}{SampleField}{\SampleValue}
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

Top