我怎样才能用乳胶制作这样的桌子

我怎样才能用乳胶制作这样的桌子

我怎样才能在文档类回忆录中使用 LaTeX 制作下面的表格。

\begin{xltabular}{\linewidth}{ l | X }
  \caption{Data description  of dependent and 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 using two classifications models, where the \textbf{dependent variable} is the dummy sign return indicator. 

\[ Excess \ return =
  \begin{cases}
    1,  \quad \text{if }\text{ the excess returns is    >   0
,}\\
     0, \quad \text{if }\text{ the excess returns is $\leqslant$ 0  ,}
  \end{cases}
\]
\\ \hline


\textbf{Recession} & 
The recession defined by the \textbf{NBER} are used.

\[ Recession =
  \begin{cases}
    1,  \quad \text{if }\text{the  economy is in a recession,}\\
     0, \quad \text{if }\text{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.
\setlength{\belowdisplayskip}{0pt} \setlength{\belowdisplayshortskip}{0pt}
\setlength{\abovedisplayskip}{0pt} \setlength{\abovedisplayshortskip}{0pt}
\begin{equation}
dp= dp/spindx
\end{equation}
\\ \hline

\textbf{Earning to price} & Earnings over the past year divided by closing value of index at month end.  
\setlength{\belowdisplayskip}{0pt} \setlength{\belowdisplayshortskip}{0pt}
\setlength{\abovedisplayskip}{0pt} \setlength{\abovedisplayshortskip}{0pt}
\begin{equation}
E/P= E/P /spindx
\end{equation}
\\ \hline 
\textbf{Term spread} & The 10 year US Treasury Bill less 3 month US Treasury Bill. \\ \hline 

\end{xltabular}

答案1

{
\setlength\LTcapwidth{\linewidth}
\setlength{\belowdisplayskip}{-1pt} \setlength{\belowdisplayshortskip}{0pt}
\setlength{\abovedisplayskip}{3pt} \setlength{\abovedisplayshortskip}{3pt}
\setcellgapes{3pt}
\makegapedcells
\begin{xltabular}{\linewidth}{ l | X }
  \caption{Data description  of dependent and 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 using two classifications models, 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 } \leqslant 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.
\begin{equation}
dp= dp/spindx
\end{equation}      \\[-2ex]\hline
\textbf{Earning to price} & Earnings over the past year divided by closing value of index at month end.
\begin{equation}
E/P= E/P /spindx
\end{equation}      \\[-1ex]\hline
\textbf{Term spread} & The 10 year US Treasury Bill less 3 month US Treasury Bill. \\ \hline
\end{xltabular}
}

结果是:

在此处输入图片描述

答案2

这个例子怎么样?

在此处输入图片描述

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{hhline}
\usepackage{amsmath, amssymb}

\begin{document}

\begin{table}[ht!]
\centering
\begin{tabular}{p{3cm}|p{8cm}}
\hhline{==}
\textbf{Variable} & \textbf{Description}\\ \hhline{==}
\textbf{Excess returns} & Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit. Aenean commodo ligula 
eget dolor. Aenean massa. Cum sociis natoque penatibus 
et magnis dis parturient montes, nascetur ridiculus mus.  

\[
Excess~return=
\begin{cases}
1, &\mbox{if excess returns is} ~ > 0,\\
0, &\mbox{if excess returns is} ~ \leq 0.
\end{cases}
\]
\\ \hline

\end{tabular}
\end{table}

\end{document}

相关内容