\tabularx{} 中的线切割

Line cut in \tabularx{}

我有下面的代码。我想删除突出显示部分之前的白色 space 。

 \documentclass[10pt,english,8pt]{beamer}
\usetheme{default}
\usepackage{booktabs}
\usepackage{tabularx}
%\newcommand{\iid}{\stackrel{\mathrm{iid}}{\sim}}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{R}{>{\raggedright\arraybackslash}X}
\newcolumntype{L}{>{\raggedleft\arraybackslash}X}


\title{Beamer Template}
\author{TeXstudio Team}
\begin{document}


\begin{frame}{Frame Title}

    \begin{table}[htbp]
        %\begin{table}[!ht]
        \centering
        \scriptsize
        %\caption{Title }
        \label{tab:5}
        \begin{tabularx}{1\textwidth}
            {>{\raggedright\arraybackslash}p{2cm}
                >{\centering\arraybackslash}p{1.75cm}
                >{\centering\arraybackslash}p{1.75cm}
                >{\centering\arraybackslash}p{1.75cm}
                >{\centering\arraybackslash}p{1.75cm}
            }
            %\multicolumn{11}{@{}p{1\textwidth}@{}}{\footnotesize 
                %   Caption }\
            \toprule 
            
            & Log Probability of Default & Log Recovery Rate
            & Log Spread & Log Leverage  \ [0.5ex] 
            & (1) & (2) & (3) & (4)  \
            \midrule
            Log Damage 
            &0.017**    &-0.003***   & 0.002 & -0.157    \
            &(0.0008)   &(0.003)   & (0.075) & (0.178)  \
            Log Adaptation
            &-0.157***  &0.012  &-0.463** & 0.514*** \
            &(0.021)    &(0.007)    &(0.182)    &(0.193)\
            Log Damage X Log Adaptation
            &0.006  &0.018* &-0.398 &0.535 \
            &(0.030) &(0.011) &(0.249) &(0.513)\
            Constant
            &-1.227***&-0.117***&2.244***&0.101\
            &(0.026)&(0.009)&(0.187)&(0.237)\                      
            \midrule
            Observations &926 &925 &458 &177 \
            $R^2$ &41\% &19\% &8\%  &38\%\
            Adjusted $R^2$ &40\%&17\%&4\%&32\%\
            Residual Std. Error 
            & 0.071 &   0.025 & 0.373 & 0.264 \
            & (df = 907) & (df = 906) & (df = 439) & (df = 159)\
            F Statistic 
            & 35.253*** &   11.455*** & 2.104***  & 5.811***  \
            & (df = 18; 907)&   (df = 18; 906)& (df = 18; 439)& (df = 17; 159)\
            
            
            \bottomrule 
            \addlinespace
            \multicolumn{4}{@{}p{0.8\textwidth}@{}}{\footnotesize \tiny{Note: *p<0.1; **p<0.05; ***p<0.01 }} \
        \end{tabularx}
        %\end{table}
    \end{table}
    
\end{frame}

    

\end{document}
  • Log Damage X Log Adaptation 太长,无法放入单个单元格。最简单的解决方法是手动将短语的第二部分移到下一行。

  • 如果您正在使用 tabularx,您应该至少使用一个 X 列以确保 table 可以适应可用的 [=56] =]

  • 我会在其他列的前后使用 @{} 来去掉多余的 space

  • 为了让 table 更容易阅读,我会在块

    之间添加一些额外的垂直 space
  • 你是在把穷人X当乘号来虐吗?不要!

  • 语法 \tiny{...} 错误。它是一个开关,不带参数。请改用 {\tiny ...}

  • < 符号周围缺少数学模式

  • 大部分 table 应该处于数学模式以获得正确的减号和运算符周围的适当间距,但我懒得在下面的示例中添加它......

 \documentclass[10pt,english,8pt]{beamer}
\usetheme{default}
\usepackage{booktabs}
\usepackage{tabularx}

%\newcommand{\iid}{\stackrel{\mathrm{iid}}{\sim}}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{R}{>{\raggedright\arraybackslash}X}
\newcolumntype{L}{>{\raggedleft\arraybackslash}X}


\title{Beamer Template}
\author{TeXstudio Team}
\begin{document}


\begin{frame}{Frame Title}

    \begin{table}[htbp]
        %\begin{table}[!ht]
        \centering
        \scriptsize
        %\caption{Title }
        \label{tab:5}
        \begin{tabularx}{1\textwidth}
            {
                @{}
                >{\raggedright\arraybackslash}X
                >{\centering\arraybackslash}p{1.75cm}
                >{\centering\arraybackslash}p{1.75cm}
                >{\centering\arraybackslash}p{1.75cm}
                >{\centering\arraybackslash}p{1.75cm}
                @{}
            }
            %\multicolumn{11}{@{}p{1\textwidth}@{}}{\footnotesize 
                %   Caption }\
            \toprule 
            
            & Log Probability of Default & Log Recovery Rate
            & Log Spread & Log Leverage  \ [0.5ex] 
            & (1) & (2) & (3) & (4)  \
            \midrule
            Log Damage 
            &0.017**    &-0.003***   & 0.002 & -0.157    \
            &(0.0008)   &(0.003)   & (0.075) & (0.178)  \\addlinespace
            Log Adaptation
            &-0.157***  &0.012  &-0.463** & 0.514*** \
            &(0.021)    &(0.007)    &(0.182)    &(0.193)\\addlinespace
            Log Damage $\times$ 
            &0.006  &0.018* &-0.398 &0.535 \
            Log Adaptation &(0.030) &(0.011) &(0.249) &(0.513)\\addlinespace
            Constant
            &-1.227***&-0.117***&2.244***&0.101\
            &(0.026)&(0.009)&(0.187)&(0.237)\                      
            \midrule
            Observations &926 &925 &458 &177 \
            $R^2$ &41\% &19\% &8\%  &38\%\
            Adjusted $R^2$ &40\%&17\%&4\%&32\%\\addlinespace
            Residual Std. Error 
            & 0.071 &   0.025 & 0.373 & 0.264 \
            & (df = 907) & (df = 906) & (df = 439) & (df = 159)\\addlinespace
            F Statistic 
            & 35.253*** &   11.455*** & 2.104***  & 5.811***  \
            & (df = 18; 907)&   (df = 18; 906)& (df = 18; 439)& (df = 17; 159)\
            
            
            \bottomrule 
            \addlinespace
            \multicolumn{4}{@{}p{0.8\textwidth}@{}}{\footnotesize {\tiny Note: *$p<0.1$; **$p<0.05$; ***$p<0.01$ }} \
        \end{tabularx}
        %\end{table}
    \end{table}
    
\end{frame}

\end{document}