Subject: For your vim/latex page Date: Thu, 27 Jan 2000 11:54:34 +0100 From: erik.janssen_2@philips.com To: benji@e-math.ams.org hello Benji, I read your posting about starting a page for vim-tools for latex. I accidentally deleted the mail, so I don't know where to have a look at it (could you mail the URL please?), but here is a little tool for latex-tables that you might like to add. It is not really for use in vim, but one can integrate it it in vim very easily, I use it as my 'equalprg' in vim, however, it can only (re)format tables. Feel free to throw it away if it doesn't fit your purpose or when somebody else has a superior tool Regards, Erik. What does it do? ------------------------- It prettifies tabular data, lining up columns and giving numeric colums special treatment. It can also insert latex commands to make it a latex table. There are some examples below, please look at them using a fixed font. Limitations ---------------- - It's a awk-script. Awk is present on all unix'es, but not standard on windows. A lot of awk's for windows can be found on the net. I developed it under windows, so it can certainly run there. - It is quite slow (yet). - When changing an existing latex table, the line-setting can not be changed - It does not deal with comments - the printf-specifiers you can read about in the script are hardly tested as they were a nice idea, but I have no use for it In other words, it's version 1. Examples --------------- Input: ====== I am 29.1 years old I eat 7 pizza's a day With 'awk -f mktable.awk' changed into: ======================================= I am 29.1 years old I eat 7 pizza's a day With 'awk -v mode=latex -line=2 -f mktable.awk' changed into ============================================================ \begin{tabular}{||l||l||l||r||l||l||} I & am & 29.1 & years & old & \\ \hline \hline I & eat & 7 & pizza's & a & day \\ \hline \hline \end{tabular} When editing the last table afterwards, the alignment may be ruined. Then, one can select the entire table in vim, and have it processed again. I mainly use it to be able to just add extra lines in tables without the annoying &'s and \\'s and have the script re-arrange it. To use it in vim I do: autocmd BufNewFile,BufRead *.tex set equalprg=awk\ -v\ mode=latex\ -v\ line=1\ -f\ _path_\mktable.awk\ - But it's also an option to put it in menu items: one for no border, one for single border and one for double border.