Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
1  
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
2  
Along the lines of pgfplotstable: importing csv table. –  Mike Renfro Feb 28 '13 at 14:09

2 Answers 2

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

\documentclass{article}

\begin{document}    
<<echo=FALSE,results='asis'>>=
library("xtable")
my_tab=read.csv("database_table.csv")
tab=xtable(my_tab)
print(tab)
@
\end{document}

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
4  
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? –  tohecz Feb 28 '13 at 15:09

Your Answer

 
discard

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.