2

I just began using vim-latex and started with their tutorial.

Following the instructions on this page, I type eqnarray followed by F5, but instead of getting the described

\begin{eqnarray}
   \label{}<++>
\end{eqnarray}<++>

I get

\begin{eqnarray}

  \label{<++>}
\end{eqnarray}<++>

This is my complete file:

\documentclass[a4paper]{article}
\usepackage[sumlimits,]{amsmath}
\begin{document}

\begin{eqnarray}

  \label{<++>}
\end{eqnarray}<++>

\end{document}

Is this is a bug or am I doing something wrong?

2
  • 2
    You shouldn't be using eqnarray anyway: it's one of the weakest points in LaTeX. Use align, instead. I don't know whether Vim treats this one correctly, but the main point is that eqnarray is buggy.
    – egreg
    Aug 7, 2013 at 20:14
  • @egreg: Same issue when I try the expansion with align. Aug 7, 2013 at 20:24

1 Answer 1

6

I think this is the expected behaviour in vim-latexsuite and it may just be a bug in the quickstart tutorial.

If you want to change to get this

\begin{eqnarray}
   \label{}<++>
\end{eqnarray}<++>

with the cursor in between the label brackets, you can define the following variable and then type eqnarray followed by F5.

let g:Tex_Env_eqnarray = "\\begin{eqnarray}\<CR>\label{<++>}<++>\<CR>\\end{eqnarray}"

This should work also for other environments like align using instead the Tex_Env_align variable.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .