表格問題:一列未顯示

表格問題:一列未顯示

我創建了一個表,其中有四列和十五行。然而,有點點,角度欄: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(最小工作範例)為:

\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環境中使用。其中l, c, 和r, 分別代表左對齊,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}

相關內容