我在 latex 中创建了一个表格。但是,表格覆盖了整个页面,我看不到某些列。如果有人能帮我格式化表格就太好了。谢谢!
\documentclass[11pt]{article}
\usepackage[colorlinks]{hyperref}
\usepackage{graphics,lscape} \usepackage{amsmath}
\usepackage{rotating,multirow,varwidth,setspace}
\usepackage{latexsym,amssymb,epsfig}
\usepackage[capposition=top]{floatrow}
\usepackage[tablename=TABLE,labelsep=newline,aboveskip=0pt,bf]{caption}
\usepackage{clipboard,booktabs,ltablex,threeparttablex}
\usepackage{afterpage,sectsty,textcase,longtable,fancyvrb}
\usepackage{sepfootnotes,changepage,bibentry}
\usepackage{siunitx,geometry,pdfpages}
\usepackage[noabbrev]{cleveref}
\usepackage[titletoc,toc,title]{appendix}
\crefname{appsec}{Appendix}{Appendices}
\protected\def\stars#1{$^{#1}$} \newcolumntype{k}{>{\hsize=.1\hsize}S}
%Set Counter \setcounter{footnote}{2}
%Defining text size to control for spacing in tabularx environment \newcolumntype{b}[1]{>{\centering}>X} \newcolumntype{Y}{>{\centering\arraybackslash}X} \newcolumntype{Z}{>{\centering\arraybackslash}>{\hsize=.2\textwidth}>X} %\newcolumntype{s}{>{\centering}>{\hsize=.25\hsize}>X} \newcolumntype{j}{>{\centering}>{\hsize=.2\textwidth}>X}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
%Redefining multicolumn environment to take care of @{} \newcommand{\gmc}[2]{\multicolumn{#1}{@{}#2@{}}} %\renewcommand{\qedsymbol}{\\\hspace*{\fill}$\blacksquare$}
\newcommand*{\tabnospace}{\item \noindent \hspace{-0.05in}}
\numberwithin{equation}{section}
\geometry{margin=0.75in} \usepackage[none]{hyphenat} \doublespacing
\begin{document}
\renewcommand{\arraystretch}{1.1}
\begin{ThreePartTable} \begin{TableNotes}[flushleft] \small \tabnospace This table presents the difference-in-difference results for the impact of board size on financing activities in the wake of deteriorating macroeconomic condition. The dependent variables are long term debt and cash scaled by sales. The estimates of different controls are illustrated for different periods of Survey of Professional Forecasts (SPF). Anxious index represents the probability that real GDP will decline in the quarter in which the survey is taken. CG represents a measure of corporate governance, in this case, board size, calculated one-year prior to the quarter of survey. AFTER is an indicator variable equal to one for four fiscal quarters after the month of survey, and equals to 0 for four quarters prior to the month of survey. BTM represents book-to-market ratio, AT represents total assets, and REV represents total revenue for the quarter. All regressions include firm, and fiscal quarter fixed effects. The t-statistics, presented in parentheses below the coefficients, are corrected for heteroskedasticity and cross-sectional and time-series correlations using a two-way cluster at the firm and year-quarter levels. ***, **, and * denote significance at 1\%, 5\%, and 10\% levels for two-tailed tests respectively. \end{TableNotes} \singlespacing \begin{tabularx}{\textwidth}{@{}p{0.8in}p{0.5in}p{0.5in}p{0.5in}p{0.5in}p{0.5in}p{0.5in}p{0.5in}p{0.5in}p{0.5in}p{0.5in}p{0.5in}@{}}
\caption{\textit{Board Size and Financing Activities as Macroeconomic Conditions Deteriorate}}\\\toprule\toprule SPF Month'Year & Feb'07 & May'07 & Aug'07 & Nov'07 & Feb'08 & May'08 & Aug'08 & Nov'08 & Feb'09 & May'09 \\\hline Anxious Index & 8.28 &
11.75 & 12.44 & 18.89 & 47.31 & 49.07 & 34.09 & 90.14 & 94.41 & 78.91 \\\hline \\ \endfirsthead
\caption{\textit{Board Size and Financing Activities as Macroeconomic Conditions Deteriorate - Continued}}\\\toprule\toprule SPF Month'Year & Feb'07 & May'07 & Aug'07 & Nov'07 & Feb'08 & May'08 & Aug'08 & Nov'08 & Feb'09 & May'09 \\\hline Anxious Index & 8.28 &
11.75 & 12.44 & 18.89 & 47.31 & 49.07 & 34.09 & 90.14 & 94.41 & 78.91 \\\hline \\ \endhead
\bottomrule\gmc{12}{r}{\small\textit{(Continued)}}\endfoot \bottomrule\insertTableNotes\endlastfoot
\gmc{12}{l}{Dependent Variable: Long Term Debt/Sale} \\\hline
AFTER & $0.047^{}$ & $0.038^{}$ & $0.036^{}$ & $0.047^{}$ & $0.073^{**}$ & $0.118^{***}$ & $0.155^{***}$ & $0.158^{***}$ & $0.064^{**}$ & $-0.071^{**}$ & $-0.183^{***}$ \\
& (1.458) & (1.339) & (1.159) & (1.347) & (1.98) & (3.145) & (4.518) & (4.827) & (2.477) & (-2.526) & (-5.856) \\ AFTER:CG & $-0.074^{*}$ & $-0.066^{*}$ & $-0.073^{**}$ & $-0.058^{*}$ & $-0.053^{}$ & $-0.035^{}$ & $-0.03^{}$ & $-0.037^{}$ & $-0.038^{}$ & $-0.041^{}$ & $-0.004^{}$ \\
& (-1.93) & (-1.793) & (-2.143) & (-1.849) & (-1.207) & (-1.054) & (-1.025) & (-1.172) & (-1.39) & (-1.533) & (-0.192) \\
AT & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ \\
& (3.445) & (3.498) & (3.694) & (3.907) & (4.266) & (4.175) & (4.491) & (4.551) & (4.495) & (4.457) & (4.473) \\
BTM & $-1.098^{***}$ & $-0.917^{***}$ & $-0.768^{***}$ & $-0.647^{***}$ & $-0.47^{***}$ & $-0.359^{***}$ & $-0.369^{***}$ & $-0.376^{***}$ & $-0.353^{***}$ & $-0.357^{***}$ & $-0.38^{***}$ \\
& (-3.898) & (-3.684) & (-3.495) & (-3.316) & (-2.923) & (-2.606) & (-2.799) & (-2.877) & (-2.721) & (-2.6) & (-2.785) \\
CG & $0.247^{***}$ & $0.204^{**}$ & $0.185^{**}$ & $0.114^{}$ & $0.091^{}$ & $0.028^{}$ & $0.007^{}$ & $0.014^{}$ & $0.084^{}$ & $0.088^{}$ & $0.068^{}$ \\
& (2.591) & (2.239) & (2.159) & (1.383) & (1.298) & (0.438) & (0.107) & (0.212) & (1.5) & (1.539) & (1.183) \\
REV & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ \\
& (-5.245) & (-5.129) & (-5.263) & (-5.325) & (-5.598) & (-5.515) & (-5.679) & (-5.683) & (-5.655) & (-5.574) & (-5.484) \\
N & 15120 & 14648 & 14760 & 15040 & 15472 & 15104 & 15104 & 15312 & 15584 & 14680 & 14704 \\
$R^2$ & 0.183 & 0.181 & 0.18 & 0.176 & 0.182 & 0.181 & 0.182 & 0.185 & 0.191 & 0.199 & 0.214 \\ Adj $R^2$ & 0.179 & 0.178 & 0.176 & 0.172 &
0.179 & 0.178 & 0.179 & 0.182 & 0.188 & 0.195 & 0.21 \\\hline
\gmc{12}{l}{Dependent Variable: Cash and Cash Equivalents/Sale} \\\hline
AFTER & $-0.962^{***}$ & $-0.99^{***}$ & $-0.772^{***}$ & $-0.785^{***}$ & $-0.768^{***}$ & $-0.72^{***}$ & $-0.628^{***}$ & $-0.662^{***}$ & $-0.74^{***}$ & $-0.566^{***}$ & $-0.409^{***}$ \\
& (-3.227) & (-4.115) & (-3.624) & (-3.598) & (-3.548) & (-3.604) & (-3.557) & (-3.845) & (-4.198) & (-3.351) & (-2.584) \\ AFTER:CG & $0.148^{}$ & $0.195^{}$ & $0.189^{}$ & $0.46^{*}$ & $0.374^{}$ & $0.496^{**}$ & $0.388^{}$ & $0.411^{*}$ & $0.235^{}$ & $0.216^{}$ & $0.209^{}$ \\
& (0.338) & (0.564) & (0.711) & (1.883) & (1.343) & (2.114) & (1.625) & (1.847) & (1.253) & (1.226) & (1.229) \\
AT & $0^{**}$ & $0^{*}$ & $0^{*}$ & $0^{*}$ & $0^{*}$ & $0^{*}$ & $0^{*}$ & $0^{**}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ \\
& (-2.146) & (-1.875) & (-1.798) & (-1.805) & (-1.803) & (-1.663) & (-1.744) & (-2.023) & (-2.732) & (-2.955) & (-3.211) \\
BTM & $-2.588^{**}$ & $-2.041^{*}$ & $-1.817^{**}$ & $-1.373^{*}$ & $-0.946^{}$ & $-0.835^{}$ & $-0.713^{}$ & $-0.823^{**}$ & $-0.893^{**}$ & $-0.799^{**}$ & $-0.825^{***}$ \\
& (-1.983) & (-1.849) & (-2.028) & (-1.742) & (-1.508) & (-1.631) & (-1.644) & (-2.154) & (-2.541) & (-2.282) & (-2.612) \\
CG & $-0.069^{}$ & $-0.21^{}$ & $-0.311^{}$ & $0.015^{}$ & $-0.734^{}$ & $-0.859^{*}$ & $-0.619^{}$ & $-0.592^{}$ & $-0.027^{}$ & $-0.041^{}$ & $-0.058^{}$ \\
& (-0.105) & (-0.309) & (-0.52) & (0.028) & (-1.38) & (-1.824) & (-1.479) & (-1.518) & (-0.09) & (-0.141) & (-0.216) \\
REV & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ \\
& (-0.305) & (-0.397) & (-0.389) & (-0.417) & (-0.507) & (-0.873) & (-0.933) & (-0.96) & (-0.743) & (-0.608) & (-0.447) \\
N & 15440 & 15016 & 15128 & 15392 & 15808 & 15424 & 15448 & 15648 & 15968 & 15048 & 15072 \\
$R^2$ & 0.11 & 0.116 & 0.111 & 0.107 & 0.11 & 0.12 & 0.12 & 0.126 & 0.131 & 0.137 & 0.144 \\ Adj $R^2$ & 0.106 & 0.112 & 0.107 & 0.103 &
0.106 & 0.116 & 0.116 & 0.123 & 0.127 & 0.133 & 0.14 \\
\end{tabularx} \end{ThreePartTable}
\end{document}
答案1
几点说明:
序言相当有问题:它包含了太多太古老、太混乱的内容,例如
hyperref
需要加载晚的-cleverref
必须稍后出现,但几乎所有其他事物都应该更早出现;epsfig
已经过时;等等。tabularx
需要X
以某种形式存在的一列或多列。
该表与页面不匹配。
首先要问的是,数据是否可以更简洁地总结或更清晰地划分。这是一个只有您(或您所在领域的某个人)才能回答的内容问题。但是,我认为肯定没有必要告诉读者Feb'07
给出的是月份/年份。我不是您所在领域的专家,但即使我知道这么多 ;)。
如果该策略不够,那么第二件事就是考虑格式。简单地将表格缩小到页面大小是不明智的。不匹配的字体大小不好看,而且会分散注意力。此外,在这种情况下,这种方法会使表格难以阅读。
以下解决方案做了几件事:
旋转表格,使得纸张的高度适合表格的宽度;
通过更加一致地实施的指导方针来减少视觉混乱
booktabs
(不要使用\hline
、不要使用双重规则、使用添加足够空间而不是空行的规则等);使用
longtable
和l
列说明符,因为p{}
s 实际上并没有做太多的事情,而且X
也没有使用任何列;适用
\small
于整个表格,因为除非增加纸张尺寸,否则它根本无法容纳整个表格。
\documentclass[11pt]{article}
\usepackage{pdflscape}
\usepackage{setspace}
\usepackage[tablename=TABLE,labelsep=newline,aboveskip=0pt,bf]{caption}
\usepackage{booktabs,threeparttablex}
\usepackage{longtable}
\usepackage{geometry}
\newcommand{\gmc}[2]{\multicolumn{#1}{#2}}
\newcommand*{\tabnospace}{\item \noindent \hspace{-0.05in}}
\geometry{margin=0.75in}
\doublespacing
\begin{document}
\begin{landscape}
\small
\renewcommand{\arraystretch}{1.1}
\begin{ThreePartTable}
\begin{TableNotes}[flushleft]
\small
\tabnospace
This table presents the difference-in-difference results for the impact of board size on financing activities in the wake of deteriorating macroeconomic condition. The dependent variables are long term debt and cash scaled by sales. The estimates of different controls are illustrated for different periods of Survey of Professional Forecasts (SPF). Anxious index represents the probability that real GDP will decline in the quarter in which the survey is taken. CG represents a measure of corporate governance, in this case, board size, calculated one-year prior to the quarter of survey. AFTER is an indicator variable equal to one for four fiscal quarters after the month of survey, and equals to 0 for four quarters prior to the month of survey. BTM represents book-to-market ratio, AT represents total assets, and REV represents total revenue for the quarter. All regressions include firm, and fiscal quarter fixed effects. The t-statistics, presented in parentheses below the coefficients, are corrected for heteroskedasticity and cross-sectional and time-series correlations using a two-way cluster at the firm and year-quarter levels. ***, **, and * denote significance at 1\%, 5\%, and 10\% levels for two-tailed tests respectively.
\end{TableNotes}
\singlespacing
\begin{longtable}{*{12}{l}}
\caption{\textit{Board Size and Financing Activities as Macroeconomic Conditions Deteriorate}}\\
\toprule
SPF & Feb'07 & May'07 & Aug'07 & Nov'07 & Feb'08 & May'08 & Aug'08 & Nov'08 & Feb'09 & May'09 \\
Anxious Index & 8.28 &
11.75 & 12.44 & 18.89 & 47.31 & 49.07 & 34.09 & 90.14 & 94.41 & 78.91 \\
\midrule
\endfirsthead
\caption{\textit{Board Size and Financing Activities as Macroeconomic Conditions Deteriorate --- Continued}}\\
\toprule
SPF & Feb'07 & May'07 & Aug'07 & Nov'07 & Feb'08 & May'08 & Aug'08 & Nov'08 & Feb'09 & May'09 \\
Anxious Index & 8.28 &
11.75 & 12.44 & 18.89 & 47.31 & 49.07 & 34.09 & 90.14 & 94.41 & 78.91 \\
\midrule
\endhead
\bottomrule
\gmc{12}{r}{\small\textit{(Continued)}}
\endfoot
\bottomrule\insertTableNotes
\endlastfoot
\gmc{12}{l}{Dependent Variable: Long Term Debt/Sale} \\\midrule
AFTER & $0.047^{}$ & $0.038^{}$ & $0.036^{}$ & $0.047^{}$ & $0.073^{**}$ & $0.118^{***}$ & $0.155^{***}$ & $0.158^{***}$ & $0.064^{**}$ & $-0.071^{**}$ & $-0.183^{***}$ \\
& (1.458) & (1.339) & (1.159) & (1.347) & (1.98) & (3.145) & (4.518) & (4.827) & (2.477) & (-2.526) & (-5.856) \\
AFTER: CG & $-0.074^{*}$ & $-0.066^{*}$ & $-0.073^{**}$ & $-0.058^{*}$ & $-0.053^{}$ & $-0.035^{}$ & $-0.03^{}$ & $-0.037^{}$ & $-0.038^{}$ & $-0.041^{}$ & $-0.004^{}$ \\
& (-1.93) & (-1.793) & (-2.143) & (-1.849) & (-1.207) & (-1.054) & (-1.025) & (-1.172) & (-1.39) & (-1.533) & (-0.192) \\
AT & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ \\
& (3.445) & (3.498) & (3.694) & (3.907) & (4.266) & (4.175) & (4.491) & (4.551) & (4.495) & (4.457) & (4.473) \\
BTM & $-1.098^{***}$ & $-0.917^{***}$ & $-0.768^{***}$ & $-0.647^{***}$ & $-0.47^{***}$ & $-0.359^{***}$ & $-0.369^{***}$ & $-0.376^{***}$ & $-0.353^{***}$ & $-0.357^{***}$ & $-0.38^{***}$ \\
& (-3.898) & (-3.684) & (-3.495) & (-3.316) & (-2.923) & (-2.606) & (-2.799) & (-2.877) & (-2.721) & (-2.6) & (-2.785) \\
CG & $0.247^{***}$ & $0.204^{**}$ & $0.185^{**}$ & $0.114^{}$ & $0.091^{}$ & $0.028^{}$ & $0.007^{}$ & $0.014^{}$ & $0.084^{}$ & $0.088^{}$ & $0.068^{}$ \\
& (2.591) & (2.239) & (2.159) & (1.383) & (1.298) & (0.438) & (0.107) & (0.212) & (1.5) & (1.539) & (1.183) \\
REV & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ \\
& (-5.245) & (-5.129) & (-5.263) & (-5.325) & (-5.598) & (-5.515) & (-5.679) & (-5.683) & (-5.655) & (-5.574) & (-5.484) \\
N & 15120 & 14648 & 14760 & 15040 & 15472 & 15104 & 15104 & 15312 & 15584 & 14680 & 14704 \\
$R^2$ & 0.183 & 0.181 & 0.18 & 0.176 & 0.182 & 0.181 & 0.182 & 0.185 & 0.191 & 0.199 & 0.214 \\ Adj $R^2$ & 0.179 & 0.178 & 0.176 & 0.172 &
0.179 & 0.178 & 0.179 & 0.182 & 0.188 & 0.195 & 0.21 \\\midrule
\gmc{12}{l}{Dependent Variable: Cash and Cash Equivalents/Sale}
\\\midrule
AFTER & $-0.962^{***}$ & $-0.99^{***}$ & $-0.772^{***}$ & $-0.785^{***}$ & $-0.768^{***}$ & $-0.72^{***}$ & $-0.628^{***}$ & $-0.662^{***}$ & $-0.74^{***}$ & $-0.566^{***}$ & $-0.409^{***}$ \\
& (-3.227) & (-4.115) & (-3.624) & (-3.598) & (-3.548) & (-3.604) & (-3.557) & (-3.845) & (-4.198) & (-3.351) & (-2.584) \\
AFTER:CG & $0.148^{}$ & $0.195^{}$ & $0.189^{}$ & $0.46^{*}$ & $0.374^{}$ & $0.496^{**}$ & $0.388^{}$ & $0.411^{*}$ & $0.235^{}$ & $0.216^{}$ & $0.209^{}$ \\
& (0.338) & (0.564) & (0.711) & (1.883) & (1.343) & (2.114) & (1.625) & (1.847) & (1.253) & (1.226) & (1.229) \\
AT & $0^{**}$ & $0^{*}$ & $0^{*}$ & $0^{*}$ & $0^{*}$ & $0^{*}$ & $0^{*}$ & $0^{**}$ & $0^{***}$ & $0^{***}$ & $0^{***}$ \\
& (-2.146) & (-1.875) & (-1.798) & (-1.805) & (-1.803) & (-1.663) & (-1.744) & (-2.023) & (-2.732) & (-2.955) & (-3.211) \\
BTM & $-2.588^{**}$ & $-2.041^{*}$ & $-1.817^{**}$ & $-1.373^{*}$ & $-0.946^{}$ & $-0.835^{}$ & $-0.713^{}$ & $-0.823^{**}$ & $-0.893^{**}$ & $-0.799^{**}$ & $-0.825^{***}$ \\
& (-1.983) & (-1.849) & (-2.028) & (-1.742) & (-1.508) & (-1.631) & (-1.644) & (-2.154) & (-2.541) & (-2.282) & (-2.612) \\
CG & $-0.069^{}$ & $-0.21^{}$ & $-0.311^{}$ & $0.015^{}$ & $-0.734^{}$ & $-0.859^{*}$ & $-0.619^{}$ & $-0.592^{}$ & $-0.027^{}$ & $-0.041^{}$ & $-0.058^{}$ \\
& (-0.105) & (-0.309) & (-0.52) & (0.028) & (-1.38) & (-1.824) & (-1.479) & (-1.518) & (-0.09) & (-0.141) & (-0.216) \\
REV & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ & $0^{}$ \\
& (-0.305) & (-0.397) & (-0.389) & (-0.417) & (-0.507) & (-0.873) & (-0.933) & (-0.96) & (-0.743) & (-0.608) & (-0.447) \\
N & 15440 & 15016 & 15128 & 15392 & 15808 & 15424 & 15448 & 15648 & 15968 & 15048 & 15072 \\
$R^2$ & 0.11 & 0.116 & 0.111 & 0.107 & 0.11 & 0.12 & 0.12 & 0.126 & 0.131 & 0.137 & 0.144 \\ Adj $R^2$ & 0.106 & 0.112 & 0.107 & 0.103 &
0.106 & 0.116 & 0.116 & 0.123 & 0.127 & 0.133 & 0.14 \\
\end{longtable}
\end{ThreePartTable}
\end{landscape}
\end{document}
答案2
根据您使用的 latex 变体(latex、pdflatex、xelatex 等),规范的方法是旋转表格,并在必要时将其最小化。
你可能\usepackage{graphicx}
需要\usepackage{graphics}
\resizebox{\textwidth}{!}{
\begin{tabularx}
…
\end{tabularx}}
可能会有用。