Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
1  
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 '13 at 20:14
    
@egreg: Same issue when I try the expansion with align. –  Isaac Kleinman Aug 7 '13 at 20:24

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.