Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when using vim-latex gq causes overhangs in captions

When I am editing a LaTeX file using Vim-LaTeX and want to reformat a section of text that is in a \caption{} I get overhangs or underhangs - I am not sure what to call them. I first select the text in the caption then use "gq" to reformat it. After reformatting the caption looks like:

    \caption{The problem is that when I reformat the text
         in a caption the text on each successive line
      begins further and further to the left until it begins 
   at the first space of the line.}

what I would hope the result would look like would be something like:

    \caption{The problem is that when I reformat the text
         in a caption the text on each successive line
         begins further and further to the left until it 
         begins at the first space of the line.}

I hope the formatting in this post remains true to what I typed in, but I tried to describe the problem in the first example caption. The second should be left justified.

Does anyone know what I need to do to fix this? I am assuming that there is a setting that I need to change, but I have not been able to figure out what it is.

like image 388
Shawn Avatar asked Nov 10 '22 01:11

Shawn


1 Answers

The gq command formats based on 'formatexpr' or 'formatprg'. You can start by checking the values of these options with :se fex? and :se fp?.

From looking through the vim-latex plugin it never sets these options, so this is likely set by your other plugins or vimrc. You can find out exactly where an option is set by using :verbose.

like image 130
Conner Avatar answered Nov 15 '22 06:11

Conner