表格末尾的文字

表格末尾的文字

我的表格遇到了另一个问题,我想在表格末尾添加一条长注释。我写的代码是:

\documentclass{article}
\usepackage{rotating}
\usepackage{xcolor}
\renewcommand{\baselinestretch}{1.3}
\setlength{\topmargin}{0cm}
\setlength{\oddsidemargin}{0.1cm}
\setlength{\leftmargin}{1cm}
\setlength{\textwidth}{15.5cm}
\setlength{\textheight}{23.0cm}
\begin{document}
\begin{sidewaystable}
\centering
\footnotesize{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{\textbf{Subjective Freedom and Preferences for Redistribution - Alternative Instruments}\label{table8}} 
\begin{tabular}{l*{9}{c}}
\hline\hline 
&\multicolumn{4}{c}{\textbf{Fst Stage}}&\multicolumn{2}{c}{\textbf{Snd Stage}}&\multicolumn{1}{c}{\textbf{LL}}&\multicolumn{1}{c}{\textbf{$\rho$=0}} &\multicolumn{1}{c}{\textbf{Obs.}}\smallskip \\
 &\multicolumn{1}{c}{\textbf{First Lag SF}}&\multicolumn{1}{c}{\textbf{Second Lag SF}}&\multicolumn{1}{c}{\textbf{Settler}}&\multicolumn{1}{c}{\textbf{Genetic}}&\multicolumn{1}{c}{\textbf{SF}}&\multicolumn{1}{c}{\textbf{Fairness}}& & &\\
 &\multicolumn{1}{c}{\textbf{(Country Average)}}&\multicolumn{1}{c}{\textbf{(Country Average)}}&\multicolumn{1}{c}{\textbf{Mortality}}&\multicolumn{1}{c}{\textbf{Distance}}&& &&&\\
\hline \noalign{\medskip}
1. Using second lag of SF &0.017***&0.013**{\textcolor{white}{*}}& & &0.010***&0.188***&-46,770.27&-0.071***&98,673 \medskip \\
2. Using rate of settler mortality &0.071***& &-0.018***&  &0.010***&0.180***&-50,073.15&-0.035***&98,673 \medskip \\ 
3. Using genetic distance &0.083***& &-0.016***&-0.051*** &0.010***&0.181***&-49,175.98 
&-0.038***&98,673 \medskip \\
4. Using latitude &0.003*{\textcolor{white}{**}}& & & &0.010***&0.208***&-65,841.53 
&-0.073***&98,673 \medskip \\
5. Endogenous SF &0.015***& & & &0.010***&0.208***&-210,549.47  
&-0.068***&98,673 \\
\hline\hline
\multicolumn{10}{l}{\footnotesize Notes: ***, ** and * denote significance at 1\%, 5\% and 10\%, respectively. In model 1, we include the second lag of subjective freedom as a country average. In model, reported in row 2, we add the log of settler mortality to the first lag of subjective freedom. In model 3, we augment model 2, by adding the log of genetic distance. In this case, we use US as reference country. In model reported in row 4 we drop the continent dummy and we include the (log) of latitude, measured as the distance of capital city to the Equator. Finally, in model 5 we endogeneize subjective freedom using the lag of average SF in a country. }\\
\multicolumn{10}{l}{\footnotesize Standard errors in parentheses}\\
\end{tabular}}
\end{sidewaystable}
\end{document}

主要问题是文本没有跟在表格末尾,但它却非常长。有什么方法可以写一个脚注,使其保持在表格的宽度之内吗?

答案1

我已部分重新设计了您的表格以适合纵向模式的页面,使用tabularx这些X列占据了所有可用空间;请注意允许这样做的启动命令:

\begin{tabularx}{\textwidth}{...}

您可以填写剩余的内容。下面的注释已作为常规文本添加,但我认为这不会给您带来任何问题。如果有问题,请随时发表评论。

另外,请记住使用geometry包来设置边距。

输出

example image

代码

\documentclass[12pt]{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage{rotating}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{booktabs, array, multirow}
\usepackage{tabularx}

\newcolumntype{Y}{>{\centering\let\newline\\\arraybackslash}X}
\newcolumntype{Z}{>{\raggedright\bfseries\let\newline\\\arraybackslash}p{3cm}}
\newcolumntype{C}{>{\centering\bfseries\arraybackslash}m{5mm}}

\begin{document}
\begin{table}\footnotesize
\captionsetup{justification=centering,margin=1cm}
\centering
\caption{\bfseries Subjective Freedom and Preferences for Redistribution  Alternative Instruments}
\label{table8}
{\renewcommand{\arraystretch}{2}
\begin{tabularx}{\textwidth}{CZYYYYY}
% header
\toprule
& & Using second lag of SF & Using rate of settler mortality & Using genetic distance & Using latitude & Endogenous SF \\ 
\midrule
\multirow{5}{*}{\rotatebox{90}{1st Stage}} & First Lag SF\newline\tiny{Country average} & & \\
    & Second Lag SF\newline\tiny{Country average} & & \\
    & Settler Mortality & & \\
    & Genetic Distance & & \\ \midrule
\multirow{2}{*}{\rotatebox{90}{2nd Stage}}    & SF & & \\
    & Fairness & & \\ \midrule
    & LL & & \\
    & $p=0$ & & \\
\bottomrule
\end{tabularx}}
\end{table}\noindent
{\footnotesize Standard errors in parentheses. \\
\textbf{Notes:} ***, ** and * denote significance at 1\%, 5\% and 10\%, respectively. In model 1, we include the second lag of subjective freedom as a country average. In model, reported in row 2, we add the log of settler mortality to the first lag of subjective freedom. In model 3, we augment model 2, by adding the log of genetic distance. In this case, we use US as reference country. In model reported in row 4 we drop the continent dummy and we include the (log) of latitude, measured as the distance of capital city to the Equator. Finally, in model 5 we endogeneize subjective freedom using the lag of average SF in a country.}
\end{document}

答案2

我使用我回答您上一篇文章时使用的工具完成了此操作。我添加了threeparttable表格注释以及siunitx表格中数字的格式和对齐方式:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{rotating}
\usepackage{caption, booktabs, makecell, threeparttable, siunitx}
\usepackage{eqparbox}
\renewcommand\theadfont{\bfseries}
\captionsetup{font=bf}
\sisetup{group-separator={,}, table-format=1.3, table-space-text-post=***, table-number-alignment =center}
\usepackage{xcolor}
\renewcommand{\baselinestretch}{1.3}
\setlength{\topmargin}{0cm}
\setlength{\oddsidemargin}{0.1cm}
\setlength{\leftmargin}{1cm}
\setlength{\textwidth}{15.5cm}
\setlength{\textheight}{23.0cm}

\begin{document}

\begin{sidewaystable}
  \newcounter{rownum}\setcounter{rownum}{0}
  \setlength\defaultaddspace{1.25ex}
  %setlength\tabcolsep{4pt}
  \centering\footnotesize
  \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
  %
  \begin{threeparttable}
    \caption{Subjective Freedom and Preferences for Redistribution – Alternative Instruments}\label{table8}
    \begin{tabular}{>{\refstepcounter{rownum}\eqmakebox[R][r]{\therownum.}\hskip\labelsep}lS S *{2}{S[table-format=-1.3]}*{2}{S}S[table-format=-6.2,table-space-text-post={}] S[table-format=-1.3] S[table-format=5.0, table-space-text-post={}]}
      \toprule\midrule
      \multicolumn{1}{c}{}&\multicolumn{4}{c}{\textbf{First Stage}}&\multicolumn{2}{c}{\textbf{Second Stage}}&\multicolumn{1}{c}{\textbf{LL}}& {\boldmath $\rho = 0$} &{\bfseries Obs.}\\
      \cmidrule(lr){2-5}\cmidrule(lr){6-7}
      \multicolumn{1}{c}{} & {\thead{First Lag SF & & & & & & & & \\(Country Average)}} &{ \thead{Second Lag SF\\(Country Average)}} & {\thead{Settler\\Mortality}} & {\thead{Genetic\\Distance}} & {\thead{SF}} & {\thead{Fairness}}& & &\\
      \cmidrule(lr){1-10}
      \addlinespace
      Using second lag of SF & 0.017*** & 0.013**{\textcolor{white}{*}} & & & 0.010*** & 0.188*** & -46 770.27 & -0.071*** & 98673 \medskip \\
      Using rate of settler mortality & 0.071*** & & -0.018*** & & 0.010*** & 0.180*** & -50073.15 & -0.035*** & 98673 \\
      \addlinespace
      Using genetic distance &0.083***& &-0.016***&-0.051*** &0.010***&0.181***&-49175.98
      &-0.038***&98673\\
      \addlinespace
      Using latitude &0.003*{\textcolor{white}{**}}& & & &0.010***&0.208***&-65841.53
      &-0.073***&98673\\
      \addlinespace
      Endogenous SF &0.015***& & & &0.010***&0.208***&-210549.47
      &-0.068***&98673 \\
      \midrule\bottomrule
      \addlinespace
    \end{tabular}
    \begin{tablenotes}
      \item[]Notes: ***, ** and * denote significance at 1\,\%, 5\,\% and 10\,\%, respectively. In model 1, we include the second lag of subjective freedom as a country average. In model, reported in row 2, we add the log of settler mortality to the first lag of subjective freedom. In model 3, we augment model 2, by adding the log of genetic distance. In this case, we use US as reference country. In model reported in row 4 we drop the continent dummy and we include the (log) of latitude, measured as the distance of capital city to the Equator. Finally, in model 5 we endogeneize subjective freedom using the lag of average SF in a country.
      \item[] Standard errors in parentheses
    \end{tablenotes}
  \end{threeparttable}
\end{sidewaystable}
\end{document} 

enter image description here

相关内容