如何固定桌子的位置

如何固定桌子的位置

我想在段落下面放一个表格,代码如下:

\documentclass{article}


\usepackage{ragged2e}
\usepackage{tabularx, makecell}
\setlength{\extrarowheight}{2pt}
\setlength{\tabcolsep}{3pt}%

\begin{document}


\section{Modelling}
We propose a model based on the data described in Chapter 1, with an endpoint and a large number of SNPs. To predict the toxicity, a prediction rule is constructed. We use the maximum likelihood estimator (MLE) and then propose shrinkage estimators to improve the MLE. All shrinkage estimators are formulated in a Bayesian sense. Details on this will follow later.
Important notations used for mathematical convenience are listed in Table \ref{notaion}. Throughout the thesis, the notation $X_i$ represents the \ith SNP, and the notation $X_{ik}, k =1,\ldots,n$, represent the $i$th SNP of the $k$th patient. The endpoint is denoted as $Y$. For conditioning, we will use the symbol "$\mid$". And the probabilities are denoted as "P". 

 \begin{table}
  \FloatBarrier
    \begin{tabular}{l|L{11cm}}
    Symbols  & Description  \\\hline 
    $N$      & The number of SNPs \\ 
    $n$      & The number of patients \\ 
    $X_i$    & $i$th SNP \\ 
    $Y$      & The endpoint  \\
   $\beta_i$   & Effect size for $i$th SNP   \\
    $\mathrm{p}_{i+}$ & The probability of patients having a major allele for $i$th SNP given that              patient experience toxicity \\
  $\mathrm{p}_{i-}$   & The probability of patients having  a minor allele for $i$th SNP given that patient do not experience toxicity \\

   $n_{+}$  &The number of patients experience toxicity \\
   $n_{-}$  &The number of patients do not experience toxicity \\


   $Z_{i+}$ & The number of patient having a major allele for $i$th SNP given that patient             experience toxicity \\
   $Z_{i-}$ & The number of patient having a minor allele for $i$th SNP given that patient do not experience toxicity
   \\\hline
   \end{tabular}
    \caption{List of notations } 
    \label{notaion}
  \end{table}

     \FloatBarrier


\end{document}

然而它显示为

在此处输入图片描述

我怎样才能修复文本下的表格?

答案1

我建议您将[h!]放置偏好说明符添加到table环境中。我还建议您使用tabularx环境,X第二列为。

在此处输入图片描述

\documentclass{article}
\usepackage{ragged2e,tabularx, makecell}
\setlength{\extrarowheight}{2pt}
\setlength{\tabcolsep}{3pt}%

\begin{document}    

\section{Modelling}
We propose a model based on the data described in Chapter~1, with an endpoint and a large number of SNPs. To predict the toxicity, a prediction rule is constructed. We use the maximum likelihood estimator (MLE) and then propose shrinkage estimators to improve the MLE\@. All shrinkage estimators are formulated in a Bayesian sense. Details on this will follow later.

Important notations used for mathematical convenience are listed in Table~\ref{notaion}. Throughout the thesis, the notation~$X_i$ represents the $i$th~SNP, and the notation $X_{ik}$, $k =1,\ldots,n$, represents the $i$th SNP of the $k$th~patient. The endpoint is denoted by~$Y$. For conditioning, we will use the symbol~$\vert$. Probabilities are denoted by~$p$. 

\begin{table}[h!]
\begin{tabularx}{\textwidth}{@{} l>{\raggedright\arraybackslash}X @{}}
    Symbols  & Description  \\\hline 
    $N$      & Number of SNPs \\ 
    $n$      & Number of patients \\ 
    $X_i$    & $i$th SNP \\ 
    $Y$      & Endpoint  \\
    $\beta_i$& Effect size for $i$th SNP   \\
    $\mathrm{p}_{i+}$ & Probability of patients having a major allele for $i$th SNP given that patient experience toxicity \\
    $\mathrm{p}_{i-}$ & Probability of patients having a minor allele for $i$th SNP given that patient do not experience toxicity \\
    $n_{+}$  & Number of patients who experience toxicity \\
    $n_{-}$  & Number of patients who do not experience toxicity \\
    $Z_{i+}$ & Number of patients having a major allele for $i$th SNP given that patients experience toxicity \\
    $Z_{i-}$ & Number of patients having a minor allele for $i$th SNP given that patients do not experience toxicity
    \\
\end{tabularx}
\caption{List of notations } 
\label{notaion}
\end{table}

\end{document}

相关内容