我找到了这个表格的旧代码,但我不明白为什么它不起作用。你能帮忙吗?
\documentclass{article}
\setlength{\oddsidemargin}{.25in}
\setlength{\textwidth}{5.5in}
\setlength{\topmargin}{0.50in}
\setlength{\textheight}{9.00in}
\pagestyle{empty}
\begin{document}
\input table
\BeginTable
\def\C{\JustCenter}
\def\L{\JustLeft}
\def\R{\JustRight}
\BeginFormat
| l | l | cn[-0.00] | cn[-0.00] | cn[-0.00] | cn[-0.00] | cn[-0.00] |
\EndFormat
" \use7 \C \bf TABLE 4 " \\+02
" \use7 \C \bf Influence of State Variables on Asset Demands " \\+11 \_3
" {} " \C State Variables: " \C Constant " \C $AR_t$ " \C $y_t$ " \C $(d-p)_t$ " \C $spr_t$ " \\+23 \_2
" \use3 \L 1953/Q2 - 1999/Q3, Quarterly " {} " {} " {} " {} " \\+42
" \use3 \L $~\gamma =1, \psi = 1, \rho =0.92^{1/4} $ " {} " {} " {} " {} " \\+34
" ~~Stock" Total Demand " 272.77 " 292.42 " 296.33 " 303.41 " 302.79 " \\+11
" {} " Hedging Demand " 0.00 " 0.00 " 0.00 " 0.00 " 0.00 " \\+12
" ~~Bond" Total Demand " 172.93 " 162.73 " 160.07 " 160.67 " 171.01 " \\+11
" {} " Hedging Demand " 0.00 " 0.00 " 0.00 " 0.00 " 0.00 " \\+12
" ~~Cash" Total Demand " -345.70 " -355.15 " -356.40 " -364.08 " -373.80 " \\+11
" {} " Hedging Demand " 0.00 " 0.00 " 0.00 " 0.00 " 0.00 " \\+15 \_1
" \use3 \L $~\gamma =2, \psi = 1, \rho =0.92^{1/4} $ " {} " {} " {} " {} " \\+34
" ~~Stock" Total Demand " 135.52 " 146.02 " 149.62 " 246.07 " 246.61 " \\+11
" {} " Hedging Demand " 0.00 " 0.20 " 1.95 " 94.91 " 95.77 " \\+12
" ~~Bond" Total Demand " 82.13 " 33.53 " -7.22 " 6.25 " -8.17 " \\+11
" {} " Hedging Demand " 0.00 " -43.86 " -83.35 " -70.18 " -90.00 " \\+12
" ~~Cash" Total Demand " -117.65 " -79.55 " -42.39 " -152.32 " -138.44 " \\+11
" {} " Hedging Demand " 0.00 " 43.66 " 81.41 " -24.73 " -5.77 " \\+15 \_1
" \use3 \L $~\gamma =5, \psi = 1, \rho =0.92^{1/4} $ " {} " {} " {} " {} " \\+34
" ~~Stock" Total Demand " 53.17 " 56.52 " 57.40 " 157.64 " 160.51 " \\+11
" {} " Hedging Demand " 0.00 " -1.34 " -1.08 " 97.83 " 100.84 " \\+12
" ~~Bond" Total Demand " 27.65 " -3.94 " -15.70 " -43.70 " -94.24 " \\+11
" {} " Hedging Demand " 0.00 " -30.13 " -41.47 " -69.59 " -122.57 " \\+12
" ~~Cash" Total Demand " 19.18 " 47.42 " 58.30 " -13.94 " 33.73 " \\+11
" {} " Hedging Demand " 0.00 " 31.47 " 42.55 " -28.24 " 21.72 " \\+15 \_1
" \use3 \L $~\gamma =20, \psi = 1, \rho =0.92^{1/4} $ " {} " {} " {} " {} " \\+34
" ~~Stock" Total Demand " 12.00 " 12.01 " 11.47 " 59.37 " 59.54 " \\+11
" {} " Hedging Demand " 0.00 " -1.88 " -2.41 " 45.23 " 45.46 " \\+12
" ~~Bond" Total Demand " 0.41 " -11.28 " 3.61 " -19.55 " -39.95 " \\+11
" {} " Hedging Demand " 0.00 " -11.86 " 3.03 " -20.17 " -41.53 " \\+12
" ~~Cash" Total Demand " 87.59 " 99.27 " 84.92 " 60.18 " 80.41 " \\+11
" {} " Hedging Demand " 0.00 " 13.74 " -0.62 " -25.06 " -3.94 " \\+15 \_1
\EndTable
\bigskip \footnotesize{\bf Note}: $AR_t$ = real returns on T-Bills, excess return on stocks, and excess return on bonds; $y_t$ = nominal yield on T-Bills; $(d-p)_t$ = log dividend-price ratio; $spr_t$ = yield spread. The bond is a 5-year nominal bond in the quarterly dataset and a 20-year in the annual dataset. \normalsize \end{document}
答案1
作为大卫·卡莱尔提到了它的表格环境以不同的方式定义。如果没有太多表格,您可以切换回通常的tabular
环境。在这里我使用了longtable
环境,这样它就不会对分页符产生任何影响。我也习惯了booktabs
它的样式。
代码:
\documentclass{article}
\usepackage{longtable}
\usepackage{booktabs}
\begin{document}
\begin{longtable}[c]{lllllll}
\caption{Influence of State Variables on Asset Demands}
\label{my-label}\\
& \multicolumn{1}{c}{\textbf{State Variables:}} & \multicolumn{1}{c}{\textbf{Constant}} & \multicolumn{1}{c}{\textbf{$AR_t$}} & \multicolumn{1}{c}{\textbf{ $y_t$}} & \multicolumn{1}{c}{\textbf{$(d-p)_t$}} & \multicolumn{1}{c}{\textbf{$spr_t$}} \\
\endfirsthead
%
\endhead
%
\toprule
\multicolumn{7}{l}{\textbf{1953/Q2 - 1999/Q3, Quarterly}} \\ \toprule
\multicolumn{7}{l}{\textbf{$~\gamma =1, \psi = 1, \rho =0.92^{1/4} $}} \\\toprule
~~Stock & Total Demand & 272.77 & 292.42 & 296.33 & 303.41 & 302.79 \\
& Hedging Demand & 0 & 0 & 0 & 0 & 0 \\
~~Bond & Total Demand & 172.93 & 162.73 & 160.07 & 160.67 & 171.01 \\
& Hedging Demand & 0 & 0 & 0 & 0 & 0 \\
~~Cash & Total Demand & -345.7 & -355.15 & -356.4 & -364.08 & -373.8 \\
& Hedging Demand & 0 & 0 & 0 & 0 & 0 \\ \toprule
\multicolumn{3}{l}{\textbf{$~\gamma =2, \psi = 1, \rho =0.92^{1/4} $}} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ \toprule
~~Stock & Total Demand & 135.52 & 146.02 & 149.62 & 246.07 & 246.61 \\
& Hedging Demand & 0 & 0.2 & 1.95 & 94.91 & 95.77 \\
~~Bond & Total Demand & 82.13 & 33.53 & -7.22 & 6.25 & -8.17 \\
& Hedging Demand & 0 & -43.86 & -83.35 & -70.18 & -90 \\
~~Cash & Total Demand & -117.65 & -79.55 & -42.39 & -152.32 & -138.44 \\
& Hedging Demand & 0 & 43.66 & 81.41 & -24.73 & -5.77 \\ \toprule
\multicolumn{3}{l}{\textbf{$~\gamma =5, \psi = 1, \rho =0.92^{1/4} $}} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ \toprule
~~Stock & Total Demand & 53.17 & 56.52 & 57.4 & 157.64 & 160.51 \\
& Hedging Demand & 0 & -1.34 & -1.08 & 97.83 & 100.84 \\
~~Bond & Total Demand & 27.65 & -3.94 & -15.7 & -43.7 & -94.24 \\
& Hedging Demand & 0 & -30.13 & -41.47 & -69.59 & -122.57 \\
~~Cash & Total Demand & 19.18 & 47.42 & 58.3 & -13.94 & 33.73 \\
& Hedging Demand & 0 & 31.47 & 42.55 & -28.24 & 21.72 \\ \toprule
\multicolumn{3}{l}{\textbf{$~\gamma =20, \psi = 1, \rho =0.92^{1/4} $}} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ \toprule
~~Stock & Total Demand & 12 & 12.01 & 11.47 & 59.37 & 59.54 \\
& Hedging Demand & 0 & -1.88 & -2.41 & 45.23 & 45.46 \\
~~Bond & Total Demand & 0.41 & -11.28 & 3.61 & -19.55 & -39.95 \\
& Hedging Demand & 0 & -11.86 & 3.03 & -20.17 & -41.53 \\
~~Cash & Total Demand & 87.59 & 99.27 & 84.92 & 60.18 & 80.41 \\
& Hedging Demand & 0 & 13.74 & -0.62 & -25.06 & -3.94 \\ \bottomrule
\end{longtable}
\end{document}
我希望你能够清理空的\textbf{}
s。