
Estou muito perto de alinhar isso corretamente, mas a célula mais à direita está alinhada com a regra superior, enquanto as células mais à esquerda e ao centro têm uma pequena quantidade de espaço vertical. Estou tentando uniformizar o alinhamento (remover o espaço vertical ou torná-lo consistente em toda a linha).
Eu costumava \parbox{}
permitir que a expressão multilinha estivesse contida e alinhada horizontalmente na tabela.
\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}
Além disso, caso isso seja importante, tenho o seguinte em meu preâmbulo para tabelas formatadas em 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}
Responder1
Não está muito claro o que você deseja alcançar; você deve fornecer um exemplo mínimo completo.
De qualquer forma, com 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}
Responder2
Observe que um tabularx
ambiente requer o uso de uma X
coluna para funcionar corretamente. Sem um, você também pode usar um arquivo tabular
. Em segundo lugar, e o que você deseja alterar, uma lista de elementos matemáticos embutidos não pode ser quebrada ,
. Você terá que mudar a forma como isso é gerenciado usando o conteúdo de (digamos)“Permitir quebra de linha em ',' no modo matemático embutido” quebra citações:
\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}
Responder3
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}
Responder4
A linha de base de um \parbox
com múltiplas linhas de texto é a linha de base de sua linha inferior, dando à caixa inteira uma altura excessiva acima da linha de base. Essa caixa não está alinhada na linha de base, mas na parte superior, fazendo com que pareça alinhada com a regra acima.
A solução é incluir um "suporte" na primeira linha do texto para que a linha de base (imaginária) da linha superior se alinhe com as linhas de base das outras colunas. Plain TeX oferece macros \strut
para \mathstrut
isso.
text & \strut text text text text &
$\mathlist{\mathstrut BZ, CY, CX, BZ, BX, AY, AZ, CY, CZ, \ldots}$ \\
Veja tambémEspaçamento idêntico de linhas de inferência com Bussproofs.