Hi Statalisters,
I'm running several regressions and creating multiple tables (each containing multiple regressions) using esttab, such as the example below.
I then wrote a LaTex file that reads:
This creates a runaway note at the bottom of each table. I'd like to make each note table-width. The outputted latex code from stata reads:
According to this link, I could replace the outputted stata code with
which works. However given that I'm doing this for dozens of tables, I'd like to know how to do this globally in my latex preamble.
TIA!
I'm running several regressions and creating multiple tables (each containing multiple regressions) using esttab, such as the example below.
Code:
sysuse auto.dta, clear
generate wtsq = weight^2
* create table 1
eststo clear
regress mpg weight
eststo a
regress mpg weight wtsq
eststo b
regress mpg weight wtsq foreign
eststo c
esttab a b c using "table1.tex", replace addnotes("A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width.")
* create table 2
eststo clear
regress price headroom
eststo a
regress price headroom trunk
eststo b
regress price headroom trunk length
eststo c
esttab a b c using "table2.tex", replace addnotes("A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width.")
Code:
\documentclass[a4paper, hidelinks]{article}
\usepackage{amsmath,
amssymb,
amsthm,
appendix,
bbm,
booktabs,
caption,
color,
enumitem,
etoolbox,
fancyhdr,
float,
graphicx,
hyperref,
inputenc,
latexsym,
mathtools,
multicol,
natbib,
parskip,
pdflscape,
pgfplots,
setspace,
soul,
tikz,
titlesec,
titling}
\usepackage[margin=.2in]{geometry}
\usepackage{grffile}
% wrap addnotes text
% \newcommand{{l}{\footnotesize Notes:}}{{@{}p{.9\linewidth}@{}}{\footnotesize Notes:}} NOT WORKING
\begin{document}
\input{"table1.tex"} %stata's latex output
\input{"table2.tex"} %stata's latex output
\end{document}
Code:
\multicolumn{4}{l}{\footnotesize A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width.}
Code:
\multicolumn{4}{@{}p{\linewidth}@{}}{\footnotesize{\footnotesize A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width. A very long note that I would like to wrap at table width.}
TIA!

Comment