TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create an overview table of some data. More specifically, I have some named objects and for each of these I have some properties.

Example data and schematic of output:

+ -------+--------+-------+--------+
| Object | Edible | Color | Size   |
+ -------+--------+-------+--------+
| Apple  | yes    | green | small  |
| Cat    | no     | brown | medium |
+ -------+--------+-------+--------+

Instead of entering the table manually, I'd like to create something like a database and then generate the table based on a format description.

I thought this could maybe be done with BibTex.

I would create a bib file with content like this:


And then create a (very) custom bibliography style to turn this into a table.

I could create some external script to transform the bib file into a table (JSON would probably be a better data format then) but I'd like to use TeX tools.

How can I get from this (or similar) bib to a table instead of a list (like usually with references)?

share|improve this question

Unless you know how to write in bibtex's stack-based language, I wouldn't recommend doing it that way. If you just want to use TeX tools without relying on external scripts, you can use datatool. Here's an example:





% Define a command to access a field in `mydata' in the row identified by a
% given object:

% Syntax: \field{object}{column label} 

% Syntax: \boolfield{object}{column label}{true part}{false part}


List the data in a tabular environment:


Sort on `Object' column.

List sorted data in a tabular environment:


Access data: an apple is \field{Apple}{Size} and \field{Apple}{Color}.
It \boolfield{Apple}{Edible}{is}{isn't} edible.

Access data: a cat is \field{Cat}{Size} and \field{Apple}{Color}.
It \boolfield{Cat}{Edible}{is}{isn't} edible.


The above example produces:

Image of result

(I suggest putting \DTLdisplaydb inside a table or use \DTLdisplaylongdb if it's longer than a page.)

share|improve this answer
Where is datatooltk-gui? ;-) – Marco Daniel Jun 29 '13 at 20:01
@MarcoDaniel I thought about mentioning it, but that would've contradicted my "without relying on external scripts" statement ;-) – Nicola Talbot Jun 29 '13 at 20:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.