15. Juni 2011

Vim, Tasklist and Latex with Todonotes

Category: Howto / Tutorial — Tags: , , , , , – Kay Smarczewski @ 22:49

In these days, I am writing my diploma thesis. I use Vim and LaTeX for doing this, of course. I have extended my little LaTeX-IDE (Vim with its Latex Suite and some snipMate snippets with another gimmick: the use of an todo list, as you may know from programming languages.

In LaTeX the package Todonotes gives you the two commands \todo{} and \missingfigure{}. The former inserts an todo note into your text. The latter additionally inserts an obvious image to the note. \listoftodos prints a table of todos in your document. But I wanted to highlight my todos not only in the final pdf or ps. The should be more visible in my source code as well.

And there comes vim: I highlight the commands \todo and missingfigure through a small snippet in my ~/.vim/ftplugin/tex.vim file. This file has been generated by Vim-Latex and is only called with tex-documents. You can place the snippet in your .vimrc etc., too. The vim command
:highlight
gives you an overview of your already existing highlight groups. Probably, you can find the group Todo there. I not, you may create it. (see :help highlight). Then you add the following line to tex.vim (see above):

match Todo "\\\(todo\|missingfigure\){.*}" " todo farblich hervorheben

The Tasklist plugin gives you a list of all your todos. You can view it with <leader>t (this is “\t” on my machine). To enable the support of the Todonotes commands you put

let g:tlTokenList = ['\\todo{','\\missingfigure{']

e.g. in your tex.vim.
The second line is for the Tasklist plugin. To remap the open command of the plugin to the key F12 you can add

inoremap <silent&gt <f12> \<esc>:TaskList<cr>i
nnoremap <silent> <f12> :TaskList<cr>
vnoremap <silent> <f12> :TaskList<cr>

to your config.
With this the todos are highlighted and you can view a list of all your todos.

2 Kommentare »

  1. Vim-Latex is the better tool

    Kommentar von lopo — 29. August 2011 @ 11:54

  2. Yes, you are right. The described modifications extend Vim-Latex/Vim Latex Suite.

    Kommentar von Kay Smarczewski — 29. August 2011 @ 14:32

RSS Feed für Kommentare zu diesem Artikel. | TrackBack URI

Hinterlasse einen Kommentar

XHTML ( You can use these tags):
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

Kay Smarczewski


mein Blog

Seiten

Kalender mit Posts

Juni 2011
M D M D F S S
« Dez    
 12345
6789101112
13141516171819
20212223242526
27282930  

Schlagwörter

Dieses Blog durchsuchen

© Kay Smarczewski – Powered by WordPress