Latex threeparttable表笔记宽度

时间:2016-10-18 18:24:27

标签: latex

我的三部分笔记有问题,因为它们不知道我的桌子的整个宽度。有谁能够帮我?提前谢谢你了! 这是我使用的代码:

\documentclass[11pt, oneside]{article}       
\usepackage{geometry}                        
\geometry{letterpaper}                          
\usepackage{graphicx}               
\usepackage{lscape}
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage[flushleft]{threeparttable}
\usepackage{longtable}
\usepackage{array}
\usepackage{pdflscape}
\usepackage{tabularx}
\usepackage{adjustbox}
\pagenumbering{gobble}
\usepackage{booktabs}
\begin{document}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{table}
\scalebox{0.6}{
\begin{threeparttable}
\begin{tabularx}
\textwidth{lccccccccc}
& \textbf{Neonatal}  &   \textbf{Infant}  &  \textbf{Low}  \\
& \textbf{Mortality}  &   \textbf{Mortality}  &  \textbf{Birthweight}  & \textbf{Stunting}  &  \textbf{Underweight}  &\\
\multicolumn{10}{c}{\noindent\rule{18cm}{0.4pt}}\\
\textit{Mother is between 17 and 19 yrs} &     -0.00517*** &  -0.00857*** &   -0.00896** &  -0.0487*** &  -0.0315*** \\
& [0.001]   & [0.002]   & [0.004]   & [0.005] &  [0.004]  \\ 
\multicolumn{10}{c}{\noindent\rule{18cm}{0.2pt}}\\
\textbf{N} &  752543    &        574609   &  399845   &      501520  &   512482 \\
\multicolumn{10}{c}{\noindent\rule{18cm}{0.4pt}}\\
\end{tabularx}
\begin{tablenotes}
\item Results are from the main results regressions (4).  ***, ** and * denote   significance at the 1\%, 5\%, and 10\% levels, respectively. Std. Errors in square brackets and are clustered at PSU level.
\end{tablenotes}
\end{threeparttable}
}
\end{table}
}

\end{document}  

1 个答案:

答案 0 :(得分:0)

我知道距您的问题已经有好几年了,我现在正在学习创建表,这就是我找到这个问题的方式。 我认为您通过声明10个列混淆了三部分表包,而实际上只有6个列。为什么不尝试使用6列,然后以某种方式换行头和长单元格呢?

\documentclass[11pt, oneside]{article}       
\usepackage{geometry}                        
\geometry{letterpaper}                          
\usepackage{graphicx}               
\usepackage{lscape}
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage[flushleft]{threeparttable}
\usepackage{longtable}
\usepackage{array}
\usepackage{pdflscape}
\usepackage{tabularx}
\usepackage{adjustbox}
\pagenumbering{gobble}
\usepackage{booktabs}


\usepackage{makecell}
\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}


\begin{document}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{table}
\scalebox{0.8}{
\begin{threeparttable}
\begin{tabularx}
{16.5cm}{lccccc}
{} & \thead{Neonatal \\ Mortality}  &   \thead{Infant \\ Mortality}  &  \thead{Low \\ Birthweight}  & \thead{Stunting}  &  \thead{Underweight} \\
\midrule
{\shortstack[l]{\textit{Mother is between} \\ \textit{17 and 19 yrs}}} &     {\shortstack[c]{ $-0.00517$*** \\  $[0.001] $ }} &  {\shortstack[c]{$ -0.00857$*** \\ $[0.002] $}} &   {\shortstack[c]{$ -0.00896$** \\ $[0.004]$}} &  {\shortstack[c]{$ -0.0487$*** \\ $[0.005]$}} &  {\shortstack[c]{$-0.0315$*** \\ $[0.004]$}} \\
 \midrule
\textbf{N} &  752543    &        574609   &  399845   &      501520  &   512482 \\
\midrule
\end{tabularx}
\begin{tablenotes}
\item Results are from the main results regressions (4).  ***, ** and * denote   significance at the 1\%, 5\%, and 10\% levels, respectively. Std. Errors in square brackets and are clustered at PSU level.
\end{tablenotes}
\end{threeparttable}
}
\end{table}
}