Hi all,
I've been successfully using outreg to produce tex fragments for years now. I got a new computer and thus re-installed outreg (ssc install outreg), and now the same code I've been working on for years is broken.
In my dofile, the code reads:
outreg using "$output\tex\Sum-Stat-Cow-Games", replay(table`tn') replace tex fragment ///
ctitles("","N","Husband and wife" ,"Husband and wife" ,"difference in""","","played games","did not play games","means (std. error)") ///
coljust(l;c) basefont() ctitlfont(rm) hlines(101{0}1)
This produces a tex file that reads as follows. The version of outreg on my old computer did not produce the code highlighted in red:
\smallskip\begin{large}{Table A: Summary Statistics: Cow characteristics by games participation}\end{large}\\
\smallskip
\begin{tabular}{lcccc}
\hline \noalign{\smallskip}\begin{rm}\end{rm} & \begin{rm}N\end{rm} & \begin{rm}Husband and wife\end{rm} & \begin{rm}Husband and wife\end{rm} & \begin{rm}difference in\end{rm}\\
\begin{rm}\end{rm} & \begin{rm}\end{rm} & \begin{rm}played games\end{rm} & \begin{rm}did not play games\end{rm} & \begin{rm}means (std. error)\end{rm}\\
\noalign{\smallskip}\hline \noalign{\smallskip}Output (Liters per day) & 3,768 & 1.20 & 1.17 & 0.02\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.81)\end{footnotesize} & \begin{footnotesize}(0.67)\end{footnotesize} & \begin{footnotesize}(0.07)\end{footnotesize}\\
\noalign{\smallskip}Owner is female & 3,753 & 0.42 & 0.47 & -0.05\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.49)\end{footnotesize} & \begin{footnotesize}(0.50)\end{footnotesize} & \begin{footnotesize}(0.04)\end{footnotesize}\\
\noalign{\smallskip}Cow's age & 3,770 & 7.00 & 7.25 & -0.24\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(2.37)\end{footnotesize} & \begin{footnotesize}(2.49)\end{footnotesize} & \begin{footnotesize}(0.17)\end{footnotesize}\\
\noalign{\smallskip}Cow's value (10 000 CFA) & 3,685 & 19.77 & 20.49 & -0.72\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(8.56)\end{footnotesize} & \begin{footnotesize}(8.99)\end{footnotesize} & \begin{footnotesize}(0.85)\end{footnotesize}\\
\noalign{\smallskip}Number of calves & 3,778 & 2.68 & 2.81 & -0.12\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(1.39)\end{footnotesize} & \begin{footnotesize}(1.40)\end{footnotesize} & \begin{footnotesize}(0.09)\end{footnotesize}\\
\noalign{\smallskip}Months lactating & 3,783 & 5.23 & 5.13 & 0.10\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(2.83)\end{footnotesize} & \begin{footnotesize}(2.81)\end{footnotesize} & \begin{footnotesize}(0.20)\end{footnotesize}\\
\noalign{\smallskip}Gobra breed & 3,789 & 0.87 & 0.86 & 0.01\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.33)\end{footnotesize} & \begin{footnotesize}(0.34)\end{footnotesize} & \begin{footnotesize}(0.03)\end{footnotesize}\\
\noalign{\smallskip}Guzera breed & 3,789 & 0.05 & 0.06 & -0.01\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.23)\end{footnotesize} & \begin{footnotesize}(0.24)\end{footnotesize} & \begin{footnotesize}(0.02)\end{footnotesize}\\
\noalign{\smallskip}Zebu breed & 3,789 & 0.05 & 0.02 & 0.02\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.21)\end{footnotesize} & \begin{footnotesize}(0.15)\end{footnotesize} & \begin{footnotesize}(0.01)**\end{footnotesize}\\
\noalign{\smallskip}Metisse breed & 3,789 & 0.02 & 0.05 & -0.02\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.16)\end{footnotesize} & \begin{footnotesize}(0.22)\end{footnotesize} & \begin{footnotesize}(0.02)\end{footnotesize}\\
\noalign{\smallskip}Groundnut meal last week & 3,789 & 0.09 & 0.11 & -0.02\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.28)\end{footnotesize} & \begin{footnotesize}(0.31)\end{footnotesize} & \begin{footnotesize}(0.04)\end{footnotesize}\\
\noalign{\smallskip}Rice bran last week & 3,789 & 0.10 & 0.10 & -0.01\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.29)\end{footnotesize} & \begin{footnotesize}(0.30)\end{footnotesize} & \begin{footnotesize}(0.04)\end{footnotesize}\\
\noalign{\smallskip}Vaccinated & 3,789 & 0.53 & 0.58 & -0.05\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.50)\end{footnotesize} & \begin{footnotesize}(0.49)\end{footnotesize} & \begin{footnotesize}(0.05)\end{footnotesize}\\
\noalign{\smallskip}\hline\end{tabular}\\
\begin{footnotesize}Notes: In columns 2-3, the table shows baseline means with standard deviations shown in parentheses below for the sample of households eligible to play games disaggregated by whether the husband and wife participated in the games. The difference in means between households where the husband and wife did and did not play the games is shown in column 4, with standard errors in parentheses below. Standard errors are clustered at the household level.\end{footnotesize}\\
\smallskip
\end{center}
This is analogous to a problem posted a year ago but never answered: https://www.statalist.org/forums/for...ex-file-output
I'm pulling these tex fragments into a LyX document, and I really don't want to have to delete this extra code by hand every time I run my dofile. Ideas? Was there an update to outreg, and specifically the tex fragment option?
Thank you!
I've been successfully using outreg to produce tex fragments for years now. I got a new computer and thus re-installed outreg (ssc install outreg), and now the same code I've been working on for years is broken.
In my dofile, the code reads:
outreg using "$output\tex\Sum-Stat-Cow-Games", replay(table`tn') replace tex fragment ///
ctitles("","N","Husband and wife" ,"Husband and wife" ,"difference in""","","played games","did not play games","means (std. error)") ///
coljust(l;c) basefont() ctitlfont(rm) hlines(101{0}1)
This produces a tex file that reads as follows. The version of outreg on my old computer did not produce the code highlighted in red:
\smallskip\begin{large}{Table A: Summary Statistics: Cow characteristics by games participation}\end{large}\\
\smallskip
\begin{tabular}{lcccc}
\hline \noalign{\smallskip}\begin{rm}\end{rm} & \begin{rm}N\end{rm} & \begin{rm}Husband and wife\end{rm} & \begin{rm}Husband and wife\end{rm} & \begin{rm}difference in\end{rm}\\
\begin{rm}\end{rm} & \begin{rm}\end{rm} & \begin{rm}played games\end{rm} & \begin{rm}did not play games\end{rm} & \begin{rm}means (std. error)\end{rm}\\
\noalign{\smallskip}\hline \noalign{\smallskip}Output (Liters per day) & 3,768 & 1.20 & 1.17 & 0.02\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.81)\end{footnotesize} & \begin{footnotesize}(0.67)\end{footnotesize} & \begin{footnotesize}(0.07)\end{footnotesize}\\
\noalign{\smallskip}Owner is female & 3,753 & 0.42 & 0.47 & -0.05\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.49)\end{footnotesize} & \begin{footnotesize}(0.50)\end{footnotesize} & \begin{footnotesize}(0.04)\end{footnotesize}\\
\noalign{\smallskip}Cow's age & 3,770 & 7.00 & 7.25 & -0.24\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(2.37)\end{footnotesize} & \begin{footnotesize}(2.49)\end{footnotesize} & \begin{footnotesize}(0.17)\end{footnotesize}\\
\noalign{\smallskip}Cow's value (10 000 CFA) & 3,685 & 19.77 & 20.49 & -0.72\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(8.56)\end{footnotesize} & \begin{footnotesize}(8.99)\end{footnotesize} & \begin{footnotesize}(0.85)\end{footnotesize}\\
\noalign{\smallskip}Number of calves & 3,778 & 2.68 & 2.81 & -0.12\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(1.39)\end{footnotesize} & \begin{footnotesize}(1.40)\end{footnotesize} & \begin{footnotesize}(0.09)\end{footnotesize}\\
\noalign{\smallskip}Months lactating & 3,783 & 5.23 & 5.13 & 0.10\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(2.83)\end{footnotesize} & \begin{footnotesize}(2.81)\end{footnotesize} & \begin{footnotesize}(0.20)\end{footnotesize}\\
\noalign{\smallskip}Gobra breed & 3,789 & 0.87 & 0.86 & 0.01\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.33)\end{footnotesize} & \begin{footnotesize}(0.34)\end{footnotesize} & \begin{footnotesize}(0.03)\end{footnotesize}\\
\noalign{\smallskip}Guzera breed & 3,789 & 0.05 & 0.06 & -0.01\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.23)\end{footnotesize} & \begin{footnotesize}(0.24)\end{footnotesize} & \begin{footnotesize}(0.02)\end{footnotesize}\\
\noalign{\smallskip}Zebu breed & 3,789 & 0.05 & 0.02 & 0.02\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.21)\end{footnotesize} & \begin{footnotesize}(0.15)\end{footnotesize} & \begin{footnotesize}(0.01)**\end{footnotesize}\\
\noalign{\smallskip}Metisse breed & 3,789 & 0.02 & 0.05 & -0.02\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.16)\end{footnotesize} & \begin{footnotesize}(0.22)\end{footnotesize} & \begin{footnotesize}(0.02)\end{footnotesize}\\
\noalign{\smallskip}Groundnut meal last week & 3,789 & 0.09 & 0.11 & -0.02\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.28)\end{footnotesize} & \begin{footnotesize}(0.31)\end{footnotesize} & \begin{footnotesize}(0.04)\end{footnotesize}\\
\noalign{\smallskip}Rice bran last week & 3,789 & 0.10 & 0.10 & -0.01\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.29)\end{footnotesize} & \begin{footnotesize}(0.30)\end{footnotesize} & \begin{footnotesize}(0.04)\end{footnotesize}\\
\noalign{\smallskip}Vaccinated & 3,789 & 0.53 & 0.58 & -0.05\\
& \begin{footnotesize}\end{footnotesize} & \begin{footnotesize}(0.50)\end{footnotesize} & \begin{footnotesize}(0.49)\end{footnotesize} & \begin{footnotesize}(0.05)\end{footnotesize}\\
\noalign{\smallskip}\hline\end{tabular}\\
\begin{footnotesize}Notes: In columns 2-3, the table shows baseline means with standard deviations shown in parentheses below for the sample of households eligible to play games disaggregated by whether the husband and wife participated in the games. The difference in means between households where the husband and wife did and did not play the games is shown in column 4, with standard errors in parentheses below. Standard errors are clustered at the household level.\end{footnotesize}\\
\smallskip
\end{center}
This is analogous to a problem posted a year ago but never answered: https://www.statalist.org/forums/for...ex-file-output
I'm pulling these tex fragments into a LyX document, and I really don't want to have to delete this extra code by hand every time I run my dofile. Ideas? Was there an update to outreg, and specifically the tex fragment option?
Thank you!