knowledge-database (beta)

Current group: comp.editors

Re: questions on using VI to edit latex

Re: questions on using VI to edit latex  
Leonardo B. Oliveira
From:Leonardo B. Oliveira
Subject:Re: questions on using VI to edit latex
Date:Fri, 7 Jan 2005 11:25:33 -0200

I was in doubt where to post. So i did in both.

Many thanks!

> On Thu, 6 Jan 2005, Leonardo B. Oliveira wrote:
>
> > Hi, folks!
> >
> > Is there any way to:
>
> This is a VIm question, not really a LaTeX one. However, the answer is
> "yes" to both. Create the directory $HOME/.vim/syntax/, copy
> /usr/share/vim/vim/syntax/tex.vim there, and read on.
>
> > * highlight text between \begin{comment} and
> > * \end{comment}, as "%" does in
> > latex?
>
> Just add the following to your tex.vim:
>
> syn region texComment start="\\begin{comment}" end="\\end{comment}\|%stopzone\>" contains=@texCommentGroup
>
> This will work for literal \begin{comment}...\end{comment}. If you want
> to accomodate the "comment" package with its \excludecomment command, it's
> *much* harder.
>
> > * to make bold or italic text in VI with the
> > * commands \bf and \it,
> > respectively?
>
> Ah, this one's harder, but doable. You'll need to add the following lines
> to tex.vim:
>
> syn region texBold start="\\\(bf\|bfseries\)\>" end="}"me=e-1 contains=@texMatchGroup
> syn region texBold start="\\textbf\s*{" end="}"me=e-1 contains=@texMatchGroup
> syn region texItalic start="\\\(it\|itshape\|em\)\>" end="}"me=e-1 contains=texItalicBold,@texMatchGroup
> syn region texItalic start="\\textit\s*{" end="}"me=e-1 contains=@texMatchGroup
> syn cluster texMatchGroup add=texBold,texItalic
>
> Then at the end, just before "delcommand HiLink":
>
> hi def texBold term=bold cterm=bold gui=bold
> hi def texItalic term=italic cterm=italic gui=italic
>
> And, finally, append the word "transparent" to the four lines starting
> with "syn region texMatcher".
>
> This should do it. FWIW, I tested the stuff above with VIm 6.3 on my
> Cygwin machine (tex.vim version 24). Let me know if this works in your
> version. Also, feel free to suggest the above changes to the author of
> tex.vim -- he's usually pretty responsive.
> HTH,
> Igor
> --
> http://cs.nyu.edu/~pechtcha/
> |\ _,,,---,,_ pechtcha@cs.nyu.edu
> ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
> |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
> '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
>
> "The Sun will pass between the Earth and the Moon tonight for a total
> Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT
>
   

Copyright © 2006 knowledge-database   -   All rights reserved