Closed bquistorff closed 8 years ago
Hi, -esttab- is not smart enough to figure out how to set the column definitions in LaTeX if you tabulate a matrix. The problem can be addressed by providing appropriate column definitions using the -alignment()- option. Example:
. matrix x = (1,2)
. esttab matrix(x), tex align(cc)
\begin{tabular}{l*{1}{cc}}
\hline\hline
& x& \\
& c1& c2\\
\hline
r1 & 1& 2\\
\hline\hline
\end{tabular}
Of course you can also type, e.g. -align(rr)- or -align(lc)- or whatever you like. Furthermore, to automate, you could use code such as the following.
. matrix x = (1,2)
. esttab matrix(x), tex align(`=colsof(x)*"c"')
\begin{tabular}{l*{1}{cc}}
\hline\hline
& x& \\
& c1& c2\\
\hline
r1 & 1& 2\\
\hline\hline
\end{tabular}
I will look into making -esttab- smarter so that -align()- only has to be used if you don't want "c" column definitions, but it might take a while until I get to this. ben
The newest estout update, which will be available from SSC in some days, fixes this problem.
When outputting a matrix, -esttab- produces incorrect latex code. For example,
The top line should have a
2
instead of1
.