Is it possible to export a "fragment" of table using the new collect suite of commands?
I want to use collect export to create a LaTeX table file, say table.tex, and then refer to it in my LaTeX document. I can do this via
which exports only the table rather than a whole compilable LaTeX document. I can then refer to the table in the main document via \input{table.tex}. The table in this case is wrapped in table environment. For example:
produces
What I would like to have instead is something like the "fragment" option in esttab package to suppress table opening and closing, that is to export the tabular section only. The reason I want this is to be able to use my own custom table setup within LaTeX. One example (among others) is to use the threeparttable environment to have proper table notes:
Is this possible to do in collect suite?
I want to use collect export to create a LaTeX table file, say table.tex, and then refer to it in my LaTeX document. I can do this via
Code:
collect export table.tex, tableonly
Code:
sysuse auto, clear regress price mpg etable, export(table.tex, tableonly)
Code:
\begin{table}[!h]
\centering
\begin{tabular}{ll}
\cline{1-2}
\multicolumn{1}{r}{} &
\multicolumn{1}{c}{price} \\
\cline{1-2}
\multicolumn{1}{l}{Mileage (mpg)} &
\multicolumn{1}{r}{-238.894} \\
\multicolumn{1}{l}{} &
\multicolumn{1}{r}{(53.077)} \\
\multicolumn{1}{l}{Intercept} &
\multicolumn{1}{r}{11253.061} \\
\multicolumn{1}{l}{} &
\multicolumn{1}{r}{(1170.813)} \\
\multicolumn{1}{l}{Number of observations} &
\multicolumn{1}{r}{74} \\
\cline{1-2}
\end{tabular}
\end{table}
Code:
\begin{table}[!h]
\centering
\begin{threeparttable}[b]
\begin{tabular}{ll}
\input{table.tex}
\end{tabular}
\end{threeparttable}
\begin{tablenotes}[para,flushleft]
\item \textit{Notes:} #1
\end{tablenotes}
\end{table}

Comment