我试图让我的 Stata 输出跨越 LaTeX 文档中的几页。使用 longtable 时,这不起作用。我的表格不会延续到下一页(只有表格注释在下一页)。
我看到有人建议编辑 .tex 文件,手动将 \begin{longtable} 添加到其中,但这对我来说似乎是一个非常糟糕的解决方案。如果我的输出发生变化怎么办?我在 tex.stackexchange 上找不到有关组合这些内容的其他相关信息。
有没有办法将 longtable 与 estauto 命令结合起来?当 Stata 创建 .tex 文件时是否可以这样做?
我将非常感激任何建议。
我尝试过这个:
\begin{longtable}
\caption{reg1} \label{tab:reg1}
\centering
\setlength{\tabcolsep}{10pt} % space out the columns otherwise they are squished together
\estauto{Tables/reg1.tex}{10}{c}
\begin{tablenotes}
\small
\item Note: Standard errors in parentheses. ***, ** and * indicate statistical significance at the 1\%, 5\% and 10\% level, respectively.
\end{tablenotes}
\end{longtable}
前言:
\documentclass[a4paper,12pt]{article}
\usepackage{apacite}
\usepackage[final]{pdfpages}
\usepackage[margin=25mm]{geometry}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{verbatim}
\usepackage{url}
\usepackage{longtable}
\usepackage{float}
\usepackage{subcaption}
\usepackage{setspace} %Allows double spacing with the \doublespacing command
\usepackage[toc,page]{appendix}
%% maths
\usepackage{amssymb, amsfonts, amsmath}
\usepackage{bm}
\usepackage{adjustbox}
\usepackage{caption} % to reset the headers of tables
\usepackage{rotating} % for sidewaystable
\usepackage{booktabs} % neatly formatting lines
\usepackage{threeparttable}
\usepackage{longtable}
\usepackage{rotating}
\usepackage{dcolumn} % aligning decimals
\newcolumntype{d}[1]{D{.}{.}{#1}}
\usepackage[rightcaption]{sidecap}
\usepackage{graphicx} %package to manage images
\graphicspath{ {images/} }
\usepackage{tikz}
\usetikzlibrary{positioning}
% *****************************************************************
% Estout LaTeX wrapper
% *****************************************************************
%%Original code developed by Jörg Weber: see
%% https://www.jwe.cc/2012/03/stata-latex-tables-estout/
%% and
%% https://www.jwe.cc/blog/
\let\estinput=\input % define a new input command so that we can still flatten the document
\newcommand{\estwide}[3]{
\vspace{.75ex}{
%\textsymbols% Note the added command here
\begin{tabular*}
{\textwidth}{@{\hskip\tabcolsep\extracolsep\fill}l*{#2}{#3}}
\toprule
\estinput{#1}
\\ \bottomrule % 08 Dec 2021. Add these slashes.
\addlinespace[.75ex]
\end{tabular*}
}
}
\newcommand{\estauto}[3]{
\vspace{.75ex}{
%\textsymbols% Note the added command here
\begin{tabular}{l*{#2}{#3}}
\toprule
\estinput{#1}
\\ \bottomrule % 08 Dec 2021. Add these slashes.
\addlinespace[.75ex]
\end{tabular}
}
}
% Allow line breaks with \\ in specialcells
\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}
}
\newcommand{\sym}[1]{\rlap{#1}}% Thanks David Carlisle
%%%%%%%%%%% End of wrapper %%%%%%%%%%%%%%%%%%%%%
\providecommand{\keywords}[1]
{
\small
\textbf{\textit{Keywords---}} #1
}
\begin{document}