설명 섹션이 포함된 표

설명 섹션이 포함된 표

이 테이블을 그리려고 할 때 xltabular 패키지에 문제가 있습니다. 다른 테이블을 만들려고 할 때 문제가 발생합니다. 결과는 첫 번째 테이블과 같지만 메인 텍스트에서 패키지를 삭제하면 테이블이 완성됩니다. 그럼 이 패키지를 사용하지 않고도 할 수 있나요? 첫 번째 테이블의 코드

{

\begin{xltabular}{\linewidth}{ l | X }
  \caption{Data description  of dependent \& independent variables.}
 \label{table: vardescription}\\
 \hline \hline

\textbf{\normalsize Variable} & \textbf{\normalsize Description}  \\
 \hline
\endfirsthead
 \hline \hline

\textbf{Excess  returns} & In this research, our main goal is in showing the directional predictability, where the \textbf{dependent variable} is the dummy sign return indicator.
\[ 
\mathit{Excess\ return} =
  \begin{cases}
    1,  \quad\text{if the excess returns is } >0\\
    0, \quad\text{if the excess returns is } < 0 
  \end{cases}
\]
\\ \hline

\textbf{Recession} &
The recession defined by the \textbf{NBER} are used.
\[ \mathit{Recession} =
  \begin{cases}
    1,  \quad\text{if the  economy is in a recession},\\
     0, \quad\text{if the economy  is in an expansion}
  \end{cases}
\]
\\ \hline

\textbf{Dividend to price} & Dividends from past year divided by closing value of index at month end.
      \\[0ex]\hline
\textbf{Earning to price} & Earnings over the past year divided by closing value of index at month end.
     \\[0ex]\hline
\textbf{Term spread} & The 10 year US Treasury Bill less 3 month US Treasury Bill. \\ \hline
\end{xltabular}
}
\begin{table}[htbp]\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{This is the heading}
\caption*{\footnotesize Smaller note of table that describes what the table is all about.}
\begin{tabular}{l*{3}{c}}
\toprule
                &\multicolumn{1}{c}{(1)}   &\multicolumn{1}{c}{(2)}   &\multicolumn{1}{c}{(3)}   \\
                &     Base   &   Robust   &  Cluster   \\
\midrule
Size            &-0.000645   &-0.000645   &-0.000645   \\
                &  (-0.83)   &  (-0.83)   &  (-0.39)   \\
\midrule
Observations    &     5035   &     5035   &     5035   \\
\bottomrule
\multicolumn{4}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\multicolumn{4}{l}{\footnotesize * p<0.10, ** p<0.05, *** p<0.01}\\
\end{tabular}
\end{table}

패키지가 포함된 이 테이블 두 번째 테이블의 결과

답변1

나에게는 관련 패키지를 로드하는 것이 잘 작동합니다. 몇 가지 작은 개선 사항과 코드 단순화를 추가했습니다.

\documentclass{article}
\usepackage{xltabular, booktabs}
\usepackage{mathtools} 
\usepackage{siunitx} 

\begin{document}

\begin{xltabular}{\linewidth}{ l | >{\arraybackslash}X }
 \caption{Data description of dependent \& independent variables.}
 \label{table: vardescription}\\
 \hline \hline
%
\textbf{\normalsize Variable} & \textbf{\normalsize Description} \\
 \hline
\endfirsthead
 \hline \hline
%
\textbf{Excess returns} & In this research, our main goal is in showing the directional predictability, where the \textbf{dependent variable} is the dummy sign return indicator.
\[ \textit{Excess\ return} =
 \begin{cases*}
 1, & if the excess returns is $ >0 $,\\
 0, & if the excess returns is $ < 0 $. 
 \end{cases*} \]
\\ \hline
\textbf{Recession} &
The recession defined by the \textbf{NBER} are used.
\[ \textit{Recession} =
 \begin{cases*}
 1, & if the economy is in a recession,\\
 0, & if the economy is in an expansion.
 \end{cases*}\]
\\ \hline
\textbf{Dividend to price} & Dividends from past year divided by closing value of index at month end.
 \\[0ex]\hline
\textbf{Earning to price} & Earnings over the past year divided by closing value of index at month end.
 \\[0ex]\hline
\textbf{Term spread} & The 10 year US Treasury Bill less 3 month US Treasury Bill. \\ \hline
\end{xltabular}

\end{document} 

여기에 이미지 설명을 입력하세요

관련 정보