You are not logged in.

#1 2011-12-14 20:54:03

aurinkolasit
Member
Registered: 2009-07-02
Posts: 27

TeX 9 - LaTeX ftplugin with lots of firepower

Original Post

Hello fellow Archers,

Some of you might be interested in trying out my Vim ftplugin TeX 9. If you like to prepare your LaTeX documents with Vim, chances are that you already use some ftplugin for that (LaTeX-Vim, ATP...). So why bother with TeX 9? I wrote it because I thought I could achieve everything LaTeX-Vim does in fraction of the SLOCs and I didn't want to automate the compilation/edit cycle like ATP. After all, Vim is an editor and LaTeX documents are not meant to be WYSIWYG in nature. In similar vein I wanted the ftplugin to be as Vimish as possible and not step on your toes, or fingers I should say.

Update Sept 12 2014

The latest version is available from Vim.org and from GitHub after they sync with Vim.org. The version 1.3.13 contains some small fixes I've come up with over this year. For example, you can now configure TeX-9 to use the -shell-escape flag which is required when using Minted for syntax highlighted code listings.

Update Aug 10 2013

Okaay, I'm reloaded! Get TeX-9 1.3.7 from Vim.org. This is a bugfix release of the 1.3.1 I published a couple of weeks ago. Thanks to the Archers who have helped me in debugging.
Many of you probably want to use the git repos maintained at GitHub (http://vim-scripts.org/). However, I have no control over these repositories and I don't know when they'll update my plugin to the latest version.

What this plugin does

       

  • Compile, debug and launch a document viewer from within Vim

  • Insert LaTeX code snippets with ease

  • Powerful text-object for LaTeX environments

  • Omni-completion of BibTeX database entries and label references

  • Omni-completion of mathematical symbols

  • SyncTeX support (for the Evince document viewer)

  • Filetype specific indentation (courtesy of Johannes Tanzler)

  • LaTeX2e manual (ported to Vim by Mikolaj Machowski)

  • No-hassle settings, relatively few mappings

Download

Vim.org

Last edited by aurinkolasit (2014-09-12 12:08:29)

Offline

#2 2011-12-14 21:03:48

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: TeX 9 - LaTeX ftplugin with lots of firepower

Nice. I don't have much call to use it at this very second, but I imagine this sort of thing will come in handy when I start my PhD next year. I previously used a Makefile to compile my LaTeX documents :-P

Offline

#3 2011-12-15 15:21:52

Sara
Member
From: USA
Registered: 2009-07-09
Posts: 219
Website

Re: TeX 9 - LaTeX ftplugin with lots of firepower

I've made a PKGBUILD for this. Hope you don't mind my package description... I wanted it to be short, but still borrow from the original description.


Registed Linux User 483618

Offline

#4 2011-12-15 16:01:28

aurinkolasit
Member
Registered: 2009-07-02
Posts: 27

Re: TeX 9 - LaTeX ftplugin with lots of firepower

Oh lovely! Thanks.

Offline

#5 2011-12-15 18:57:24

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: TeX 9 - LaTeX ftplugin with lots of firepower

hm, the PKGBUILD does not work. vimdoc.install is missing.

Is there any manual or howto regarding this plugin ?

Offline

#6 2011-12-15 19:11:32

aurinkolasit
Member
Registered: 2009-07-02
Posts: 27

Re: TeX 9 - LaTeX ftplugin with lots of firepower

linux-ka wrote:

Is there any manual or howto regarding this plugin ?

Sure. If you take a look at the Vim.org page, you'll find the instructions on how to install TeX 9 manually. I'll repost them here:

install details
        * Unzip the tarball to your local Vim tree (usually ~/.vim)
        * Update helptags (:helptags ~/.vim/doc/)
        * Read the help on TeX_9 (:help tex_nine)

"The tarball" is just what you get from Vim.org. The manual you were looking for is in Vim's help format.

Last edited by aurinkolasit (2011-12-15 19:12:39)

Offline

#7 2011-12-15 19:19:37

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: TeX 9 - LaTeX ftplugin with lots of firepower

thanks

Offline

#8 2011-12-17 23:33:29

Sara
Member
From: USA
Registered: 2009-07-09
Posts: 219
Website

Re: TeX 9 - LaTeX ftplugin with lots of firepower

linux-ka wrote:

hm, the PKGBUILD does not work. vimdoc.install is missing.

Is there any manual or howto regarding this plugin ?

`tar -tvf` shows vimdoc.install is in the tarball for vim-tex_nine (downloaded the tarball manually from the AUR just to check). Are you sure about this?


Registed Linux User 483618

Offline

#9 2011-12-18 11:58:53

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: TeX 9 - LaTeX ftplugin with lots of firepower

I installed it manually. now it works. The pkgbuild did not work for me

Offline

#10 2011-12-18 13:33:05

Sara
Member
From: USA
Registered: 2009-07-09
Posts: 219
Website

Re: TeX 9 - LaTeX ftplugin with lots of firepower

linux-ka wrote:

I installed it manually. now it works. The pkgbuild did not work for me

I uploaded a new version of the PKGBUILD yesterday. If it would not be of trouble, could you try it? Thanks.


Registed Linux User 483618

Offline

#11 2011-12-18 13:54:59

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: TeX 9 - LaTeX ftplugin with lots of firepower

works fine, thanks!

Offline

#12 2012-05-03 06:43:54

aurinkolasit
Member
Registered: 2009-07-02
Posts: 27

Re: TeX 9 - LaTeX ftplugin with lots of firepower

UPDATE May 1st, 2012

Version 1.2 is out.

Offline

#13 2012-05-03 08:42:29

FreeTheBee
Member
Registered: 2011-01-02
Posts: 125

Re: TeX 9 - LaTeX ftplugin with lots of firepower

Hi, I was curious whether TeX 9 plays nice with NERDTree and split windows in general? At the moment I use vim-latex, which doesn't like cite/ref completion when having a NERDTree open.

For the moment I need LaTeX and Vim to just work, so I'm trying to refrain from playing and stick with Vim-latex. Though, next week I will definitely give TeX 9 a go.

Offline

#14 2012-05-03 09:34:04

aurinkolasit
Member
Registered: 2009-07-02
Posts: 27

Re: TeX 9 - LaTeX ftplugin with lots of firepower

FreeTheBee wrote:

Hi, I was curious whether TeX 9 plays nice with NERDTree and split windows in general? At the moment I use vim-latex, which doesn't like cite/ref completion when having a NERDTree open.

I don't use NERDTree myself but TeX 9 is designed to play nicely with other buffers and windows, be they latex documents or other source code. If you want to try out TeX 9 and have vim-latex already installed, it's best to unzip the tarball from vim.org to a location of your choice and rename your "~/.vim" to "~/vim" say. Then you can say

let &runtimepath.=',/path/to/it/tex_nine-1.2'

in your .vimrc. To revert to vim-latex, well, do the opposite: remove that line and rename vim back to .vim.

This is to avoid conflicts that could arise because of vim-latex. If I remember correctly, it's not possible to disable or remove vim-latex very easily. If you like my script and would like to use it permanently, you would then need to somehow manually remove vim-latex. In contrast, if you would like to disable my script, you can say in your .vimrc.

au BufReadPre *.tex let b:init_tex_nine = 1

Last edited by aurinkolasit (2012-05-03 09:35:46)

Offline

#15 2012-05-03 12:39:08

FreeTheBee
Member
Registered: 2011-01-02
Posts: 125

Re: TeX 9 - LaTeX ftplugin with lots of firepower

I doubt indeed that loading both at the same time will create a super LaTeX IDE wink I use pathogen, so in principle I should be able to just swap the vim-latex folder for a TeX 9 one and comment out a few lines in my vimrc.

Offline

#16 2012-05-07 07:50:04

FreeTheBee
Member
Registered: 2011-01-02
Posts: 125

Re: TeX 9 - LaTeX ftplugin with lots of firepower

I just got around trying TeX 9 and it looks very good. It took some messing to get bibtex to work, it refused to find the bib file, altough it was specified correctly. Restarting vim fixed that through magic I guess smile

I noticed one problem with cite completion, it seems very cpu intensive. My bibtex file contains about 500 references and the cpu load goes to 100% when I do cite completion, slowing vim down to a crawl. Also when inserting text it tends to slow down a lot with significant delay on the text insertion, which also seems related to bibtex, but I haven't tested thoroughly.

One short question as well about the big compile. Should it iterate until the document is in its final state?

Offline

#17 2012-05-07 08:58:29

aurinkolasit
Member
Registered: 2009-07-02
Posts: 27

Re: TeX 9 - LaTeX ftplugin with lots of firepower

I haven't noticed any delay in cite completion (~ 2800 entries), but I have been trying to wrap my head around why Vim slows down sometimes when I just type text in a LaTeX document. I have deliberately avoided autocommands, so my plugin should do nothing when you just type. I'm almost willing to bet that it's Vim's Python interpreter that is doing something buggy. I will investigate!

One short question as well about the big compile. Should it iterate until the document is in its final state?

How do you mean? I have looked into how many times one needs to run latex and bibtex to get the cross references and citations right and coded 'big_compile' accordingly. It does absolutely nothing fancy, it just compiles the file a couple of times.

Offline

#18 2012-05-07 09:02:06

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: TeX 9 - LaTeX ftplugin with lots of firepower

Thanks for this. I'm not a good vim user, and previously I've never used vim plugins, so I have a very basic vim question:

As far as I know, I've installed tex_nine correctly (I can bring up the help file). When I press <F1> in vim, it opens the vim helpfile instead of inserting the skeleton template, as it says...

Can someone point me in the right direction?? Thanks!

Offline

#19 2012-05-07 09:29:44

aurinkolasit
Member
Registered: 2009-07-02
Posts: 27

Re: TeX 9 - LaTeX ftplugin with lots of firepower

Did you install TeX 9 via AUR or via Vim.org? Check out if you have the file 'tex_nine.vim' in your ftplugin folder.

EDIT: and make sure you have

filetype plugin indent on
syntax on
let g:tex_flavor = 'name_of_your_compiler'

in your .vimrc.

Last edited by aurinkolasit (2012-05-07 10:06:17)

Offline

#20 2012-05-07 09:46:41

FreeTheBee
Member
Registered: 2011-01-02
Posts: 125

Re: TeX 9 - LaTeX ftplugin with lots of firepower

@kcirick, Is the file you're trying this on a tex file (by extension/filetype)? If the filetype is not recognised as tex, it wouldn't use the plugin, afaik.

@aurinkolasit, When I do a big compile it does run bibtex since there is a bbl file and such created, but it does not include anything yet. I need to run ;K three times to get everything correct.

I will play with it some more in the evening, I really like the concept of Tex9. I prefer the way you handle completion over vim-latex, and it seems it also stays more out of the user's way. Although Vim-latex is a great plugin, I think in the long run I will prefer tex 9.

Offline

#21 2012-05-07 10:03:54

aurinkolasit
Member
Registered: 2009-07-02
Posts: 27

Re: TeX 9 - LaTeX ftplugin with lots of firepower

FreeTheBee wrote:

I will play with it some more in the evening, I really like the concept of Tex9. I prefer the way you handle completion over vim-latex, and it seems it also stays more out of the user's way. Although Vim-latex is a great plugin, I think in the long run I will prefer tex 9.

Thanks for your kind words!

Hmmm, it's strange that you have to run ;K three times. You should not have to. Could you edit 'autoload/tex_nine.vim' and modify the
quickcompile and deepcompile functions so that they echo the function name for example. I'd like to know if you're sometimes pressing ;k
instead of ;K by accident.

BTW: There has been some bug in Vim and its Python interpreter so that Vim is now shipped with -O1 in Arch Linux. This might make your Vim somewhat slower than usual. I'm using Vim 7.3.69 and I haven't noticed any performance issues as of late.

Last edited by aurinkolasit (2012-05-07 10:05:51)

Offline

#22 2012-05-07 11:12:41

FreeTheBee
Member
Registered: 2011-01-02
Posts: 125

Re: TeX 9 - LaTeX ftplugin with lots of firepower

Ok, I will look into this tonight and let you know.

Offline

#23 2012-05-07 11:39:48

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: TeX 9 - LaTeX ftplugin with lots of firepower

aurinkolasit wrote:

Did you install TeX 9 via AUR or via Vim.org? Check out if you have the file 'tex_nine.vim' in your ftplugin folder.

EDIT: and make sure you have

filetype plugin indent on
syntax on
let g:tex_flavor = 'name_of_your_compiler'

in your .vimrc.

Updating the .vimrc helped and things are working now. Thanks for your help. I'm now playing around with it. I'll let you know when I come across anything else that I don't understand.

Offline

#24 2012-05-07 18:56:45

FreeTheBee
Member
Registered: 2011-01-02
Posts: 125

Re: TeX 9 - LaTeX ftplugin with lots of firepower

I don't know what I was doing this morning, but I checked on two systems and compilation works fine.

I was thinking of one feature that might be nice to some users, (i.e. me wink). For me it would sometimes be handy to be able to use a modeline to set the bibfile, like for the main file. In most cases it is more convenient to have central file, for which the current set-up is perfect, but sometimes this would come in handy. Especially before submitting stuff, when I usually strip out the included references from my main library to make error checking easier. In principle it should already be possible using the let-modeline plugin, so it is merely a suggestion smile

Offline

#25 2013-08-10 15:02:29

aurinkolasit
Member
Registered: 2009-07-02
Posts: 27

Re: TeX 9 - LaTeX ftplugin with lots of firepower

Bump. A new version is out, see the OP.

Offline

Board footer

Powered by FluxBB