在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{}
等代码?
谢谢, 约翰。
答案 0 :(得分:0)
段的概念来自旧的 vi - nroff宏(无论是什么:-);它不能大幅改变。最近,一个补丁浮动在vim_dev mailing list到support custom definitions via regular expressions。
到目前为止,您必须使用视觉选择来解决问题:Vjjjgw
。或者,您可以为 Tex 段落编写自己的文本对象。