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

In my work I need to describe several database tables (~20) - each table has six columns - field name, field type, key, null / not null setting, default value and description.

Is there some way how to create in TeX some kind of template / macro so I don't need to create each table manually?

share|improve this question
Do you want to read in the table and typeset automatically? For instance pgfplotstable could be a viable solution? – zeroth Feb 28 '13 at 14:08
Along the lines of pgfplotstable: importing csv table. – Mike Renfro Feb 28 '13 at 14:09

You can use RStudio to type your LaTeX document with knitr, R and the xtable package, in that way:



with many possible output options. You can use a for loop if you want to write it for 20 tables.

share|improve this answer

If you already have tables in Excel, you could use the plugin Excel2LaTeX to convert everything immediately to LaTeX.

share|improve this answer
While your idea is nice, we prefer the answers to be "self-contained", i.e. to explain in more detail how such a conversion is done. Could you please add a small example? – yo' Feb 28 '13 at 15:09

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.