LaTeX编译报错‘paragraph ended before @@array was complete’的解决方案咨询
解决LaTeX报错:‘paragraph ended before @@array was complete’
这个报错在使用tabularx这类表格环境时特别常见,基本都是语法格式错误或者表格内容列数不匹配导致的。我检查了你的代码,找到了两个关键问题:
1. tabularx的语法格式错误
你当前的tabularx起始代码是:
\begin{tabularx}{1\textwidth} {>{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} }
tabularx的正确语法要求列格式必须紧跟在宽度参数的大括号内,不能拆成两个独立的大括号。正确写法应该把这两部分合并:
\begin{tabularx}{1\textwidth}{>{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm}}
2. 表格内容的列对齐错误
在Constituency Statute (3+)那一行的标准误行,你写了:
0 &-0.042 &-0.056 &-0.336 &-0.005 &-0.005\\
这里第一个单元格的0是多余的——这一行是对应上面变量的标准误,应该和上一行的变量名列对齐,第一列留空,修正后:
&-0.042 &-0.056 &-0.336 &-0.005 &-0.005\\
修正后的完整表格代码
把这两处修改后,表格部分的代码应该是这样的:
\begin{sidewaystable} \centering \scriptsize \begin{tabularx}{1\textwidth}{>{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm} >{\raggedright\arraybackslash}p{3cm}} \toprule &Tobin's Q &Total Q & Enterprise Value Multiple & Operating Cash Flow & EBITDA \\ \midrule Constituency Statute (-2 or -1) * Tech&Pharma Industries &-0.0242 &0.0125 &0.985 &-0.0159 &-0.0097\\ &-0.074 &-0.123 &-0.728 &-0.014 &-0.01\\ Constituency Statute (0) * Tech&Pharma Industries &-0.0607 &-0.0352 &0.7701 &-0.0122 &-0.0115\\ &-0.065 &-0.165 &-0.588 &-0.016 &-0.011\\ Constituency Statute (+1) * Tech&Pharma Industries &0.0938 &0.1216 &1.3535** &-0.0185 &0.0061\\ &-0.084 &-0.121 &-0.578 &-0.015 &-0.01\\ Constituency Statute (+2) * Tech&Pharma Industries &0.1098 &0.0849 &1.2928 &-0.0219 &-0.0077\\ &-0.094 &-0.128 &-0.793 &-0.015 &-0.012\\ Constituency Statute (3+) * Tech&Pharma Industries &0.1175*** &0.1593* &1.5140*** &-0.0293** &-0.0160** \\ &-0.041 &-0.093 &-0.556 &-0.012 &-0.006\\ Constituency Statute (-2 or -1) &0.0937 &0.0748 &0.0524 &0.0089** &0.0138** \\ &-0.058 &-0.09 &-0.319 &-0.004 &-0.005\\ Constituency Statute (0) &0.0964* &0.102 &0.1114 &0.0124 &0.0201*** \\ &-0.057 &-0.077 &-0.263 &-0.008 &-0.007\\ Constituency Statute (+1) &0.0825 &0.0855 &0.1579 &0.0149*** &0.0150** \\ &-0.062 &-0.082 &-0.336 &-0.005 &-0.007\\ Constituency Statute (+2) &0.0861 &0.1665** &0.131 &0.0221*** &0.0144** \\ &-0.061 &-0.082 &-0.425 &-0.005 &-0.006\\ Constituency Statute (3+) &0.0763* &0.1288** &0.2165 &0.0145*** &0.0083\\ &-0.042 &-0.056 &-0.336 &-0.005 &-0.005\\ Constant &3.4313*** &2.5697*** &5.8824*** &-0.0131*** &0.0627*** \\ &-0.1 &-0.117 &-0.766 &-0.004 &-0.004\\ Control Variables &Yes &Yes &Yes &Yes &Yes \\ Firm FE &Yes &Yes &Yes &Yes &Yes \\ Industry-by-Year FE &Yes &Yes &Yes &Yes &Yes \\ State-by-Year FE &Yes &Yes &Yes &Yes &Yes \\ Observations &103287 &99728 &103094 &84902 &103287\\ Adjusted R2 &0.6 &0.542 &0.56 &0.632 &0.681\\ \bottomrule \addlinespace \multicolumn{6}{@{}p{1\textwidth}@{}}{\footnotesize This table reports the coefficient estimates of the dynamics of treatment effect of constituency statutes. The dependent variables are Tobin's Q (column 1), Total Q (column 2), Enterprise Value Multiple (column 3), Operating Cash Flow (column 4), and EBITDA (column 5). Constituency Statute ($-$2 or $-$1) indicate observations in one and two years prior to the enactment of constituency statutes, Constituency Statute (0) indicates the year of the enactment, and Constituency Statute ($+$1), ($+$2) and (3$+$) indicate observations in one, two, and three or more years after the enactment respectively. All control variables are lagged by one year and are suppressed for brevity. All regressions include firm, state (of location) by year, and industry (Fama$-$French 12 industries) by year fixed effects. Singleton observations are dropped in regressions due to fixed effects (Correia, 2015). Robust standard errors are clustered at firm’s incorporation state level and are reported in parentheses below the coefficient estimates. ***, ** and * denote statistical significance at 1\%, 5\% and 10\% level respectively. See Appendix for detailed definitions for all variables. }\\ \end{tabularx} \caption{Dynamics of treatment effect of constituency statutes $-$ continued Panel B} \label{tab:8B} \end{sidewaystable}
修正这两个问题后,应该就能解决这个报错了。
内容的提问来源于stack exchange,提问作者symkly
相关产品推荐
相关产品推荐

