MWE와 동일한 형식을 사용하여 이 테이블을 생성하는 방법은 무엇입니까?

MWE와 동일한 형식을 사용하여 이 테이블을 생성하는 방법은 무엇입니까?

아래와 같이 레이아웃을 사용합니다.

\documentclass{article}

\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}

\begin{document}
\begin{center}
    \begin{tblr}{ colspec = {Q[l, mode=math] Q[c, si={table-format=-1.4}]},
                  row{1}  = {guard, mode=text},
                 row{2-Z} = {rowsep=0pt},
                  row{2}  = {abovesep=2pt},
                 row{odd[3-Z]} = {belowsep=0.5ex},
                }
    \toprule
Expression  &   Value   \\
     \toprule
a^2 + b^2   & -1.2345       \\
a^2 + b^2   & -1.2345       \\
a^2 + b^2   & -1.2345       \\
a^2 + b^2   & -1.2345       \\
a^2 + b^2   & -1.2345       \\
    \bottomrule
    \end{tblr}
\end{center}
\end{document}

다음 테이블을 어떻게 만들 수 있나요?

\documentclass{article}
    
    \usepackage{tabularray}
    \UseTblrLibrary{booktabs, siunitx}
    
    \begin{document}
\begin{center}
\captionof{table}{Parameter values used in numerical simulations of system.}
\label{tab1}
\begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|c}
\hline
 & \beta & \mu & \alpha_{1} & p_{1} & \phi & \xi & \psi & p_{2} & p_{3} & \theta & \alpha_{2} \\
\hline
\hline
State 1  & 0.2 & 0.2 & 0.12 & 0.11 & 0.1 & 0.11 & 0.1 & 0.12 & 0.11 & 0.1 & 0.1\\
\hline
State 2  & 0.21 & 0.22 & 0.11 & p_{1} & 0.1 & 0.11 & 0.12 & 0.1 & 0.11 & 0.1 & 0.11\\
\hline
\end{tabular}
\end{center}
\end{document}

여기에 이미지 설명을 입력하세요

답변1

테이블에 대한 소개 텍스트를 읽는 데 도움이 됩니다. 또한 사용된 패키지 문서를 읽는 것도 도움이 됩니다. 패키지에는 tabularray간결하고 매우 명확한 문서가 있습니다. 읽어볼 가치가 매우 높습니다.

편집하다:
아, 테이블 캡션을 잊어버렸네요. 이제 추가되었습니다 ...

\documentclass{article}
\usepackage[skip=1ex, font=small, labelfont=bf]{caption}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}

\begin{document}
    \begin{table}[ht]
    \centering
\caption{Parameter values used in numerical simulations of system.}
\begin{tblr}{hlines, vline{2-Y}=solid,
             colspec = {l *{11}{Q[c, si={table-format=1.2}]}},
             cell{1}{2-Z}  = {guard, mode=math},
             }
        & \beta & \mu   & \alpha_1  & p_1   & \phi  & \xi   & \psi  & p_2   & p_3   & \theta    & \alpha_2  \\
State 1 & 0.2   & 0.2   & 0.12      & 0.11  & 0.1   & 0.11  & 0.1   & 0.12  & 0.11  & 0.1       & 0.1       \\
State 2 & 0.21  & 0.22  & 0.11      & \SetCell{guard, c, $} p_1   
                                            & 0.1   & 0.11  & 0.12  & 0.1   & 0.11  & 0.1       & 0.11      \\
\end{tblr}
    \end{table}
\end{document}

여기에 이미지 설명을 입력하세요

관련 정보