首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >切线\tabularx{}

切线\tabularx{}
EN

Stack Overflow用户
提问于 2022-06-01 11:06:15
回答 1查看 138关注 0票数 1

下面有个密码。我想删除突出显示部分之前的空白。

代码语言:javascript
复制
 \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}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-01 11:09:50

  • Log Damage X Log Adaptation太长,不能容纳单个细胞。最简单的解决方法是手动将短语的第二部分移到下一行。

如果使用的是

  • ,则应至少使用一个X列,以确保表能够适应可用的空间

  • I将在前面和后面使用@{},以消除额外的空间

为了使

  • 更容易阅读表,我会在

块之间添加一些额外的垂直空间

  • 你在滥用可怜的X作为乘法符号吗?别这样!

  • 语法\tiny{...}是错误的。这是一个转换,不需要争论。使用{\tiny ...}代替.

  • 缺少< signs

的数学模式

  • 大多数表应该处于数学模式以获得正确的减号和适当的运算符间距,但我太懒于在下面的示例中添加这一点.

代码语言:javascript
复制
 \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}

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72460770

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档