我对 LaTex 还很陌生。
由于表格的第二列和第三列有大量文本,因此行高会增加。如何让第一行(文本不多)的文本垂直地位于中间?我将增加表格,每行将具有不同的高度,我不想每次都指定。
\begin{table}[H]
\caption{Full-model chemical reactions ($vf$: forward reaction, $vr$:reverse reaction)}
\label{table:fullmodel_rxns}
\hskip-1cm
\begin{tabular}{cll}
\toprule
\textbf{Chemical Reaction} & \multicolumn{1}{c}{\textbf{Description}} & \multicolumn{1}{c}{\textbf{Reaction Rates}} \\
\midrule
\ce{-> sg$1$} & \shortstack{induction of synthesis\\ of sgRNA1 by Arabinose}
& \shortstack{$vf = Ara*(1-bSG1)*VMAX*$\\$(30 - sg5dCasGA - sg6dCasGA)$}\\
\midrule
\ce{-> sg$1$} & \shortstack{basal levels of sgRNA1\\ w/o Arabinose}
& \shortstack{$vf = (bSG1)*VMAX*$\\$(30 - sg5dCasGA - sg6dCasGA)$}\\
\midrule
\ce{sg$i$ ->} & \shortstack{degradation of sgRNAi\\ $i={1,2,3,4,5,6}$}
& \shortstack{$vf = (dmRNAcaseF)*sgi$}\\
\bottomrule
\end{tabular}%
\label{tab:dvar}%
\end{table}%
提前致谢。
答案1
像这样:
- 根据猜测
\documentclass
您使用哪个,文档页面布局是什么,等等。 - 使用
tblr˛table, defined in
tabularray` 包
\documentclass{article}
\usepackage[skip=1ex,
font=small,labelfont=bf]{caption}
\usepackage[version=4]{mhchem}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\begin{document}
\begin{table}[ht]
\caption{Full-model chemical reactions ($vf$: forward reaction, $vr$:reverse reaction)}
\label{table:fullmodel_rxns}
\begin{tblr}{colspec = {@{} Q[l,m]
X[0.8, l, m]
X[1.2, l, m, mode=math] @{}},
row{1} = {font=\bfseries, mode=text, c},
row{3-Z} = {abovesep=5pt}
}
\toprule
{Chemical\\ Reaction}
& Description
& Reaction Rates \\
\midrule
\ce{-> sg$1$}
& induction of synthesis of sgRNA1 by Arabinose
& vf = Ara*(1-bSG1)*VMAX*(30 - sg5dCasGA - sg6dCasGA) \\
% \midrule
\ce{-> sg$1$}
& basal levels of sgRNA1 w/o Arabinose
& vf = (bSG1)*VMAX*
(30 - sg5dCasGA - sg6dCasGA) \\
% \midrule
\ce{sg$i$ ->}
& degradation of sgRNAi $i={1,2,3,4,5,6}$
& vf = (dmRNAcaseF)*sgi \\
\bottomrule
\end{tblr}
\label{tab:dvar} % why two labels?
\end{table}
\end{document}
无关:
我不熟悉你数学中使用的符号,但你似乎不关心区分变量和运算符,同样的问题是多字母变量。例如
- $vf$ ---> $\mathit{vf}$
- $vf$ ---> $\mathit{vf}$
- $dmRNA$ ---> $\mathrm{dmRNA}$
- $VMAX$ ---> $\mathrm{VMAX}$ 或者可能是 $V_{\max}$?
但是在数学表达式中有更多类似的情况,但我不知道它们的含义,所以我无法提供任何建议,如何处理它们。
我建议你关注一下这个问题。
附录: 如果您的表格长度超过一页(正如您在下面的评论中指出的那样),那么在上面的 MWE 中您需要执行以下操作:
- 删除
table
环境 tblr
用。。。来代替longtblr
- 在选项中插入标题和标签
longtblr
(参见下面的 MWE) - 标题样式定义方式
tabularray
:
\documentclass{article}
\usepackage{lipsum}% For dummy text. Don't use in a real document
\usepackage[skip=1ex,
font=small,labelfont=bf]{caption} % not used in longtblr or talltblr
\usepackage[version=4]{mhchem}
\usepackage{tabularray}
\UseTblrLibrary{amsmath, booktabs}
\begin{document}
\lipsum[1-3]
\begingroup
\NewTblrTheme{CAPT}{ %or any to you meaningfull name
\SetTblrStyle{head}{font=\small}
\SetTblrStyle{foot}{font=\footnotesize}
\SetTblrStyle{caption-tag}{font=\bfseries}
}
\begin{longtblr}[
theme = CAPT,
caption = {Full-model chemical reactions ($\mathit{vf}$: forward reaction, $\mathit{vr}$: reverse reaction)},
label = {table:fullmodel_rxns}
]{colspec = {@{} Q[l,m]
X[0.8, l, m]
X[1.2, l, m, mode=math] @{}},
row{1} = {font=\bfseries, mode=text, c},
row{3-Z} = {abovesep=5pt},
rowhead ) 1 % <---
}
\toprule
{Chemical\\ Reaction}
& Description
& Reaction Rates \\
\midrule
\ce{-> sg$1$}
& induction of synthesis of sgRNA1 by Arabinose
& vf = Ara*(1-bSG1)*\mathrm{VMAX}*(30 - sg5dCasGA - sg6dCasGA) \\
% \midrule
\ce{-> sg$1$}
& basal levels of sgRNA1 w/o Arabinose
& vf = (bSG1)*\mathrm{VMAX}*
(30 - sg5dCasGA - sg6dCasGA) \\
% \midrule
\ce{sg$i$ ->}
& degradation of sgRNAi $i={1,2,3,4,5,6}$
& vf = (\mathrm{dmRNA\ case}F)*sgi \\
%%%% repeated row, that can be show how longtble works
\ce{-> sg$1$}
& induction of synthesis of sgRNA1 by Arabinose
& vf = Ara*(1-bSG1)*\mathrm{VMAX}*(30 - sg5dCasGA - sg6dCasGA) \\
% \midrule
\ce{-> sg$1$}
& basal levels of sgRNA1 w/o Arabinose
& vf = (bSG1)*op{VMAX}*
(30 - sg5dCasGA - sg6dCasGA) \\
% \midrule
\ce{sg$i$ ->}
& degradation of sgRNAi $i={1,2,3,4,5,6}$
& vf = (\on{dmRNA\ case}F)*sgi \\
\bottomrule
\end{longtblr}
\endgroup
\end{document}