展开数组内的箭头

展开数组内的箭头

有什么想法我可以扩大它们\xrightarrow以便它们都具有相同的尺寸吗?(为了美观)

\documentclass{article}

\usepackage{amsmath}   % \text nas equacoes
\usepackage{mathrsfs}

\begin{document}

Network reaction model:

\def\Ph{\text{P}_\text{h}}

\[\begin{array}{llrrrcrrr}
\mathscr{R}_1: & & x_i & + & v_j & \xrightarrow{\frac{1}{l^4}p_0\Ph(i,j)} & (n_x+1)x_i & + & v_j \\
\mathscr{R}_2: & & x_i & + & v_j & \xrightarrow{\frac{1}{l^4}p_v} & y_i & + & yv_{0,j} \\
\mathscr{R}_3: & & & & yv_{5,i} & \xrightarrow{b_v} & 5v_i & - & y_j \\
\mathscr{R}_4: & & & & yv_{t<5,i} & \xrightarrow{b_v} & yv_{t+1,i} & & \\
\mathscr{R}_5: & & y_i & + & z_j & \xrightarrow{\frac{1}{l^4}k_0\Ph(i,j)} & z_j & - & yv_{t,k} \\
\mathscr{R}_6: & & y_i & + & z_j & \xrightarrow{\frac{1}{l^4}p_0'\Ph(i,j)} & n_yz_j & & \\
\mathscr{R}_7: & & & & v_i & \xrightarrow{(dv_0+(1-dv_0))\text{cd4Hill}(i)} & 0 & & \\
\mathscr{R}_8: & & & & z_i & \xrightarrow{dy_0(1-\text{cd4Hill}(i)} & 0 & & \\
\mathscr{R}_9: & & & & 0 & \xrightarrow{lx_0dx_0} & x_i & & \\
\mathscr{R}_{10}: & & & & 0 & \xrightarrow{ly_0dy_0} & z_i & & \\
\end{array}\]

\end{document}

输出

箭头应该扩大以填满空间:

期望

PS:我正在使用数组,但我愿意接受建议!

答案1

您可以使用具有最宽条目宽度的盒子。

\documentclass{article}

\usepackage{amsmath}   % \text nas equacoes
\usepackage{mathrsfs}
\usepackage{calc}
\newlength{\mylen}
\settowidth{\mylen}{$(dv_0+(1-dv_0))\text{cd4Hill}(i)$}
\newcommand{\mb}[1]{\makebox[\mylen]{$#1$}}

\begin{document}

Network reaction model:

\def\Ph{\text{P}_\text{h}}

\[\begin{array}{llrrrcrrr}
\mathscr{R}_1: & & x_i & + & v_j & \xrightarrow{\mb{\frac{1}{l^4}p_0\Ph(i,j)}} & (n_x+1)x_i & + & v_j \\
\mathscr{R}_2: & & x_i & + & v_j & \xrightarrow{\mb{\frac{1}{l^4}p_v}} & y_i & + & yv_{0,j} \\
\mathscr{R}_3: & & & & yv_{5,i} & \xrightarrow{\mb{b_v}} & 5v_i & - & y_j \\
\mathscr{R}_4: & & & & yv_{t<5,i} & \xrightarrow{\mb{b_v}} & yv_{t+1,i} & & \\
\mathscr{R}_5: & & y_i & + & z_j & \xrightarrow{\mb{\frac{1}{l^4}k_0\Ph(i,j)}} & z_j & - & yv_{t,k} \\
\mathscr{R}_6: & & y_i & + & z_j & \xrightarrow{\mb{\frac{1}{l^4}p_0'\Ph(i,j)}} & n_yz_j & & \\
\mathscr{R}_7: & & & & v_i & \xrightarrow{\mb{(dv_0+(1-dv_0))\text{cd4Hill}(i)}} & 0 & & \\
\mathscr{R}_8: & & & & z_i & \xrightarrow{\mb{dy_0(1-\text{cd4Hill}(i)}} & 0 & & \\
\mathscr{R}_9: & & & & 0 & \xrightarrow{\mb{lx_0dx_0}} & x_i & & \\
\mathscr{R}_{10}: & & & & 0 & \xrightarrow{\mb{ly_0dy_0}} & z_i & & \\
\end{array}\]

\end{document}

在此处输入图片描述

答案2

有点像 hack,但对于一个单独的表格来说它可以起作用;通过反复试验发现,两列的宽度均为 1.5 厘米。

诀窍是定义两个命令:一个填充杆和一个具有给定宽度的填充箭头;它们之间有一个包含凸起标签的零宽度框。我删除了\frac{1}{l^4},更喜欢斜线形式(否则分母变得不可读)。

\documentclass{article}

\usepackage{amsmath}
\usepackage{mathrsfs}

\newcommand\Ph{\mathrm{P}_{\mathrm{h}}}

\makeatletter
\newcommand{\msfill}[1]{%
  \smash{-}%
  \mkern-7mu
  \cleaders\hbox{$\m@th\mkern-2mu \smash{-}\mkern-2mu$}\hskip#1
  \mkern-7mu
  \smash{-}
}

\newcommand{\mrfill}[1]{%
  \smash{-}%
  \mkern-7mu
  \cleaders\hbox{$\m@th\mkern-2mu \smash{-}\mkern-2mu$}\hskip#1
  \mkern-7mu
  \mathord\rightarrow
}

\newcommand{\frightarrow}[1]{%
  \msfill{1.5cm} &
  \makebox[0pt]{\raisebox{1.5ex}{$\scriptstyle#1$}}
  & \mrfill{1.5cm}%
}


\begin{document}

Network reaction model:


\[
\begin{array}{l@{}lrrrc@{\hspace{-3pt}}c@{\hspace{-3pt}}crrr}
\mathscr{R}_1&: & x_i & + & v_j & \frightarrow{p_0\Ph(i,j)/l^4} & (n_x+1)x_i & + & v_j \\
\mathscr{R}_2&: & x_i & + & v_j & \frightarrow{p_v/l^4} & y_i & + & yv_{0,j} \\
\mathscr{R}_3&: & & & yv_{5,i} & \frightarrow{b_v} & 5v_i & - & y_j \\
\mathscr{R}_4&: & & & yv_{t<5,i} & \frightarrow{b_v} & yv_{t+1,i} & & \\
\mathscr{R}_5&: & y_i & + & z_j & \frightarrow{k_0\Ph(i,j)/l^4} & z_j & - & yv_{t,k} \\
\mathscr{R}_6&: & y_i & + & z_j & \frightarrow{p_0'\Ph(i,j)/l^4} & n_yz_j & & \\
\mathscr{R}_7&: & & & v_i & \frightarrow{(dv_0+(1-dv_0))\mathrm{cd4Hill}(i)} & 0 & & \\
\mathscr{R}_8&: & & & z_i & \frightarrow{dy_0(1-\mathrm{cd4Hill}(i)} & 0 & & \\
\mathscr{R}_9&: & & & 0 & \frightarrow{lx_0dx_0} & x_i & & \\
\mathscr{R}_{10}&: & & & 0 & \frightarrow{ly_0dy_0} & z_i & & \\
\end{array}\]

\end{document}

在此处输入图片描述

相关内容