
4개의 열이 있는 테이블을 만들려고 하는데 테이블이 다소 보기 흉해 보입니다.
\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{ruledtabular}
\begin{tabular}{lcr}
\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)}$ }\\
\colrule
0& 2.970$\pm$
10&2.774$\pm$
20&2.800$\pm$
30&2.526$\pm$
40&2.401$\pm$
50&2.399$\pm$
60&2.066$\pm$
70&2.174$\pm$
80&2.161$\pm$
90&2.091$\pm$
100&2.187$\pm$
110&2.272$\pm$
120&2.181$\pm$
\end{tabular}
\end{ruledtabular}
\end{table}
\end{document}
이 테이블을 생성하면 해당 부분이 표시됩니다.
\textrm{$\frac{Y(\theta)}{Y(0)}$ $\pm \sigma$ $\frac{Y(\theta)}{Y(0)}$ }
다른 곳에 있습니다. 도와주세요?
귀하의 지원에 진심으로 감사드립니다.
답변1
게시된 코드에는 두 가지 심각한 문제와 덜 심각한 문제가 있습니다.
성명 은 있지만 성명
\end{table}
은 없습니다\begin{table}
.선언은
\begin{tabular}{lcr}
세 개의 열만 설정하므로 정확할 수 없습니다. 반면 테이블의 헤더만 열에 대한 기능을 갖습니다. 을 고용하는 것이 좋습니다\begin{tabular}{lccc}
.라인
\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)}$ }\\
완전히 불필요한 래퍼가 4개 이상 포함되어 있습니다
\textrm
. 그들을 제거.문서 클래스 옵션은
doublecolumn
사용되지 않습니다. 사실, 실수일 수도 있나요? 옵션을 사용해야 할까요twocolumn
?테이블이 보기 흉할까봐 걱정된다면 (a) 옵션을 제거하고 (b) 환경과 매크로를
preprint
사용하지 않는 것을 고려해야 합니다 . 대신 패키지를 로드하고 , 및 사용 방법을 알아보세요 . 그리고 수많은 기호를 입력할 필요 없이 a에서 환경으로 전환 하세요 .ruledtabular
\colrule
booktabs
\toprule
\midrule
\bottomrule
tabular
array
$
\documentclass[%preprint,
twocolumn,
%doublecolumn -- does this option exist?!
amsmath,amssymb,aps,prc]{revtex4-2}
% I've omitted the entire remainder of your preamble
% since none of its instructions get used in this MWE
% (minimum working example).
\usepackage{booktabs} % for \toprule, \midrule, \bottomrule macros
\usepackage{siunitx} % for 'S' column type
\begin{document}
\begin{table}
\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)}\\
\midrule
0 & 2.970\pm{}\\
10 & 2.774\pm{}\\
20 & 2.800\pm{}\\
30 & 2.526\pm{}\\
40 & 2.401\pm{}\\
50 & 2.399\pm{}\\
60 & 2.066\pm{}\\
70 & 2.174\pm{}\\
80 & 2.161\pm{}\\
90 & 2.091\pm{}\\
100 & 2.187\pm{}\\
110 & 2.272\pm{}\\
120 & 2.181\pm{}\\
\bottomrule
\end{array}$
\end{table}
\end{document}
답변2
댓글에 올리기에는 너무 큽니다 :-)
나는 당신이 다음과 같은 것을 찾고 있다고 추측합니다.
(표에 있는 대부분의 숫자는 더미입니다.)
코드에 문제가 많고 심각한 오류가 있습니다(참조:미코 답변). 쓰기 테이블에 더 익숙해지려면 예를 들어 소개 텍스트를 참조하세요.LaTeX/테이블.
위의 쇼브 테이블의 경우 MWE는 다음과 같습니다.
\documentclass[twocolumn]{revtex4-2}
\usepackage{nccmath, mathtools, amssymb}
\usepackage{array, makecell}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\[
\setcellgapes{3pt}
\makegapedcells
\begin{array}{rccc}
\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)} \\
\colrule
0 & 2.970 \pm 123 & 2.970 \pm 123 & 2.970 \pm 123 \\
10 & 2.774 \pm 123 & 2.774 \pm 123 & 2.774 \pm 123 \\
\colrule
\end{array}
\]
\lipsum[2]
\end{document}
이는 테이블을 다시 작성하려는 노력의 출발점이 될 수 있습니다. 모든 셀이 수학 모드에 있으므로 array
방정식 환경에 캡슐화된 테이블을 사용합니다.
답변3
다음Zarko의 MWE, 그러나 siunitx
텍스트 모드에서는 다음과 같습니다.
\documentclass{standalone}
\usepackage{nccmath, mathtools, amssymb}
\usepackage{array, booktabs, siunitx}
\usepackage{microtype}
\begin{document}
\sisetup{
separate-uncertainty,
table-format = 1.3(1),
}
%% don't forget to undo it:
\setlength{\tabcolsep}{12pt}
\begin{tabular}{rSSS[table-align-uncertainty = false]}
\midrule
0 & 2.970 \pm 123 & 2.970 \pm 123 & 2.970 \pm 123 \\
10 & 2.774 \pm 123 & 2.774 \pm 123 & 2.774 \pm 123 \\
\bottomrule
\end{tabular}
\end{document}
또한보십시오이것을 위한 \tabcolsep
.