表格问题:有一列未显示

表格问题:有一列未显示

我创建了一个表格,它有四列十五行。但是,有些问题,角度列:0,10,20,30,40,.... 120 没有显示。

documentclass[%
 preprint,
 doublecolumn
%superscriptaddress,
%groupedaddress,
%unsortedaddress,
%runinaddress,
%frontmatterverbose, 
%preprint
%preprintnumbers,
%nofootinbib,
%nobibnotes,
%bibnotes,
 amsmath,amssymb,
 aps,
%pra,
prc,
%rmp,
%prstab,
%prstper,
%floatfix,
]{revtex4-2}
\usepackage{anyfontsize}
\usepackage{float}
\usepackage{mathtools, nccmath}
\usepackage{graphicx}% Include figure files
\usepackage{tabularx}
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
%\usepackage{hyperref}% add hypertext capabilities
\usepackage[mathlines]{lineno}% Enable numbering of text and display math
\usepackage{amsmath}
\linenumbers\relax % Commence numbering lines
%\usepackage{latexsym}
%\usepackage[showframe,%Uncomment any one of the following lines to test 
%%scale=0.7, marginratio={1:1, 2:3}, ignoreall,% default settings
%%text={7in,10in},centering,
%%margin=1.5in,
%%total={6.5in,8.75in}, top=1.2in, left=0.9in, includefoot,
%%height=10in,a5paper,hmargin={3cm,0.8in},
%]{geometry}

\begin{document}
\begin{table}
\caption{This table contains Cobalt's count rate:$R(\theta)$, count rate without background:$Y(\theta)$, and normalized count rate:$\frac{Y(\theta)}{Y(0)}$ their uncertainties. To obtain $R(\theta)$, divide "C" from Table.~\ref{Co_Count} by measured time, and its corresponding uncertainty:$\sigma R(\theta)$ is $\sigma C$ over time. For $\Y(\theta)$, subtract background count rate from$R(\theta)$. Its corresponding uncertainty is calculated by using Eq.~(\ref{eq:two}). Normalized count rate is divide $Y(\theta)$ by Y(0). Its uncertainty is from Eq.~(\ref{eq:one})}

\begin{ruledtabular}
\begin{tabular}{lcrr} 
\textrm{$\theta$}& \textrm{$R(\theta)\pm \sigma R(\theta)$ }& \textrm{$Y(\theta) \pm \sigma {Y(\theta)}$} & \textrm{$\frac{Y(\theta)}{Y(0)}$ $\pm \sigma$ $\frac{Y(\theta)}{Y(0)}$ }\\
\textrm{($^{\circ}$)}&\textrm{$\frac{Count}{second}$}&\texrm{$\frac{Count}{second}$}& \\
\colrule
0& 2.970$\pm$0.070 &2.967$\pm$0.070&1.000$\pm$0.033
10&2.774$\pm$0.068 & 2.771$\pm$0.068&0.934$\pm$0.032
20&2.800$\pm$0.068 & 2.797$\pm$0.068&0.943$\pm$0.032
30&2.526$\pm$0.065 & 2.523$\pm$0.065&0.850$\pm$0.030
40&2.401$\pm$0.063 & 2.398$\pm$0.063&0.808$\pm$0.029
50&2.399$\pm$0.063 & 2.396$\pm$0.063&0.808$\pm$0.029
60&2.066$\pm$0.059 & 2.063$\pm$0.059&0.695$\pm$0.026
70&2.174$\pm$0.060 & 2.171$\pm$0.060&0.732$\pm$0.027
80&2.161$\pm$0.060 & 2.157$\pm$0.060&0.727$\pm$0.027
90&2.091$\pm$0.059 & 2.088$\pm$0.059&0.704$\pm$0.026
100&2.187$\pm$0.060 & 2.184$\pm$0.060&0.736$\pm$0.027
110&2.272$\pm$0.062 & 2.269$\pm$0.062&0.765$\pm$0.033
120&2.181$\pm$0.060 & 2.177$\pm$0.060&0.734$\pm$0.027
\end{tabular}
\end{ruledtabular}
\end{table}
\end{document)

提前谢谢您。您能解释一下 lcrr 是什么意思吗?

答案1

在此处输入图片描述

\documentclass{article}
\usepackage[tmargin=1cm]{geometry}
\usepackage{tabulary,booktabs}
\begin{document}
\begin{table*}
\centering
\begin{tabular}{cccc}
\toprule
\textrm{$\theta$}& \textrm{$R(\theta)\pm \sigma R(\theta)$ }& \textrm{$Y(\theta) \pm \sigma {Y(\theta)}$} & \textrm{$\frac{Y(\theta)}{Y(0)}$ $\pm \sigma$ $\frac{Y(\theta)}{Y(0)}$ }\\
\textrm{($^{\circ}$)}&\textrm{$\frac{Count}{second}$}&\texrm{$\frac{Count}{second}$}& \\

\midrule
0& 2.970$\pm$0.070 &2.967$\pm$0.070&1.000$\pm$0.033\\
10&2.774$\pm$0.068 & 2.771$\pm$0.068&0.934$\pm$0.032\\
20&2.800$\pm$0.068 & 2.797$\pm$0.068&0.943$\pm$0.032\\
30&2.526$\pm$0.065 & 2.523$\pm$0.065&0.850$\pm$0.030\\
40&2.401$\pm$0.063 & 2.398$\pm$0.063&0.808$\pm$0.029\\
50&2.399$\pm$0.063 & 2.396$\pm$0.063&0.808$\pm$0.029\\
60&2.066$\pm$0.059 & 2.063$\pm$0.059&0.695$\pm$0.026\\
70&2.174$\pm$0.060 & 2.171$\pm$0.060&0.732$\pm$0.027\\
80&2.161$\pm$0.060 & 2.157$\pm$0.060&0.727$\pm$0.027\\
90&2.091$\pm$0.059 & 2.088$\pm$0.059&0.704$\pm$0.026\\
100&2.187$\pm$0.060 & 2.184$\pm$0.060&0.736$\pm$0.027\\
110&2.272$\pm$0.062 & 2.269$\pm$0.062&0.765$\pm$0.033\\
120&2.181$\pm$0.060 & 2.177$\pm$0.060&0.734$\pm$0.027\\
\bottomrule
\end{tabular}
\end{table*}
\end{document}

答案2

  • 我会考虑我以前的问题的答案,特别是如果它们包含内容解释、如何写表格、我在哪里犯了错误以及它们是否解决了我(残差)问题的全部或至少部分(桌子看起来丑陋
  • 在这样的表格中,我将使用所有可用的工具,按照 SI(国际单位制,参见示例)来书写不确定性维基百科) 标准,尤其是如果它们为我的表格提供更短且一致的代码。这样的工具是siunitx具有关于使用 SI 单位的出色文档的软件包

在此处输入图片描述

上表生成的MWE(Minimal Working Example)为:

\documentclass[twocolumn]{revtex4-2}
\usepackage{nccmath, mathtools, amssymb}
\usepackage{makecell}
\usepackage{siunitx}

\begin{document}
\begin{table}
  \caption{This table contains Cobalt's count rate: $R(\theta)$,
         count rate without background: $Y(\theta)$, and normalized count rate:
         $Y(\theta)/Y(0)$ their uncertainties. To obtain $R(\theta)$,
         divide "C" from Table.~\ref{Co_Count} by measured time,
         and its corresponding uncertainty: $\sigma R(\theta)$ is $\sigma C$ over time.
         For $Y(\theta)$, subtract background count rate from $R(\theta)$.
         Its corresponding uncertainty is calculated by using Eq.~(\ref{eq:two}).
         Normalized count rate is divide $Y(\theta)$ by Y(0).
         Its uncertainty is from Eq.~(\ref{eq:one})
         }
  \label{tab:cobalt}
  \centering
\sisetup{table-format=1.3(2),
         table-figures-uncertainty=6,
         separate-uncertainty} 
\setcellgapes{3pt}
\makegapedcells
  \begin{tabular}{ S[table-format=3.0] @{\quad} *3{S} }
    \colrule
{$\theta$}    
   &   {$R(\theta) \pm \sigma R(\theta)$}
        &   {$Y(\theta) \pm \sigma Y(\theta)$} 
            &   {$\mfrac{Y(\theta)}{Y(0)} \pm \sigma\mfrac{Y(\theta)}{Y(0)}$}   \\
{\si{\degree}} 
    &   {$\mfrac{\text{Count}}
                {\text{second}}$}
        &   {$\mfrac{\text{Count}}
                    {\text{second}}$}
            &                                       \\

    \colrule
0   &   2.970(70)   &   2.967(70)   &   1.000(33)   \\
10  &   2.774(68)   &   2.771(68)   &   0.934(32)   \\
20  &   2.800(68)   &   2.797(68)   &   0.943(32)   \\
30  &   2.526(65)   &   2.523(65)   &   0.850(30)   \\
40  &   2.401(63)   &   2.398(63)   &   0.808(29)   \\
50  &   2.399(63)   &   2.396(63)   &   0.808(29)   \\
60  &   2.066(59)   &   2.063(59)   &   0.695(26)   \\
70  &   2.174(60)   &   2.171(60)   &   0.732(27)   \\
80  &   2.161(60)   &   2.157(60)   &   0.727(27)   \\
90  &   2.091(59)   &   2.088(59)   &   0.704(26)   \\
100 &   2.187(60)   &   2.184(60)   &   0.736(27)   \\
110 &   2.272(62)   &   2.269(62)   &   0.765(33)   \\
120 &   2.181(60)   &   2.177(60)   &   0.734(27)   \\
    \colrule
  \end{tabular}
\end{table}
\end{document}

笔记:

  • 在 MWE 的 MWE 序言中,仅考虑与表格相关的包
  • 您的问题通过正确终止表行来解决。这已在您上一个问题的答案中强调过。
  • c, l,r是列类型含义中心左边正确的列内容的对齐。通过它们来指定表格。在您的例子中,lcrr这意味着您的表格有四列,其中第一列有左边对齐单元格的内容,在第二个单元格中的内容是居中最后两栏有正确的对齐内容。有关详细信息,请参阅wiki LaTeX 表格

    如您所见,在建议的解决方案中,我们使用S列类型来代替它们。它们能够将单元格中的数字按小数点对齐,并能够简单地写入报告测量值的公差/不确定性。

答案3

一些观察和评论:

  • 必须提供\\(“双反斜杠”)指令来指示换行应该发生的位置。输入填充中的换行符是不够的。

  • 你问,“你能解释一下什么lcrr意思吗?”我假设你指的是这句话

    \begin{tabular}{lcrr}
    

    LaTeX 内核设置了几种在tabulararray环境中使用的列类型。其中包括lcr,分别代表向左对齐,C输入,并且r分别是光对齐。

    对于您的表格,我看不出有任何理由使用 来r表示任何列。我会将其用于c数据列。

  • 一定要删除诸如\textrm“包装器”之类的无用代码。它们除了增加代码混乱之外什么也不做。

  • 由于环境的所有内容tabular都处于数学模式,因此我不会使用tabular环境。而是使用环境array

  • 目前,只有那些喜欢受罚的人才会仔细阅读您的表格。请始终记住,如果人们注意到您已经努力组织了想要呈现的信息,他们就更有可能关注您。

    将此标准应用于整个table环境,我认为将图例和表格材料组织得更具吸引力是一个好主意。当然,不要只是将图例以长而曲折的标题的形式“倾倒”到读者的头脑中。相反,要使标题简短而活泼,例如,\caption{Count rates}并将图例组织成普通的连续文本:使用段落分隔符并使用完整的句子。

    array不要在(或) 环境中显示 13 行无结构的实心数字tabular,而是通过在每四行或五行后添加一些空格来提供一些视觉趣味。或者,使用S列类型(由包提供siunitx)将第一列中的数字与其(隐式)小数标记对齐。

在此处输入图片描述


\documentclass[twocolumn, % the option is "twocolumn", NOT "doublecolumn"
    amsmath,amssymb,aps,prc]{revtex4-2}
%% Simplified the preamble to include just the bare minimum needed:
\usepackage{booktabs} % for \toprule, \midrule, \bottomrule
\usepackage{siunitx}  % for 'S' column type
\usepackage{ragged2e} % for '\justifying' command

\begin{document}

\begin{table}
\caption{Count rates}

\justifying 
This table contains Cobalt's count rate, $R(\theta)$, the count rate without 
background, $Y(\theta)$, and the normalized count rate, $Y(\theta)/Y(0)$, 
along with their uncertainties. 

To obtain $R(\theta)$, divide ``C'' from Table~\ref{Co_Count} by measured 
time; its corresponding uncertainty, $\sigma R(\theta)$, is $\sigma C$ over 
time. For $Y(\theta)$, subtract background count rate from $R(\theta)$; its 
corresponding uncertainty is calculated by using Eq.~(\ref{eq:two}). The 
normalized count rate is $Y(\theta)$ divided by~$Y(0)$; its uncertainty is 
from Eq.~(\ref{eq:one}).

\medskip % insert a bit of vertical whitespace
\centering
$\begin{array}{@{} S[table-format=3.0] ccc @{}} 
\toprule
{\theta} & 
R(\theta)\pm \sigma R(\theta) & 
Y(\theta) \pm \sigma Y(\theta) & 
\frac{Y(\theta)}{Y(0)} \pm \sigma \frac{Y(\theta)}{Y(0)} \\[1ex]
{[^{\circ}]} 
& \bigl[\frac{\text{Count}}{\text{second}}\bigr] 
& \bigl[\frac{\text{Count}}{\text{second}}\bigr] 
& \\
\midrule
  0 & 2.970\pm0.070 & 2.967\pm0.070 & 1.000\pm0.033\\
 10 & 2.774\pm0.068 & 2.771\pm0.068 & 0.934\pm0.032\\
 20 & 2.800\pm0.068 & 2.797\pm0.068 & 0.943\pm0.032\\
 30 & 2.526\pm0.065 & 2.523\pm0.065 & 0.850\pm0.030\\
 40 & 2.401\pm0.063 & 2.398\pm0.063 & 0.808\pm0.029\\
 \addlinespace
 50 & 2.399\pm0.063 & 2.396\pm0.063 & 0.808\pm0.029\\
 60 & 2.066\pm0.059 & 2.063\pm0.059 & 0.695\pm0.026\\
 70 & 2.174\pm0.060 & 2.171\pm0.060 & 0.732\pm0.027\\
 80 & 2.161\pm0.060 & 2.157\pm0.060 & 0.727\pm0.027\\
 \addlinespace
 90 & 2.091\pm0.059 & 2.088\pm0.059 & 0.704\pm0.026\\
100 & 2.187\pm0.060 & 2.184\pm0.060 & 0.736\pm0.027\\
110 & 2.272\pm0.062 & 2.269\pm0.062 & 0.765\pm0.033\\
120 & 2.181\pm0.060 & 2.177\pm0.060 & 0.734\pm0.027\\
\bottomrule
\end{array}$
\end{table}
\end{document}

相关内容