
ほぼ適切に配置できましたが、右端のセルは上部の罫線にぴったりと収まっているのに対し、左端と中央のセルには垂直方向のスペースが少しあります。配置を均一にしようとしています (垂直方向のスペースを削除するか、行全体で一貫性を持たせます)。
\parbox{}
複数行の式をテーブル内に含め、テーブル内で水平に揃えることができるようにするために使用しました。
\begin{table}[h]
\caption{Title of Table.}
\begin{tabularx}{\linewidth}{p{1.4cm} p{6.9cm} p{6.8cm}}
\toprule
Head1 & Head2 & Head3 \\
\midrule
text & text text text text & \parbox{6.8cm}{$BZ, CY, CX, BZ, BX, AY, AZ, \\ CY, CZ, \ldots$ } \\
\bottomrule
\end{tabularx}
\end{table}
また、これが重要な場合に備えて、APA 形式の表の序文に次の内容を記載します。
\DeclareCaptionLabelSeparator*{spaced}{\\[2ex]}
\captionsetup[table]{textfont=it,format=plain,justification=justified,
singlelinecheck=false,labelsep=spaced,skip=0pt}
\captionsetup[figure]{labelsep=period,labelfont=it,justification=justified,
singlelinecheck=false,font=doublespacing}
答え1
何を達成したいのかが明確ではないので、完全かつ最小限の例を示す必要があります。
とにかく、tabularray
:
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\usepackage{caption}
\DeclareCaptionLabelSeparator*{spaced}{\\[2ex]}
\captionsetup[table]{textfont=it,format=plain,justification=justified,
singlelinecheck=false,labelsep=spaced,skip=0pt}
\captionsetup[figure]{labelsep=period,labelfont=it,justification=justified,
singlelinecheck=false,font=doublespacing}
\begin{document}
\begin{table}[h]
\caption{Title of Table.}
\begin{tblr}{colspec={Q[1.4cm]Q[6.9cm]X[mode=math]}}
\toprule
Head1 & Head2 & Head3 \\
\midrule
text & text text text text & {BZ, CY, CX, \\ BZ, BX, AY,\\ AZ, CY, CZ, \ldots} \\
\bottomrule
\end{tblr}
\end{table}
\end{document}
答え2
環境が適切に機能するには、 -columntabularx
の使用が必要であることに注意してください。 -column がない場合、通常の を使用する方がよいでしょう。次に、変更しようとしているのは、インライン数式要素のリストは の周囲で分割できないことです。(たとえば) のコンテンツを使用して、その管理方法を変更する必要があります。X
tabular
,
「インライン数式モードで ',' で改行を許可する」と引用が分割される:
\documentclass{article}
\usepackage{tabularx,booktabs}
% https://tex.stackexchange.com/a/19100/5764
\mathchardef\breakingcomma\mathcode`\,
{\catcode`,=\active
\gdef,{\breakingcomma\discretionary{}{}{}}
}
\newcommand{\mathlist}[1]{\mathcode`\,=\string"8000 #1}
\begin{document}
\begin{table}
\caption{Table caption}
\begin{tabularx}{\linewidth}{ p{14mm} p{69mm} X }
\toprule
Head1 & Head2 & Head3 \\
\midrule
text & text text text text & $\mathlist{BZ, CY, CX, BZ, BX, AY, AZ, CY, CZ, \ldots}$ \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
答え3
https://tex.stackexchange.com/a/467445/197451
\documentclass{article}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{multirow}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\renewcommand\tabularxcolumn[1]{m{#1}}
\begin{document}
\begin{table}[h]
\caption{Title of Table.}
\setlength{\extrarowheight}{2pt}
\begin{tabularx}{\linewidth}{ccC}
\toprule
Head1 & Head2 & Head3 \\
\midrule
text & text text text text &{{\parbox{3cm}{$BZ, CY, CX, BZ, BX,\\ AY,
AZ, CY, CZ, \ldots$ }}} \\
\bottomrule
\end{tabularx}
\end{table}
\begin{table}[h]
\caption{Title of Table.}
\begin{tabularx}{\textwidth}{ccC}
\toprule
Head1 & Head2 & Head3 \\
\midrule
text & text text text text & {{$BZ, CY, CX, BZ, BX, AY, AZ, CY, CZ,
\ldots$ }} \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
答え4
複数行のテキストを含むボックスのベースライン\parbox
は、最下行のベースラインと同じであるため、ボックス全体がベースラインより上に過度に高くなります。このようなボックスは、ベースラインではなく上部に揃えられるため、上記のルールに沿って表示されます。
解決策は、テキストの最初の行に「ストラット」を追加して、最上行の (仮想の) ベースラインが他の列のベースラインと揃うようにすることです。Plain TeX では、このためにマクロとが用意されてい\strut
ます\mathstrut
。
text & \strut text text text text &
$\mathlist{\mathstrut BZ, CY, CX, BZ, BX, AY, AZ, CY, CZ, \ldots}$ \\