表中的长变量名

表中的长变量名

我在表格中有一个很长的变量名(第一列,第三行),有什么方法可以将变量分成两行吗?这是我的表格:

% Tabla 6 test de tendencia paralela
\begin{table}[htbp]
\footnotesize
\begin{adjustwidth}{-1in}{-1in} %
\centering
\caption{Test de tendencia paralela}
\begin{tabular}{lccc}
\toprule
      & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} \\
Variables & \multicolumn{1}{c}{Número de Operaciones NB} & \multicolumn{1}{c}{Desembolsos  PPML} & \multicolumn{1}{c}{Crédito Promedio PPML} \\
    \midrule
      & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\
Tratamiento & \multicolumn{1}{c}{0.09} & \multicolumn{1}{c}{-0.28} & \multicolumn{1}{c}{-0.13} \\
      & \multicolumn{1}{c}{(0.17)} & \multicolumn{1}{c}{(0.49)} & \multicolumn{1}{c}{(0.33)} \\
Distancia entre localidad y sucursal (Km) & \multicolumn{1}{c}{-0.75***} & \multicolumn{1}{c}{-3.60***} & \multicolumn{1}{c}{-1.69***} \\
      & \multicolumn{1}{c}{(0.18)} & \multicolumn{1}{c}{(1.01)} & \multicolumn{1}{c}{(0.46)} \\
Recaudación IVA (log) & \multicolumn{1}{c}{0.17} & \multicolumn{1}{c}{0.17} & \multicolumn{1}{c}{0.44**} \\
      & \multicolumn{1}{c}{(0.14)} & \multicolumn{1}{c}{(0.2)} & \multicolumn{1}{c}{(0.19)} \\
Tasa de desempleo & \multicolumn{1}{c}{-3.53} & \multicolumn{1}{c}{-2.97} & \multicolumn{1}{c}{3.3} \\
      & \multicolumn{1}{c}{(3.55)} & \multicolumn{1}{c}{(6.34)} & \multicolumn{1}{c}{(5.62)} \\
Crédito familias (log) & \multicolumn{1}{c}{-0.12} & \multicolumn{1}{c}{-0.40*} & \multicolumn{1}{c}{-0.41**} \\
      & \multicolumn{1}{c}{(0.09)} & \multicolumn{1}{c}{(0.24)} & \multicolumn{1}{c}{(0.19)} \\
Constante      & \multicolumn{1}{c}{} & \multicolumn{1}{c}{6.73***} & \multicolumn{1}{c}{3.19**} \\
                & \multicolumn{1}{c}{} & \multicolumn{1}{c}{(1.76)} & \multicolumn{1}{c}{(1.33)} \\
    \bottomrule
    \multicolumn{4}{l}{\textsuperscript{}\footnotesize{Período: septiembre 2011 a abril de 2012. Errores clúster a nivel de localidad. *** p<0.01, ** p<0.05, * p<0.1}}
\end{tabular}%
    \label{tab:paralela}%
\end{adjustwidth}
\end{table}%

答案1

我认为你应该做以下事情:

  • 摆脱所有\multicolumn{1}{c}{...}“包装”

  • 使用包(例如包dcolumn)将第 2、3 和 4 列中的数字数据与小数点对齐

  • 使用tabularx环境,将宽度设置为\textwidth,而不是tabular

  • 慷慨地使用\addlinespace指令。

在此处输入图片描述

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}

\usepackage{booktabs,tabularx,ragged2e,dcolumn,caption} 
\newcolumntype{C}{>{\Centering\arraybackslash \hspace{0pt}}X}
\newcolumntype{d}[1]{D{.}{,}{#1}}
% handy shortcut macros
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}
\newcommand\MC[1]{\multicolumn{1}{C}{#1}}

\begin{document}

\begin{table}
\small
\caption{Test de tendencia paralela} \label{tab:paralela}
\begin{tabularx}{\textwidth}{@{} l *{3}{d{2.4}} @{}}
\toprule
Variables & \mc{(1)} & \mc{(2)} & \mc{(3)} \\ 
          & \MC{Número de Operaciones NB} 
          & \MC{Desembolsos  PPML} 
          & \MC{Crédito Promedio PPML} \\
\midrule
\addlinespace
Tratamiento            & 0.09 & -0.28 & -0.13 \\
                       & (0.17) & (0.49) & (0.33) \\
\addlinespace
Distancia entre localidad & -0.75^{***} & -3.60^{***} & -1.69^{***} \\
\quad y sucursal (km)     & (0.18) & (1.01) & (0.46) \\
\addlinespace
Recaudación IVA (log)  & 0.17 & 0.17 & 0.44^{**} \\
                       & (0.14) & (0.2) & (0.19) \\
\addlinespace
Tasa de desempleo      & -3.53 & -2.97 & 3.3 \\
                       & (3.55) & (6.34) & (5.62) \\
\addlinespace
Crédito familias (log) & -0.12 & -0.40^{*} & -0.41^{**} \\
                       & (0.09) & (0.24) & (0.19) \\
\addlinespace
Constante              &  & 6.73^{***} & 3.19^{**} \\
                       &  & (1.76) & (1.33) \\
\bottomrule
\addlinespace
\multicolumn{4}{@{}l}{\footnotesize Período: septiembre 2011 a abril de 2012. Errores clúster a nivel de localidad.}\\
\multicolumn{4}{@{}l}{\footnotesize ${}^{***}\ p<0.01$; ${}^{**}\ p<0.05$; ${}^{*} p<0.1$}\\
\end{tabularx}
\end{table}
\end{document}

答案2

我认为长名字是Distancia entre localidad y sucursal (Km)

首先,您必须l通过更改位置p{'width'},宽度等于所需的列宽,然后写入以下内容:

Distancia entre \newline localidad y sucursal (Km)

相关内容