I am trying to export some regression tables from Stata to LaTeX
.
The problem is that I want to display variable labels in the table but some of my labels contain the &
character. As such, when I use the community-contributed command esttab
to export to LaTeX
and then try to compile, I get an error because the Texmaker
thinks &
should indicate an extra column.
Below is my Stata code:
esttab results1 results2 using "$repodir/output/tables/tract_xregs.tex", ///
se noconstant label star(* 0.10 ** 0.05 *** 0.01) replace ///
nonotes compress nomtitles booktabs ///
s(modelsample modelobs, label("Sample" "N"))
esttab sumstats1 using "$repodir/output/tables/tract_sumstats.tex", booktabs label ///
nonumbers cells("mean p50 min max sd") replace
How can I include the &
character in my variable label without getting an error when compiling it?