tag:blogger.com,1999:blog-9453241.post6968299096540999808..comments2024-01-22T23:57:51.851-07:00Comments on Phase Portrait: Vim-LaTeX, Vim 7.0, and the filetype pluginTed Pavlichttp://www.blogger.com/profile/15297790411942050417noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-9453241.post-83284232030480068542008-04-11T10:13:00.000-07:002008-04-11T10:13:00.000-07:00Using :set paste before :TTemplate works like a ch...Using :set paste before :TTemplate works like a charm. Thank you.Anonymoushttps://www.blogger.com/profile/02843453263307584747noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-43229951927021703422008-04-11T05:53:00.000-07:002008-04-11T05:53:00.000-07:00OK. Your example helped me see what was going on. ...OK. Your example helped me see what was going on. I thought you were exaggerating about the "set paste," but you actually ARE getting stairstepping.<BR/><BR/>You should notice that the pre-packaged Vim-LaTeX templates do not have *any* indenting, and so they don't have the problem. That is, if you do:<BR/><BR/>:TTemplate IEEEtran<BR/><BR/>the resulting text does not get stairstepped. That is, it's indented with your "shiftwidth" settings.<BR/><BR/>In your case, you've put your indenting within your template. That's the problem. <BR/><BR/>If you actually issue:<BR/><BR/>:set paste<BR/><BR/>it will fix the problem. That is, <BR/><BR/>:TTemplate stuff<BR/><BR/>will give you the output you want (where indents are set by "shiftwidth," as explained). <BR/><BR/>Otherwise, you should remove the indenting from your template.<BR/><BR/>Vim-LaTeX could be changed so that it automatically does a ":set paste" and ":set nopaste" before and after the :TTemplate call, but I think the authors were worried that people would have one indenting convention (tabs, spaces, and different shiftwidths) and the template would have another. So, by stripping out indenting, they let Vim indenting based on how you've set it up to indent.<BR/><BR/>Does that help?Ted Pavlichttps://www.blogger.com/profile/15297790411942050417noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-48685058909335789832008-04-10T13:30:00.000-07:002008-04-10T13:30:00.000-07:00Shiftwidth doesn't seem to have any effect. For a...Shiftwidth doesn't seem to have any effect. For a template like <A HREF="http://latex.pastebin.com/f4fcc7b39" REL="nofollow">this example</A><BR/>I see <A HREF="http://latex.pastebin.com/f2bd96a8f" REL="nofollow">results like this</A>.<BR/><BR/>I see the same behavior if my template uses either leading spaces or tab characters. From looking through the presupplied templates that ship with latex-suite, it seems none of them have leading line indentation.Anonymoushttps://www.blogger.com/profile/02843453263307584747noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-7961874824616389962008-04-10T10:39:00.000-07:002008-04-10T10:39:00.000-07:00Rhys -- What do you have your "shiftwidth" set to?...Rhys -- What do you have your "shiftwidth" set to? Type:<BR/><BR/>:set sw?<BR/><BR/>That's the number of spaces used for the autoindenting. Try doing:<BR/><BR/>:set sw=2<BR/><BR/>and then calling up a template. I think that indenting will get fixed. Type:<BR/><BR/>:help shiftwidth<BR/><BR/>for more information.Ted Pavlichttps://www.blogger.com/profile/15297790411942050417noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-9567567743124423852008-04-10T10:09:00.000-07:002008-04-10T10:09:00.000-07:00Any idea how to avoid extra whitespace in custom t...Any idea how to avoid extra whitespace in custom templates stored within ~/.vim/ftplugin/latex-suite/templates<BR/>?<BR/><BR/>The default templates all work well, but when I load up a custom template I see lots of extra indentation (similar to what happens when pasting into vim without using ':set paste').Anonymoushttps://www.blogger.com/profile/02843453263307584747noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-61920773080295575522008-04-10T09:28:00.000-07:002008-04-10T09:28:00.000-07:00Sven -- You should try:help latex-suiteand read so...Sven -- You should try<BR/><BR/>:help latex-suite<BR/><BR/>and read some of the instructions there. The templates aren't supposed to show up automatically (though, you could configure Vim to do that). However, there are lots of shortcuts.<BR/><BR/>For example, in insert mode, type:<BR/><BR/>EDO<BR/><BR/>You'll get a simple document class setup. Hit CNTRL+J to jump from fill-in-area to fill-in-area.<BR/><BR/>Or, try typing:<BR/><BR/>:TTemplate<BR/><BR/>without any arguments. You'll get a menu with a few sample templates. You can choose one. In fact, you could choose one by passing an argument directly:<BR/><BR/>:TTemplate article<BR/><BR/>Check out the latex-suite documentation (:help latex-suite) for more information. In particular, check out chapter 3.<BR/><BR/>Additionally, try doing <BR/><BR/>:help latex<BR/><BR/>You should find a pretty comprehensive LaTeX manual.Ted Pavlichttps://www.blogger.com/profile/15297790411942050417noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-85457161314221133212008-04-10T08:16:00.000-07:002008-04-10T08:16:00.000-07:00Thank you for this post. It saved my day. Now when...Thank you for this post. It saved my day. Now when I run "gvim newfile.tex" it loads the menus. But still I cannot get the prepared preamble. The new file is completely empty /-:Anonymoushttps://www.blogger.com/profile/13425941239582016499noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-66498431494240519212008-04-10T08:15:00.000-07:002008-04-10T08:15:00.000-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/13425941239582016499noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-23820551462891985732008-03-06T07:26:00.000-07:002008-03-06T07:26:00.000-07:00My GUESS is that you are using an old version of g...My GUESS is that you are using an old version of gVim that is based on Vim6.0. If you update to the latest version of gVim, which is based on Vim7, you'll have the same problem.<BR/><BR/>In either case, fixing the tex_flavor will fix the "problem."Ted Pavlichttps://www.blogger.com/profile/15297790411942050417noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-30628624663669133982008-03-06T06:36:00.000-07:002008-03-06T06:36:00.000-07:00Thank you-- I'd noticed the odd behavior and had j...Thank you-- I'd noticed the odd behavior and had just skipped around it by running gVim (which didn't seem to suffer the same problems).Anonymoushttps://www.blogger.com/profile/02843453263307584747noreply@blogger.com