updated September 2013
I am not a big believer of LaTeX, but I do use it. One reason to dislike LaTeX is the way you need to make tables. It is very easy to mess up and very hard to debug.
From your stats package to LaTeX
My workflow is the following: make every table with just data in Excel, then convert using excel2latex and paste it in your .tex file. If you happen to have crazy formulas in your table, do the same but use codes in your excel table which you then replace by the formulas in LaTeX.
Do not, as a rule, use tabout-like output that Stata delivers. I prefer a little adjustment of Excel matrix output, which is good nowadays, over the burden to look into the LaTeX puzzle. Face it: when we use tables, it's generally for several models or with a combination of different analyses. So for me -tabout- is worthless.
Adjustments to LaTeX tables
The standard LaTeX-layout, which is good enough, has very large margins. That's nice, but it limits your tables. To cope with that, I've read about two solutions:
- The tabularx package
- Put the table inside a minipage and scale it to fit
We're left with just a few more issues:
- Landscape pages (fear, anger, hate!)
- Wrapping lines
- Wide tables (through -tabularx-)
Wrapping lines I've done. It's cumbersome. Basically, you will want to limit the size of a column. You do that through specifying p{3 cm} in your {l l l c r r r c} series of column specifications, where each of l, r, c refers to a column that is left aligned, right aligned or centered. p{} replaces such a specification, so you lose your control over alignment! To solve this issue, you need yet another package: arrays. Then, and I'm not joking, your wrapped left aligned column should be specified as:
>{\raggedright\arraybackslash}p{width}
It is really that stupid. Never saw a > in LaTeX syntax before? Neither did I. As always, there will be some logic behind it, for which a Ph.D. level IQ will suffice, but even if it is understandable, we don't want to waste our time figuring out.
Links
If you don't want to google, hit some old bookmarks (2010):
- http://programming.itags.org/tex/126082/
- http://www.latex-community.org/forum/viewtopic.php?f=45&t=5089
- http://radio.wihome.net/wiki/?article=LaTeX:tablefootnotes
- http://www.vision.ime.usp.br/~jmena/misc/latex/tables_with_latex.pdf
- http://www.latex-community.org/forum/viewtopic.php?f=45&t=6322&p=24742
- http://www.math.uiuc.edu/~hildebr/tex/packages.html
- http://people.csail.mit.edu/jrennie/latex/