表格宽度超出页面范围,请问有什么建议吗?生成的代码如下:
\documentclass[a4paper, 12pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{tabulary}
\usepackage{tabularx}
\usepackage{varioref}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage[svgnames,table]{xcolor}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{mathpazo}
\usepackage{eucal}
\usepackage{mathrsfs}
\usepackage{lmodern}
\usepackage{cuted}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{array}
\usepackage[justification=centering]{caption}
\usepackage[english]{babel}
\usepackage{siunitx}
\usepackage[onehalfspacing]{setspace}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{rotating}
\usepackage{siunitx}
\usepackage{xparse,xstring}
\usepackage{varioref}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref}
\crefname{equation}{eq.}{eq.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareRobustCommand{\variablename}[1]{\mathop{\textnormal{\slshape #1}}\nolimits}
\newcommand{\COVID}{\variablename{COVID\_19}}
\newcommand{\China}{\variablename{F\_China}}
\newcommand{\World}{\variablename{F\_World}}
\newcommand{\ln}{\variablename{\ln}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\Plus{\texttt{+}}
\def\Minus{\texttt{-}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{table}[htbp]
\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Summary of Sign restrictions}
\label{tab1}
\begin{tabular}{l*{8}{c}}
\toprule
&F^{Ener}_{t}& F^{Prec_m}_{t}& F^{Ind_m}_{t}& F^{Agr}_{t}} & F^{Live_s}_{t}&
R^{\COVID}_{\substack{World}}& F^{China}_{j,t} & R^{\COVID}_{\substack{China}} \\
\midrule
Foreign Energy Price &\Plus&\Plus&\Plus&\times&\times&\times&\times \\
\midrule
Foreign Precious metals Price& \Plus&\Plus&\Minus&\Minus&\Minus&\times&\times \\
\midrule
Foreign Industrial metals Price & \Plus&\Plus&\Minus&\Minus&\Minus&\times&\times \\
\midrule
Foreign Agricultural Price & \Plus&\Plus&\Minus&\Minus&\Minus&\times&\times \\
\midrule
Foreign Livestock Price & \Plus&\Plus&\Minus&\Minus&\Minus&\times&\times \\
\midrule
World $R^{\COVID}_{\substack{World}}$ & \Plus&\Plus&\Minus&\Minus&\Minus&\times&\times \\
\midrule
China Domestic factors & \Plus&\Plus&\Minus&\Minus&\Minus&\times&\times \\
\midrule
China $R^{\COVID}_{\substack{China}}$ & \Plus&\Plus&\Minus&\Minus&\Minus&\times&\times \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
答案1
您可以将标题横过来。该rotating
包提供了一个环境\begin{sideways}...\end{sideways}
\documentclass[a4paper, 12pt]{article}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{rotating}
\newcommand\sw[1]{\begin{sideways}$#1$\end{sideways}}
\DeclareRobustCommand{\variablename}[1]{\mathop{\textnormal{\slshape #1}}\nolimits}
\newcommand{\COVID}{\variablename{COVID\_19}}
\def\Plus{\texttt{+}}
\def\Minus{\texttt{-}}
\begin{document}
\noindent
\begin{tabular}{l*{8}{c}}
\toprule
&\sw{F^{Ener}_{t}}& \sw{F^{Prec_m}_{t}}& \sw{F^{Ind_m}_{t}}& \sw{F^{Agr}_{t}}
&\sw{F^{Live_s}_{t}}& \sw{R^{\COVID}_{\substack{World}}}& \sw{F^{China}_{j,t}} & \sw{R^{\COVID}_{\substack{China}}} \\
\midrule
Foreign Energy Price &\Plus&\Plus&\Plus&$\times$&$\times$&$\times$&$\times$ \\
\midrule
Foreign Precious metals Price& \Plus&\Plus&\Minus&\Minus&\Minus&$\times$&$\times$ \\
\midrule
Foreign Industrial metals Price & \Plus&\Plus&\Minus&\Minus&\Minus&$\times$&$\times$ \\
\midrule
Foreign Agricultural Price & \Plus&\Plus&\Minus&\Minus&\Minus&$\times$&$\times$ \\
\midrule
Foreign Livestock Price & \Plus&\Plus&\Minus&\Minus&\Minus&$\times$&$\times$ \\
\midrule
World $R^{\COVID}_{\substack{World}}$ & \Plus&\Plus&\Minus&\Minus&\Minus&$\times$&$\times$ \\
\midrule
China Domestic factors & \Plus&\Plus&\Minus&\Minus&\Minus&$\times$&$\times$ \\
\midrule
China $R^{\COVID}_{\substack{China}}$ & \Plus&\Plus&\Minus&\Minus&\Minus&$\times$&$\times$ \\
\bottomrule
\end{tabular}
\end{document}
答案2
一个可以接受的折衷方案可能是:
\begin{tabular}{>{\raggedright}m{90pt}*{8}{c}} % changed <<<
\toprule
& $F^{Ener}_{t}$ & $ F^{Prec_m}_{t}$ & $F^{Ind_m}_{t}$ & $ F^{Agr}_{t} $ & $ F^{Live_s}_{t}$ & $R^{\COVID}_{\substack{World}}$ & $ F^{China}_{j,t}$ & $ R^{\COVID}_{\substack{China}}$ \\
\midrule
Foreign Energy Price & \Plus & \Plus & \Plus & \times & \times & \times & \times \\
\midrule
Foreign Precious metals Price & \Plus & \Plus & \Minus & \Minus & \Minus & \times & \times \\
\midrule
Foreign Industrial metals Price & \Plus & \Plus & \Minus & \Minus & \Minus & \times & \times \\
\midrule
Foreign Agricultural Price & \Plus & \Plus & \Minus & \Minus & \Minus & \times & \times \\
\midrule
Foreign Livestock Price & \Plus & \Plus & \Minus & \Minus & \Minus & \times & \times \\
\midrule
World $R^{\COVID}_{\substack{World}}$ & \Plus & \Plus & \Minus & \Minus & \Minus & \times & \times \\
\midrule
China Domestic factors & \Plus & \Plus & \Minus & \Minus & \Minus & \times & \times \\
\midrule
China $R^{\COVID}_{\substack{China}}$ & \Plus & \Plus & \Minus & \Minus & \Minus & \times & \times \\
\bottomrule
\end{tabular}
(添加\def\times{\texttt{x}}
到序言中。)