라텍스 오류: 패키지 배열 오류: 잘못된 프리암 토큰(3.5cm): c' 사용됨

라텍스 오류: 패키지 배열 오류: 잘못된 프리암 토큰(3.5cm): c' 사용됨

이 명령이 포함된 테이블이 있습니다.

\begin{table}[ht]
  \centering
  \centering\caption{Table features}
\begin{tabular}{ r{3.5cm} p{5.50cm} p{5.50cm} }
\toprule
          & \multicolumn{1}{r}{} & \textbf{Income components } & \textbf{Determined in GETTSIM tax and transfer model?} \\
    \midrule
    \textbf{1} & \multicolumn{1}{r}{} & \textbf{Earned income} & No \\
          & +     & Self-employed income & No \\
          & +     & Capital income & No \\
          & +     & Rental income & No \\
          & +     & Other incomes (pensions)* & No \\
    \textbf{2} & - & \textbf{Social security contributions} & Yes \\
          & \multicolumn{1}{r}{} & \textbf{ (Old-age pensions+ employee unemployment insurance+ employee health insurance)} & \multicolumn{1}{r}{} \\
          & -     & Income tax & Yes \\
          & -     & Capital income tax & Yes \\
          & -     & Alimony advance payments & Yes \\
    \textbf{3} & +     & \textbf{Child benefit} & Yes \\
          & +     & Child-raising allowance (Child enhanced or additional Income) & Yes \\
          & +     & Unemployment benefits (no endogen. labor supply) & Yes \\
          & +     & Maternity allowance & Yes \\
    \textbf{4} & +     & \textbf{Housing allowance (HA)} & Yes \\
          & +     & Supplementary child allowance & Yes \\
          & +     & Social assistance for employable persons (SGB II) & Yes \\
          & +     & Social assistance for unemployable persons (SGB XII) & No \\
          & =     & \textbf{Net household income} & No \\
    \bottomrule
    \end{tabular}%

  {\raggedright \textit{Notes}:  \footnotesize \*{*}Nevertheless, the model predicts the (updated earning points for pension claims). This table refers to the latest features at the time of writing this paper, end of 2021. Supplementary child benefits (Kinderzuschlag) is also referred to as Child Enhanced or Additional Income.\par}
  \label{Tab:table1}
\end{table}%

수정할 수 없는 라텍스 오류가 발생하여 사라지게 해야 합니다.

Package array Error: Illegal pream-token (3.5cm): `c' used.

./main.tex, 881‬
See the array package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.881 ...{tabular}{ r{3.5cm} p{5.50cm} p{5.50cm} }
                                              
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

내 서문에 배열 관련 부분이 있습니다.

\usepackage{array}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}}

답변1

r{3.5cm}오류입니다. 그것은 단지 r또는 입니다 p{3.5cm}. 아마도 당신이 원하는 것은

 \begin{tabular}{ rc p{5.50cm} p{5.50cm} }

귀하의 페이지 레이아웃을 모르기 때문에 무엇이 적합한지는 모르겠지만 다음과 같은 것을 시도해 보는 것이 좋습니다.

\documentclass{article}
\usepackage{array,booktabs,tabularx,threeparttablex}
\begin{document}
\begin{table}[ht]
  \centering
  \begin{threeparttable}
    \caption{Table features}
    \begin{tabularx}\linewidth{ >{\bfseries} rc XX }
      \toprule
      & & \textbf{Income components } & \textbf{Determined in GETTSIM tax and transfer model?} \\
      \midrule
      1 & & \textbf{Earned income} & No \\
      & +     & Self-employed income & No \\
      & +     & Capital income & No \\
      & +     & Rental income & No \\
      & +     & Other incomes (pensions)\tnote{*} & No \\
      2 & - & \textbf{Social security contributions} & Yes \\
      & & \textbf{ (Old-age pensions+ employee unemployment insurance+ employee health insurance)} & \\
      & -     & Income tax & Yes \\
      & -     & Capital income tax & Yes \\
      & -     & Alimony advance payments & Yes \\
      3 & +     & \textbf{Child benefit} & Yes \\
      & +     & Child-raising allowance (Child enhanced or additional Income) & Yes \\
      & +     & Unemployment benefits (no endogen. labor supply) & Yes \\
      & +     & Maternity allowance & Yes \\
      4 & +     & \textbf{Housing allowance (HA)} & Yes \\
      & +     & Supplementary child allowance & Yes \\
      & +     & Social assistance for employable persons (SGB II) & Yes \\
      & +     & Social assistance for unemployable persons (SGB XII) & No \\
      & =     & \textbf{Net household income} & No \\
      \bottomrule
    \end{tabularx}
    
    \footnotesize
    \begin{tablenotes}[para]
      \item[] \textit{Notes}
      \item[*] Nevertheless, the model predicts the (updated earning points for pension claims). This table refers to the latest features at the time of writing this paper, end of 2021. Supplementary child benefits (Kinderzuschlag) is also referred to as Child Enhanced or Additional Income.
    \end{tablenotes}
    \label{Tab:table1}
  \end{threeparttable}
\end{table}
\end{document}

열 은 X각각 사용 가능한 너비의 절반으로 설정됩니다. 여기서 총 너비에는 \linewidth처음 두 열( r) 및 ( c)과 두 번째 두 X열이 모두 포함됩니다.

패키지를 사용하면 tabularx이 기능을 사용할 수 있습니다.

메모를 돕기 위해 또는 을 사용 threeparttable합니다 threeparttablex. 이렇게 하면 간격이 더 넓어지고 표시를 올바르게 조판하기가 더 쉬워집니다.

마지막으로 패키지 에서 를 >{\bfseries}r사용하여 해당 열의 모든 셀을 굵게 표시합니다. 이렇게 하면 마음이 바뀌어도 더 쉽게 소스 코드가 덜 복잡해집니다.>array

[안타깝게도 Okular-on-X 버그로 인해 이미지를 볼 수 없으므로, 결과를 보고 싶으시면 컴파일하거나 출력물을 상상해 보시기 바랍니다.]

답변2

\begin{tabular}{ r{3.5cm} p{5.50cm} p{5.50cm} } r수단 에서는 right의 인수에 의해 주어진 길이를 p의미합니다 . for 및 for 를 사용할 수도 있습니다 . 단락에만 인수가 있을 수 있으므로 이후 코드에는 구문 오류가 있습니다.paragraphpccenterlleft{3.5cm}r

답변3

테이블의 tabularx전체 목표 너비가 자동인 기반 설정을 채택할 것을 제안하고 싶습니다 .\textwidth굵은 글씨\addlinespace열 1에는 자동 수학 모드가 있고 열 2에는 자동 수학 모드가 있습니다. 또한 주요 정보 그룹 사이에 명령을 통해 수직 공백을 제공하십시오 .

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

\documentclass{article}
\usepackage{tabularx,booktabs}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}

\begin{document}
\begin{table}[ht]

\caption{Table features} \label{Tab:table1}

\smallskip
\begin{tabularx}{\textwidth}{@{}
    >{\bfseries}l %% automatic **bold-facing**
    >{$}c<{$}     %% automatic math mode
    P{7cm} % allow automatic line-breaking
    >{\raggedright\arraybackslash}X @{}}

\toprule
& & \textbf{Income components} & \textbf{Determined in GETTSIM tax and transfer model?} \\
\midrule
1 &   & \textbf{Earned income} & No \\
  & + & Self-employed income & No \\
  & + & Capital income & No \\
  & + & Rental income & No \\
  & + & Other incomes (pensions)* & No \\
\addlinespace

2 & - & \textbf{Social security contributions} & Yes \\
  &   & (Old-age pensions + employee unemployment insurance + employee health insurance) &  \\
  & - & Income tax & Yes \\
  & - & Capital income tax & Yes \\
  & - & Alimony advance payments & Yes \\
\addlinespace

3 & + & \textbf{Child benefit} & Yes \\
  & + & Child-raising allowance (Child enhanced or additional Income) & Yes \\
  & + & Unemployment benefits (no endogen. labor supply) & Yes \\
  & + & Maternity allowance & Yes \\
\addlinespace

4 & + & \textbf{Housing allowance (HA)} & Yes \\
  & + & Supplementary child allowance & Yes \\
  & + & Social assistance for employable persons (SGB II) & Yes \\
  & + & Social assistance for unemployable persons (SGB XII) & No \\
\addlinespace

  & = & \textbf{Net household income} & No \\
\bottomrule
\end{tabularx}

\smallskip
\raggedright 
\footnotesize
* Nevertheless, the model predicts the (updated earning points for pension claims). 

\textit{Notes}: This table refers to the latest features at the time of writing this paper, end of 2021. Supplementary child benefits (Kinderzuschlag) is also referred to as Child Enhanced or Additional Income.
  
\end{table}%

\end{document}

관련 정보