title: How to control how vim measures paragraphs
body: <p>When editing latex code in vim, I often type <code>gwap</code> to rejustify the current paragraph. Unfortunately when the paragraph contains equations or other similar latex control code the formatting is all mixed up.</p>
  
  <p>For example if I try to rejustify the nicely justified paragraph</p>
  
  <pre><code>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 &amp; \\textrm{if $\\sum_j J_{ij} X_j^t &gt; 0$} \\\\
    0 &amp; \\textrm{if $\\sum_j J_{ij} X_j^t &lt; 0$} \\\\
    \\theta_i &amp; \\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} &gt;
  0$, $J_{ij} &lt; 0$ and $J_{ij} = 0$  imply activation, repression and the absence
  of regulation respectively. $\\theta_i$ is the constitutive expression state of
  gene $i$.
  </code></pre>
  
  <p>then I end up with this mess:</p>
  
  <pre><code>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 &amp;
                                \\textrm{if $\\sum_j J_{ij} X_j^t &gt; 0$} \\\\ 0 &amp;
                         \\textrm{if $\\sum_j J_{ij} X_j^t &lt; 0$} \\\\ \\theta_i &amp;
                         \\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} &gt; 0$,
                     $J_{ij} &lt; 0$ and $J_{ij} = 0$  imply activation, repression
                     and the absence of regulation respectively. $\\theta_i$ is
                     the constitutive expression state of gene $i$.
  </code></pre>
  
  <p>How can I tell vim that paragraphs shouldn't span code like <code>\[ \] \begin{} \end{}</code>?</p>
  
  <p>Thanks,
  John.</p>