Thread: [Vim-latex-devel] Latex Suite suggestions for folding
Brought to you by:
srinathava,
tmaas
From: Aditya M. <ad...@um...> - 2003-09-15 21:13:42
|
Hello, Latex-Suite is a really amazing bundle of packages. I have been using it for quite some time and recently read on the c.t.t. newsgroup about the release of its newer version. There are certain things that I had already added to the file that I have and think that it will be good if they are also included in the new release. ... always expands to $\cdots$ This is annoying it I just want to put ... at some place in the comments. Is there some way in which you can check if we are in the math mode or not and then only make the substitution. Some suggested changes for File: folding.vim Add folds for: abstract keywords "Both of these are useful while writing papers " include folds for amsmath package align/alignat gather intertext "include fold for sidewaysfigure These environments need to be added in the TexFoldTextFunction() also. Also when I include a bibliography in the file, it gets folded with the last section. I find this very annoying and found out that this can be removed by ^\s*\\begin{thebibliography}|^\s*\\bibliography tags in the fold end pattern for section, subsection, subsubsection and chapter. This is my folding.vim file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% "============================================================================= " File: folding.vim " Author: Srinath Avadhanula " Version: 1.0 " Created: Tue Apr 23 05:00 PM 2002 PST " " Description: functions to interact with Syntaxfolds.vim "============================================================================= nnoremap <unique> <Plug>Tex_RefreshFolds :call MakeTexFolds(1)<cr> augroup LatexSuite au LatexSuite User LatexSuiteFileType \ call Tex_Debug('folding.vim: catching LatexSuiteFileType') | \ call s:SetFoldOptions() augroup END " SetFoldOptions: sets maps for every buffer {{{ " Description: function! <SID>SetFoldOptions() if exists('b:doneSetFoldOptions') return endif let b:doneSetFoldOptions = 1 setlocal foldtext=TexFoldTextFunction() if g:Tex_Folding && g:Tex_AutoFolding call MakeTexFolds(0) endif if g:Tex_Folding && !hasmapto('<Plug>Tex_RefreshFolds') nmap <silent> <buffer> <Leader>rf <Plug>Tex_RefreshFolds endif endfunction " }}} " MakeTexFolds: function to create fold items for latex. {{{ " " used in conjunction with MakeSyntaxFolds(). " see ../plugin/syntaxFolds.vim for documentation " function! MakeTexFolds(force) if exists('g:Tex_Folding') && !g:Tex_Folding return endif if &ft != 'tex' return end " the order in which these calls are made decides the nestedness. in " latex, a table environment will always be embedded in either an item or " a section etc. not the other way around. so we first fold up all the " tables. and then proceed with the other regions. let b:numFoldItems = 0 " ======================================================================== " How to add new folding items {{{ " ======================================================================== " " Each of the following function calls defines a syntax fold region. Each " definition consists of a call to the AddSyntaxFoldItem() function. " " The order in which the folds are defined is important. Juggling the " order of the function calls will create havoc with folding. The " "deepest" folding item needs to be called first. For example, if " the \begin{table} environment is a subset (or lies within) the \section " environment, then add the definition for the \table first. " " The AddSyntaxFoldItem() function takes either 4 or 6 arguments. When it " is called with 4 arguments, it is equivalent to calling it with 6 " arguments with the last two left blank (i.e as empty strings) " " The explanation for each argument is as follows: " startpat: a line matching this pattern defines the beginning of a fold. " endpat : a line matching this pattern defines the end of a fold. " startoff: this is the offset from the starting line at which folding will " actually start " endoff : like startoff, but gives the offset of the actual fold end from " the line satisfying endpat. " startoff and endoff are necessary when the folding region does " not have a specific end pattern corresponding to a start " pattern. for example in latex, " \begin{section} " defines the beginning of a section, but its not necessary to " have a corresponding " \end{section} " the section is assumed to end 1 line _before_ another section " starts. " startskip: a pattern which defines the beginning of a "skipped" region. " " For example, suppose we define a \itemize fold as follows: " startpat = '^\s*\\item', " endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', " startoff = 0, " endoff = -1 " " This defines a fold which starts with a line beginning with an " \item and ending one line before a line beginning with an " \item or \end{enumerate} etc. " " Then, as long as \item's are not nested things are fine. " However, once items begin to nest, the fold started by one " \item can end because of an \item in an \itemize " environment within this \item. i.e, the following can happen: " " \begin{itemize} " \item Some text <------- fold will start here " This item will contain a nested item " \begin{itemize} <----- fold will end here because next line contains \item... " \item Hello " \end{itemize} <----- ... instead of here. " \item Next item of the parent itemize " \end{itemize} " " Therefore, in order to completely define a folding item which " allows nesting, we need to also define a "skip" pattern. " startskip and end skip do that. " Leave '' when there is no nesting. " endskip: the pattern which defines the end of the "skip" pattern for " nested folds. " " Example: " 1. A syntax fold region for a latex section is " startpat = "\\section{" " endpat = "\\section{" " startoff = 0 " endoff = -1 " startskip = '' " endskip = '' " Note that the start and end patterns are thus the same and endoff has a " negative value to capture the effect of a section ending one line before " the next starts. " 2. A syntax fold region for the \itemize environment is: " startpat = '^\s*\\item', " endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', " startoff = 0, " endoff = -1, " startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', " endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}' " Note the use of startskip and endskip to allow nesting. " " " }}} " ======================================================================== " {{{ footnote "call AddSyntaxFoldItem ( " \ '^\s*\\footnote{', " \ '^\s*}', " \ 0, " \ 0 " \ ) " }}} " {{{ intertext call AddSyntaxFoldItem ( \ '^\s*\\intertext{', \ '^\s*}', \ 0, \ 0 \ ) }}} " {{{ abstract call AddSyntaxFoldItem ( \ '^\s*\\begin{abstract}', \ '^\s*\\end{abstract}', \ 0, \ 0 \ ) " }}} " {{{ keywords call AddSyntaxFoldItem ( \ '^\s*\\begin{keywords}', \ '^\s*\\end{keywords}', \ 0, \ 0 \ ) " }}} " {{{ thebibliography call AddSyntaxFoldItem ( \ '^\s*\\begin{thebibliography}', \ '^\s*\\end{thebibliography}', \ 0, \ 0 \ ) " }}} " {{{ biography call AddSyntaxFoldItem ( \ '^\s*\\begin{biography}', \ '^\s*\\end{biography}', \ 0, \ 0 \ ) " }}} " {{{ biographynophoto call AddSyntaxFoldItem ( \ '^\s*\\begin{biographynophoto}', \ '^\s*\\end{biographynophoto}', \ 0, \ 0 \ ) " }}} " {{{ table call AddSyntaxFoldItem ( \ '^\s*\\begin{table}', \ '^\s*\\end{table}', \ 0, \ 0 \ ) " }}} " {{{ figure call AddSyntaxFoldItem ( \ '^\s*\\begin{figure', \ '^\s*\\end{figure}', \ 0, \ 0 \ ) " }}} " {{{ sidewaysfigure call AddSyntaxFoldItem ( \ '^\s*\\begin{sidewaysfigure', \ '^\s*\\end{sidewaysfigure}', \ 0, \ 0 \ ) " }}} " {{{ align/alignat call AddSyntaxFoldItem ( \ '^\s*\\begin{align', \ '^\s*\\end{align', \ 0, \ 0 \ ) " }}} " {{{ gather call AddSyntaxFoldItem ( \ '^\s*\\begin{gather', \ '^\s*\\end{gather', \ 0, \ 0 \ ) " }}} " {{{ equation/eqnarray call AddSyntaxFoldItem ( \ '^\s*\\begin{eq', \ '^\s*\\end{eq', \ 0, \ 0 \ ) " }}} " {{{ items call AddSyntaxFoldItem ( \ '^\s*\\item', \ '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', \ 0, \ -1, \ '^\s*\\begin{\(enumerate\|itemize\|description\)}', \ '^\s*\\end{\(enumerate\|itemize\|description\)}' \ ) " }}} " {{{ subsubsection call AddSyntaxFoldItem ( \ '^\s*\\subsubsection\W', \ '^\s*\\appendix\W\|^\s*\\subsubsection\W\|^\s*\\subsection\W\|^\s*\\section\W\|^\s*\\bibliography\|^\s*%%fakesection\|^\s*\\chapter\W\|^\s*\\begin{thebibliography\|^\s*\\begin{slide\|^\s*\\end{document', \ 0, \ -1, \ ) " }}} " {{{ subsection call AddSyntaxFoldItem ( \ '^\s*\\subsection\W', \ '^\s*\\appendix\W\|^\s*\\subsection\W\|^\s*\\section\W\|^\s*%%fakesection\|^\s*\\bibliography\|^\s*\\chapter\W\|^\s*\\begin{slide\|^\s*\\begin{thebibliography\|^\s*\\end{document', \ 0, \ -1, \ ) " }}} " {{{ section call AddSyntaxFoldItem ( \ '^\s*\\section\W', \ '^\s*\\appendix\W\|^\s*\\section\W\|^\s*\\bibliography\|^\s*%%fakesection\|^\s*\\chapter\W\|^\s*\\begin{slide\|^\s*\\begin{thebibliography\|^\s*\\end{document', \ 1, \ -1, \ ) " }}} " {{{ fakesection (for forcinga fold item manually) call AddSyntaxFoldItem ( \ '^\s*%%fakesection', \ '^\s*\\appendix\W\|^\s\\section\W\|^\s*%%fakesection\|^\s*\\bibliography\|^\s*\\chapter\W\|^\s*\\begin{slide\|^\s*\\begin{thebibliography\|^\s*\\end{document', \ 0, \ -1, \ ) " }}} " {{{ chapter call AddSyntaxFoldItem( \ '^\s*\\chapter\W', \ '^\s*\\appendix\W\|^\s*\\chapter\W\|^\s*\\bibliography\|^\s*\\begin{slide\|^\s*\\begin{thebibliography\|^\s*\\end{document', \ 0, \ -1 \ ) " }}} " {{{ slide call AddSyntaxFoldItem ( \ '^\s*\\begin{slide', \ '^\s*\\appendix\W\|^\s*\\chapter\W\|^\s*\\end{slide\|^\s*\\end{document', \ 0, \ 0 \ ) " }}} call MakeSyntaxFolds(a:force) normal! zv endfunction " }}} " TexFoldTextFunction: create fold text for folds {{{ function! TexFoldTextFunction() if getline(v:foldstart) =~ '^\s*\\begin{' let header = matchstr(getline(v:foldstart), '^\s*\\begin{\zs\(figure\|sidewaysfigure\|table\|equation\|eqnarray\|gather\|align\|abstract\|keywords\|thebibliography\)[^}]*\ze}') let caption = '' let label = '' let i = v:foldstart while i <= v:foldend if getline(i) =~ '\\caption' let caption = matchstr(getline(i), '\\caption{\zs.*') let caption = substitute(caption, '\zs}[^}]*$', '', '') elseif getline(i) =~ '\\label' let label = matchstr(getline(i), '\\label{\zs.*') let label = substitute(label, '\zs}[^}]*$', '', '') end let i = i + 1 endwhile let ftxto = foldtext() " if no caption found, then use the second line. if caption == '' let caption = getline(v:foldstart + 1) end let retText = matchstr(ftxto, '^[^:]*').': '.header.' ('.label.') : '.caption return retText else return foldtext() end endfunction " }}} " vim:fdm=marker:ff=unix:noet:ts=4:sw=4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
From: Mikolaj M. <mi...@wp...> - 2003-09-16 22:50:41
|
Dnia Monday 15 of September 2003 23:13, Aditya Mahajan napisał: > Hello, > > Add folds for: > abstract > keywords "Both of these are useful while writing papers > > " include folds for amsmath package > align/alignat > gather > intertext OK. I will include this. AMS names are almost part of standard LaTeX. > > "include fold for > sidewaysfigure What is this? Package specific environments should go to package files but I am afraid this is impossible at the moment. Srinath? > These environments need to be added in the TexFoldTextFunction() also. > Also when I include a bibliography in the file, it gets folded with the > last section. I find this very annoying and found out that this can be > removed by > ^\s*\\begin{thebibliography}|^\s*\\bibliography > tags in the fold end pattern for section, subsection, subsubsection and > chapter. I don't touch this. Maybe someone better oriented in folding. m. -- LaTeX + Vim = http://vim-latex.sourceforge.net/ |
From: Srinath A. <sr...@fa...> - 2003-09-17 18:09:00
|
On Wed, 17 Sep 2003, Mikolaj Machowski wrote: > > These environments need to be added in the TexFoldTextFunction() also. > > Also when I include a bibliography in the file, it gets folded with the > > last section. I find this very annoying and found out that this can be > > removed by > > ^\s*\\begin{thebibliography}|^\s*\\bibliography > > tags in the fold end pattern for section, subsection, subsubsection and > > chapter. > > I don't touch this. Maybe someone better oriented in folding. > I will patch folding.vim with the above suggestions soon. Thanks, Srinath |
From: Srinath A. <sr...@fa...> - 2003-09-18 00:34:01
|
On Mon, 15 Sep 2003, Aditya Mahajan wrote: > > ... always expands to $\cdots$ This is annoying it I just want to put ... > at some place in the comments. Is there some way in which you can check if > we are in the math mode or not and then only make the substitution. > Unfortunately, detecting math mode is not very easy in vim because certain things like \pi etc have a highlighting group which is called texCommand or something similar. This syntax group can be contained both in normal text as well as inside math. As of now, if latex-suite detects that the amsmath package is included, then it will always put \dots which amsmath adjusts correctly. Otherwise, it puts \cdots in math mode (if detected), otherwise it puts \ldots. I would recommend using \dots always instead of 3 dots anyway... > Add folds for: > abstract > keywords "Both of these are useful while writing papers > > " include folds for amsmath package > align/alignat > gather > intertext > Mikolaj added these items to folding.vim > "include fold for > sidewaysfigure > I am not sure where this environment occurs. Its not standard latex. I am wondering therefore if its advisable to add these to the standard latex-suite thingie? > These environments need to be added in the TexFoldTextFunction() also. > Also when I include a bibliography in the file, it gets folded with the > last section. I find this very annoying and found out that this can be > removed by > ^\s*\\begin{thebibliography}|^\s*\\bibliography > tags in the fold end pattern for section, subsection, subsubsection and > chapter. > I'll fix this. Thanks for the suggestions. Srinath |
From: Aditya M. <ad...@um...> - 2003-09-20 20:02:22
|
Hi, There is something that I find a little irritating with the latex-suite package. The menus are excellent but they occupy a lot of space on the gui. So whenever I am finished with the editing of the latex file, I do not want the menu anymore. There are other menus that I want to use, but there is no way in which the latex-suite menus can be turned off when I do not need them. Is there some way in which the filetype menus can be associated with the local buffer, so that when I delete the buffer containing the tex file then the tex menu is automatically deleted. Another mehtod could be that there is something like au BufLeave FileType=tex call delteMenu() <CR> where delteMenu is a function that deletes the menu. Otherwise it could be a entry (with a corresponding command) in the tex-Suite menu. This will be a much better option as I am not sure how the previous two will affect the speed of gvim. As it is gvim runs slightly slower than vim. If you guys want then maybe I could try to write the deleteBuffer function and you can figure out where it should go. Cheers aditya |
From: Srinath A. <sr...@fa...> - 2003-09-21 18:47:55
|
Aditya, On Sat, 20 Sep 2003, Aditya Mahajan wrote: > Hi, > There is something that I find a little irritating with the latex-suite > package. The menus are excellent but they occupy a lot of space on the > gui. So whenever I am finished with the editing of the latex file, I do > not want the menu anymore. There are other menus that I want to use, but > there is no way in which the latex-suite menus can be turned off when I > do not need them. > Is there some way in which the filetype menus can be associated with > the local buffer, so that when I delete the buffer containing the tex > file then the tex menu is automatically deleted. > Another mehtod could be that there is something like > au BufLeave FileType=tex call delteMenu() <CR> > This topic has come up in the past, and unfortunately, I have been putting a damper on things. We thought of something like au BufEnter * :call Tex_CheckMenus() (note BufEnter instead of BufLeave). Tex_CheckMenus() will check if the buffer being entered is a tex buffer and if so, leave the menus intact if they are already present and regerate the menus if they no longer exist. Otherwise it will kill the menus. However, regenerating menus is a very time-consuming process and I beleive it will be more of an annoyance than a time-saver. Also, the menus which are created by Latex-suite are not created by a single function but by various sub-functions distributed in various scripts. For something like this to work, those things will have to pulled together... Better still, all those various places will create menus independently, but on a LatexSuiteCreateMenus event which could be fired from Tex_CheckMenus as needed. You know, I do not want to veto against this or anything. As of right now, I am running short on time, so this might have to wait for a while (3-4 weeks). > where delteMenu is a function that deletes the menu. > > Otherwise it could be a entry (with a corresponding command) in the > tex-Suite menu. This will be a much better option as I am not sure how > the previous two will affect the speed of gvim. As it is gvim runs > The other method of listing all of latex-suite's menus under a single master menu is already possible. Unfortunately, this does not seem to be documented :( You have to set the value of g:Tex_MenuPrefix to something which includes a '.' in it. The default value is 'TeX'. This creates TeX-Suite, TeX-Packages etc. If you set it to 'Latex-Suite.' then all menus will be nested under the 'Latex-Suite' menu. HTH Srinath |
From: Aditya M. <ad...@um...> - 2003-09-21 19:24:29
|
Hi Srinath, Today Srinath Avadhanula wrote about Re: [Vim-latex-devel] Delete Menus... >Aditya, > >> Hi, >> There is something that I find a little irritating with the latex-suite >> package. The menus are excellent but they occupy a lot of space on the >> gui. So whenever I am finished with the editing of the latex file, I do >> not want the menu anymore. There are other menus that I want to use, but >> there is no way in which the latex-suite menus can be turned off when I >> do not need them. >> Is there some way in which the filetype menus can be associated with >> the local buffer, so that when I delete the buffer containing the tex >> file then the tex menu is automatically deleted. >> Another mehtod could be that there is something like >> au BufLeave FileType=tex call delteMenu() <CR> >> >This topic has come up in the past, and unfortunately, I have been >putting a damper on things. We thought of something like > >au BufEnter * :call Tex_CheckMenus() > >(note BufEnter instead of BufLeave). Tex_CheckMenus() will check if the >buffer being entered is a tex buffer and if so, leave the menus intact >if they are already present and regerate the menus if they no longer >exist. Otherwise it will kill the menus. However, regenerating menus is >a very time-consuming process and I beleive it will be more of an >annoyance than a time-saver. Also, the menus which are created by >Latex-suite are not created by a single function but by various >sub-functions distributed in various scripts. For something like this to >work, those things will have to pulled together... Better still, all >those various places will create menus independently, but on a >LatexSuiteCreateMenus event which could be fired from Tex_CheckMenus as >needed. > >You know, I do not want to veto against this or anything. As of right >now, I am running short on time, so this might have to wait for a while >(3-4 weeks). > I understand, you guys are also under a lot of pressure and to have developed such a great package does take a lot of time and effort. > >> where delteMenu is a function that deletes the menu. >> >> Otherwise it could be a entry (with a corresponding command) in the >> tex-Suite menu. This will be a much better option as I am not sure how >> the previous two will affect the speed of gvim. As it is gvim runs >> >The other method of listing all of latex-suite's menus under a single >master menu is already possible. Unfortunately, this does not seem to be >documented :( You have to set the value of g:Tex_MenuPrefix to something >which includes a '.' in it. The default value is 'TeX'. This creates >TeX-Suite, TeX-Packages etc. If you set it to 'Latex-Suite.' then all >menus will be nested under the 'Latex-Suite' menu. > I did not know about this feature. This is close to what I want. I tried with TexLet g:Tex_MenuPrefix="Late&x-Suite." and then tearoff Tex-Suite This works fine for my requirements. Infact what I find better is TexLet g:Tex_MenuPrefix="]Latex-Suite" and then tear-off. This way, it does not clutter my menu space at all, and as I use the menu infrequently, this is just about perfect. Thanks for your help Cheers Aditya >HTH >Srinath > |
From: <mi...@wp...> - 2003-09-22 09:25:26
|
On 21 Sep 2003 at 15:24, Aditya Mahajan wrote: > >> There is something that I find a little irritating with the latex-suite > >> package. The menus are excellent but they occupy a lot of space on the > >> gui. So whenever I am finished with the editing of the latex file, I do > >> not want the menu anymore. There are other menus that I want to use, but > >> there is no way in which the latex-suite menus can be turned off when I > >> do not need them. Other problem with menus: they are really heavy. One idea: extract from current math menus those elements which are in basic latex (without ams packages). Load it by default. Add to this option "Load advanced math elements". If chosen unload current menu and load full math menus. Of course here should be: "Unload advanced math". Because math is responsible for ca. 60% of all menus it should reduce overall number of menus about 30%. This is similar trick to this with syntax menus in "core Vim". Srinath what do you think about that? I came across that some time ago but this is really boring to make :) Other solution is to get rid of "exe" statements with menus but with it we lost possibility of moving menus. m. |
From: Luc H. <her...@fr...> - 2003-09-23 12:34:28
|
hello, * On Sun, Sep 21, 2003 at 11:47:43AM -0700, Srinath Avadhanula <sr...@fa...> wrote: > > au BufLeave FileType=tex call delteMenu() <CR> > > > This topic has come up in the past, and unfortunately, I have been > putting a damper on things. We thought of something like > > au BufEnter * :call Tex_CheckMenus() > > Tex_CheckMenus() will check if the buffer being entered is a tex > buffer and if so, leave the menus intact if they are already present > and regerate the menus if they no longer exist. Otherwise it will > kill the menus. However, regenerating menus is a very time-consuming > process and I beleive it will be more of an annoyance than a > time-saver. In an ftplugin, I'm disabling the menus associated. It is not as slow as deleting every thing, and it can be done on the root menu. Re-enabling the menu is very simple as well. => if g:want_buffermenu_for_tex == 2 " {{{ augroup LTXMenuEnableDisable au! au BufEnter *.tex,*.sty amenu enable LaTeX au BufLeave,BufUnload *.tex,*.sty amenu disable LaTeX augroup END endif " }}} It won't disapear from the menu-bar, but at least it can't be used. -- Luc Hermitte http://hermitte.free.fr/vim/ |
From: Aditya M. <ad...@um...> - 2003-09-19 20:26:04
|
Hi, I really find latex suite really useful. I work on latex a lot, started with lyx, but once I got familiar with the code, shifted to gvim (which happens to be my favourite editor). I was just browsing and came though this package for preview-latex (http://preview-latex.sourceforge.net/) for xemacs, and by the look of it, it looks really impressive. The main feature that I am concerned about is the ability to display math. I always liked that feature in lyx also. I am wondering, why it can not be done in (g)vim. I think that one could use a unicode encoding for the file and replace \sum by sigma from unicode and go about it. The only problem that I see is that vim does not allow one to use different fonts and different font sizes for different lines (after all it is a humble text editor). But how about something like this, detect when you are in math mode and keep three lines for display for each math mode (or open the display in another preview window and keep three line in that) with subscripts and superscripts going at respective places. The main advantage is that if there is a sytax error, you will know immediately and will not always have to compile to see how it looks like. Just musing... Cheers aditya |
From: Srinath A. <sr...@fa...> - 2003-09-21 18:32:32
|
Hi Aditya, On Fri, 19 Sep 2003, Aditya Mahajan wrote: > this package for preview-latex (http://preview-latex.sourceforge.net/) for > xemacs, and by the look of it, it looks really impressive. > The main feature that I am concerned about is the ability to display > math. I always liked that feature in lyx also. I am wondering, why it can > not be done in (g)vim. I think that one could use a unicode encoding for > the file and replace \sum by sigma from unicode and go about it. The only > I must admit preview-latex does sound extremeley impressive and might be very useful. But IMHO you underestimate the complexity of rendering equations using unicode fonts. Simple things like $x^2 + y^2 = z^2$ might be fine, because most probably we could just use the singe line itself, but with more complex equations where the latex source occupies much more space than the equation displayed, things will get very very complex indeed. You will notice that preview-latex actually runs latex and then ghostscript to generate the bitmap and then displays that inline in the document. I beleive that a project which aims to do something like this in native vim script is going to be as complicated as LaTeX itself! Infact, an easier solution would be to patch VIM itself to allow for inline graphics and then use the same route which preview-latex does. Ofcourse, having delved into the VIM source only very briefly, I do not know if this is even feasible. Quite frankly, I would not even attempt something this complicated myself :( Also, for simple things like displaying the actual greek character theta instead of \theta, the greek Sigma character in place of \sum etc, I beleive someone has already done something like that in VIM. I do not have the URL handy though. And I wonder how they handle the case where in some places, the user wants \sum but wants to display \sigma in other places... Srinath |
From: Aditya M. <ad...@um...> - 2003-10-03 15:55:54
|
Hi Srinath, Sep 21 Srinath Avadhanula wrote about Re: [Vim-latex-devel] Features like... >Hi Aditya, > >On Fri, 19 Sep 2003, Aditya Mahajan wrote: > >> this package for preview-latex (http://preview-latex.sourceforge.net/) for >> xemacs, and by the look of it, it looks really impressive. >> The main feature that I am concerned about is the ability to display >> math. I always liked that feature in lyx also. I am wondering, why it can >> not be done in (g)vim. I think that one could use a unicode encoding for >> the file and replace \sum by sigma from unicode and go about it. The only >> >I must admit preview-latex does sound extremeley impressive and might be >very useful. But IMHO you underestimate the complexity of rendering >equations using unicode fonts. Simple things like $x^2 + y^2 = z^2$ >might be fine, because most probably we could just use the singe line >itself, but with more complex equations where the latex source occupies >much more space than the equation displayed, things will get very very >complex indeed. > >You will notice that preview-latex actually runs latex and then >ghostscript to generate the bitmap and then displays that inline in the >document. I beleive that a project which aims to do something like this >in native vim script is going to be as complicated as LaTeX itself! > >Infact, an easier solution would be to patch VIM itself to allow for >inline graphics and then use the same route which preview-latex does. >Ofcourse, having delved into the VIM source only very briefly, I do not >know if this is even feasible. > Please have a look at http://www.angelfire.com/vt2/conceal/ and http://www.angelfire.com/vt2/conceal/Introduction.html for a snapshot. This is closer to what I had in mind, though I do not like some of the aspects of the implementation. I think that somethings like having section headings in bold and using unicode characters to display greek symbols would be much better. It does not try to render equations, but is much closer to what I would like to have. But the only trouble is that is is given as a patch to the original code, but I do not have the courage to read the entire vim code and try to figure it out. My question: Is it possible to do something like this in a vim script. This is what I think is possible.... open a preview window and scrollbind it to the main tex window. This is exactly what the author of conceal is doing. Make some changes to the higlight scheme to be used for preview window (how?? the preview window has no tags!) to have things like bold underline, a different color for the math mode and replacement of simple math characters (you mentioned that there was a script that already did this, so that will save some work) and we have a system where we can preview as we type. Maybe I am still on a bit of a nostalgia from lyx. I learnt latex b working on lyx. And I found it amazing. Then I shifted to typing documents in latex as lyx does not give me as much control as raw latex does. Also there was the problem of editing in lyx, use the arrow keys, copy paste, everyhting was too primitive. That is why I shifted to latex+vim. Now I wonder of (g)vim can give atleast some comparable viewing. Cheers aditya >Quite frankly, I would not even attempt something this complicated >myself :( > >Also, for simple things like displaying the actual greek character theta >instead of \theta, the greek Sigma character in place of \sum etc, I >beleive someone has already done something like that in VIM. I do not >have the URL handy though. And I wonder how they handle the case where >in some places, the user wants \sum but wants to display \sigma in other >places... > >Srinath > |
From: Mikolaj M. <mi...@wp...> - 2003-10-04 08:21:18
|
Dnia Friday 03 of October 2003 17:55, Aditya Mahajan napisał: > Please have a look at http://www.angelfire.com/vt2/conceal/ > and http://www.angelfire.com/vt2/conceal/Introduction.html for > a snapshot. This is Vince Negri patch and it will be in Vim 6.3 > > My question: > Is it possible to do something like this in a vim script. This is what > I think is possible.... I am planning to add this feature when it will be official part of Vim. This is: 1. Too much work to do when it will be used by small group of people (how many use unofficial - yet - patches?) 2. I will significantly increase size of LaTeX-Suite. I am afraid you have to wait for 6.3 + ca. one month to see it in LaTeX-Suite. Maybe if you could convince Bram to already include this in patches for Vim 6.2 I would start to work on it but no earlier. But Bram constantly refuse to add new features currently. Sorry. m. |
From: Baris E. <be...@an...> - 2004-01-23 06:57:58
|
Dear All, I have a couple of questions about using vim and vim-latex under windows.=20 My first question is when I type some text and go down to next line the backspace key does not turn back to the previous line and if I put the cursor on the previous line still I cant delete anything with the backsapce key. What may be the reason to this? Second one is this: Due to some licensing problems I may have to use windows insted of Linux. What I do for my presentation tex file under linux is to use a command line to compile, convert it to ps and to pdf as follows: latex file.tex; dvips -P pdf -t a4 file ; ps2pdf13 file But this command line does not work properly under windows. What happens is when I compile the file under gvim with using the command line it creates the .dvi file in the root of that directory, i.e.=20 If I have=20 Z: --->documents ----->foo -----> file.tex The .dvi is created under Z:\ It is a bit odd. If I can create this .dvi file under the above directory I can solve my problem. Any help is appreciated.... Thanks Baris |
From: Mikolaj M. <mi...@wp...> - 2004-01-24 00:27:57
|
Dnia Friday 23 of January 2004 07:57, Baris Erbas napisał: > Dear All, > I have a couple of questions about using vim and vim-latex under > windows. > My first question is when I type some text and go down to next line the > backspace key does not turn back to the previous line and if I put the > cursor on the previous line still I cant delete anything with the > backsapce key. What may be the reason to this? > this is Vim option :help 'backspace' m. |