2

在 vim 中编辑乳胶代码时,我经常键入gwap以重新调整当前段落。不幸的是,当段落包含方程式或其他类似的乳胶控制代码时,格式都被混淆了。

例如,如果我尝试重新调整合理合理的段落

Our network model follows that of Nakajima et
al.~\\cite{nakajima_robustness_2010} which is in turn based on the model of Li
et al.~\\cite{li_yeast_2004}. We define the dynamics of a network through the
following recurrence relation
\\[
X_i^{t+1} = \\left\\{ \\begin{array}{cl}
  1 & \\textrm{if $\\sum_j J_{ij} X_j^t > 0$} \\\\
  0 & \\textrm{if $\\sum_j J_{ij} X_j^t < 0$} \\\\
  \\theta_i & \\textrm{if $\\sum_j J_{ij} X_j^t = 0$}
\\end{array} \\right.
\\]
$X_i^t \\in \\{0, 1\\}$ is the expression state of gene $i$ at time point $t$.
$J_{ij}$ represents the regulatory effect of gene $j$ on gene $i$. $J_{ij} >
0$, $J_{ij} < 0$ and $J_{ij} = 0$  imply activation, repression and the absence
of regulation respectively. $\\theta_i$ is the constitutive expression state of
gene $i$.

然后我结束了这个烂摊子:

Our network model follows that of Nakajima et
al.~\\cite{nakajima_robustness_2010} which is in turn based on the model of Li
et al.~\\cite{li_yeast_2004}. We define the dynamics of a network through the
following recurrence relation \\[ X_i^{t+1} = \\left\\{ \\begin{array}{cl} 1 &
                              \\textrm{if $\\sum_j J_{ij} X_j^t > 0$} \\\\ 0 &
                       \\textrm{if $\\sum_j J_{ij} X_j^t < 0$} \\\\ \\theta_i &
                       \\textrm{if $\\sum_j J_{ij} X_j^t = 0$} \\end{array}
                   \\right.  \\] $X_i^t \\in \\{0, 1\\}$ is the expression state of
                   gene $i$ at time point $t$.  $J_{ij}$ represents the
                   regulatory effect of gene $j$ on gene $i$. $J_{ij} > 0$,
                   $J_{ij} < 0$ and $J_{ij} = 0$  imply activation, repression
                   and the absence of regulation respectively. $\\theta_i$ is
                   the constitutive expression state of gene $i$.

我如何告诉 vim 段落不应该跨越代码\[ \] \begin{} \end{}

谢谢,约翰。

4

1 回答 1

0

段落的概念来自nroff 宏的旧vi遗产(无论是什么:-);它不能有很大的改变。最近,vim_dev 邮件列表上出现了一个补丁,以支持通过正则表达式进行自定义定义

到目前为止,您必须通过使用视觉选择来解决该问题:Vjjjgw. 或者,您可以为Tex段落编写自己的文本对象。

于 2013-02-27T16:06:41.603 回答