Search code examples
vimlatexvim-plugin

Unwanted text appears every time I close a bracket in VIM using VimTex


I am typesetting a latex file in VIM using the Vimtex plugin.

Every time I close a bracket, this text shows up automatically in the <++>. For example:

\section{This is one}<++>

\section{The variable $V_L$<++> explains things}<++>

\begin{equation}
    <+content+>
    \label{<+label+>}
\end{equation}<++>

LaTeX compiles my text with those printed out in the pdf so I have to manually remove the every time. This behavior goes from $$ to {} to others also and even inside certain areas when using autocompletion features wit F5.

I did look add this question but it did not provide much help as to how to solve my issue.

  • How can I prevent the from being added to my tex files?
  • If they are a feature meant for something I do not understand, how do I prevent them from compiling in my pdf's?

Solution

  • This part of the documentation on the vim-latex (not Vimtex) repo on github explains how the macro system works, how it's useful and solely meant for editing

    NOTE: Place Holders
        -------------
        Almost all macros provided in Latex-Suite implement Stephen Riem's
        bracketing system and Gergely Kontra's JumpFunc() for handling
        place-holders. This consists of using "place-holders" to mark off
        locations where the next relevant editing has to be done. As an example,
        when you type EFI in |insert-mode|, you will get the following:  >
            \begin{figure}[<+htpb+>]
                \centering
                \includegraphics{<+file+>}
                \caption{<+caption text+>}
                \label{fig:<+label+>}
            \end{figure}<++>
        The text <+htpb+> will be selected and you will be left in |select-mode|
        so that you can continue typing straight away. After having typed in the
        placement specifier, you can press <Ctrl-J> (while still in insert-mode).
        This will take you directly to the next "place-holder". i.e, <+file+> will
        be visually selected with Vim in select mode again for typing in the file
        aaaa. This saves on a lot of key presses.
    

    Note: Upon testing I realized that the placeholder only appears when the bracketing is empty.