このコマンドがあるテーブルがあります。
\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}%
修正できないLaTeXエラーが発生し、それを消す必要があります
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
最初の 2 つの列 ( r
) と ( c
) と次の 2 つの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
paragraph
p
c
center
l
left
{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}