Thread: [Vim-latex-devel] running latex
Brought to you by:
srinathava,
tmaas
From: Carl M. <cm...@ma...> - 2002-11-12 14:01:10
|
I propose that "\ll" should run latex twice. On the first run, you usually get all kinds of spurious error messages such as "reference ... not defined". This happens because on the first run, the .aux file does not yet exist. It's distracting to get these messages, and then have to close down the error window and run latex again. I would also suggest that folding of math expressions be an option, not the default behavior. When writing latex, you always want to see the math expressions. Best wishes, Carl Mueller |
From: Carl M. <cm...@ma...> - 2002-11-19 19:31:02
|
I have some suggestions about running latex and viewing the errors. Once again, emacs did it right, in my opinion (in the auctex package). After running latex, the .log file appears in its own window. Typing C-c` will take you to the next tex error. The cursor is placed on the exact position of the error. This is indicated in the .log file by a split line, with the split at the postion of the error. Also, the .log file has hints about correcting the error. Less of that happens in quickfix mode. The cursor is not positioned at the point of the error. (Of course, with :cn one can go to the line of the error, but not the position within the line). Only a one-line description of the error is given, while the .log file has lots of information. Another issue is with xdvi. I don't know the situation with windows. On Unix, if you run latex within vim, the xdvi viewer does not automatically update, and you have to click in it. But if you run latex within an x-terminal, xdvi does automatically update the view. Also, if you give vim the command to launch an x-term, and then tell vim to start looking at the .log file, it will look at the .log file before latex has finished running. With Vim-LaTex, you get to view the errors right away, but xdvi doesn't automatically update. I prefer automatic updating of xdvi. For this reason, I have 2 sets of macros. One of them has xdvi automatically updating, but the errors do not automatically show up. In the second, you have to click in xdvi to update, but the errors automatically show up. I know people have put in a lot of work on the quickfix way of displaying tex errors. Could my suggestions be considered as an option? Carl Mueller I'm listing 2 sets of functions. Both allow you to run latex, view the .log file with syntax highlighting, and automatically go to the position of the error. There are also functions to view \ref{} and \cite{} errors, or look at the log file, and go to the line mentioned in the file. You might also want to consider a macro a got from Charles Campbell (and modified), which allows you to run latex on a file or a highlighted region. The key bindings in these files are bad; they're not the important part. """"""""""""""""""""""""""""""""""""""""""" " Macros with automatic updating of xdvi " Latex command. let b:latex_command = "! xterm -bg ivory -fn 7x14 -e latex % &" "let b:latex_command = "! latex \\\\nonstopmode \\\\input\\{%\\}" " Key Bindings {{{ " Run Latex; change these bindings if you like. noremap <buffer> \ml :call <SID>RunLatex()<CR><Esc> noremap <buffer> \mr :call <SID>CheckReferences("Reference", "ref")<CR><Space> noremap <buffer> \mc :call <SID>CheckReferences("Citation", "cite")<CR><Space> noremap <buffer> \mg :call <SID>LookAtLogFile()<CR>gg/LaTeX Warning\\|^!<CR> noremap <buffer> \mn :call <SID>NextTexError()<CR><Space> noremap <buffer> \mv :call <SID>Xdvi()<CR><Space> noremap <buffer> \mi :w<CR>:silent ! xterm -bg ivory -fn 10x20 -e ispell %<CR>:e %<CR><Space> noremap <buffer> K :call <SID>RunLatex()<CR><Esc> noremap <buffer> <C-K> :call <SID>NextTexError()<CR><Space> " Run Ispell on either the buffer, or the visually selected word. noremap <buffer> <S-Insert> :w<CR>:silent ! xterm -bg ivory -fn 10x20 -e ispell %<CR>:e %<CR><Space> inoremap <buffer> <S-Insert> <Esc>:w<CR>:silent ! xterm -bg ivory -fn 10x20 -e ispell %<CR>:e %<CR><Space> vnoremap <buffer> <S-Insert> <C-C>`<v`>s<Space><Esc>mq:e ispell.tmp<CR>i<C-R>"<Esc>:w<CR>:silent ! xterm -bg ivory -fn 10x20 -e ispell %<CR>:e %<CR><CR>ggVG<Esc>`<v`>s<Esc>:bwipeout!<CR>:!rm ispell.tmp*<CR>`q"_s<C-R>"<Esc> " }}} " Functions {{{ function! s:RunLatex() update exe "silent " . b:latex_command endfunction " Stop warnings, since the log file is modified externally and then " read again. au BufRead *.log set bufhidden=unload function! s:NextTexError() silent only edit +1 %<.log syntax clear syntax match err /! .*/ syn match err /^ l\.\d.*\n.*$/ highlight link err ToDo if search('^l\.\d') == 0 edit # redraw call input("\nNo (More) Errors Found\n\nPress 'enter' to go on.") else let linenumber = matchstr(getline('.'), '\d\+') let errorposition = col("$") - strlen(linenumber) - 4 "Put a space in the .log file so that you can see where you were, "and move on to the next latex error. s/^/ / write split # exe "normal " . linenumber . "G" . errorposition . "lzz\<C-W>wzz\<C-W>w" endif endfunction function! s:CheckReferences(name, ref) "exe "noremap \<buffer> \<C-L> :call \<SID>CheckReferences(\"" . a:name . "\",\"" . a:ref . "\")\<CR>\<Space>" only edit +1 %<.log syntax clear syntax match err /LaTeX Warning/ highlight link err ToDo if search('^LaTeX Warning: ' . a:name) == 0 edit # redraw call input("\nNo (More) " . a:name . " Errors Found\n\nPress 'enter' to go on.") else let linenumber = matchstr(getline('.'), '\d\+\.$') let linenumber = strpart(linenumber, 0, strlen(linenumber)-1) let reference = matchstr(getline('.'), "`.*\'") let reference = strpart(reference, 1, strlen(reference)-2) "Put a space in the .log file so that you can see where you were, "and move on to the next latex error. s/^/ / write split # exe "normal " . linenumber . "Gzz\<C-W>wzz\<C-W>w" exe "normal /\\\\" . a:ref . "{" . reference . "}\<CR>" exe "normal /" . reference . "\<CR>" endif endfunction function! s:LookAtLogFile() only edit +1 %<.log syntax clear syntax match err /LaTeX Warning/ syntax match err /! .*/ syntax match err /^Overfull/ syntax match err /^Underfull/ highlight link err ToDo noremap <buffer> K :call <SID>GetLineFromLogFile()<CR> split # wincmd b /LaTeX Warning\|^\s*!\|^Overfull\|^Underfull let @/='LaTeX Warning\|^\s*!\|^Overfull\|^Underfull' echo "\nGo to the line in the log file which mentions the error\nthen type K to go to the line\nn to go to the next warning\n" endfunction function! s:GetLineFromLogFile() let line = matchstr(getline("."), 'line \d\+') wincmd t exe strpart(line, 5, strlen(line)-5) endfunction " }}} " vim:fdm=marker """"""""""""""""""""""""""""""""""""""""""" " Macros which automatically show the errors. " Latex command. let b:latex_command = "! xterm -bg ivory -fn 7x14 -e latex % &" "let b:latex_command = "! latex \\\\nonstopmode \\\\input\\{%\\}" " Key Bindings {{{ " Run Latex; change these bindings if you like. noremap <buffer> \ml :call <SID>RunLatex()<CR><Esc> noremap <buffer> \mr :call <SID>CheckReferences("Reference", "ref")<CR><Space> noremap <buffer> \mc :call <SID>CheckReferences("Citation", "cite")<CR><Space> noremap <buffer> \mg :call <SID>LookAtLogFile()<CR>gg/LaTeX Warning\\|^!<CR> noremap <buffer> \mn :call <SID>NextTexError()<CR><Space> noremap <buffer> \mv :call <SID>Xdvi()<CR><Space> noremap <buffer> \mi :w<CR>:silent ! xterm -bg ivory -fn 10x20 -e ispell %<CR>:e %<CR><Space> noremap <buffer> K :call <SID>RunLatex()<CR><Esc> noremap <buffer> <C-K> :call <SID>NextTexError()<CR><Space> " Run Ispell on either the buffer, or the visually selected word. noremap <buffer> <S-Insert> :w<CR>:silent ! xterm -bg ivory -fn 10x20 -e ispell %<CR>:e %<CR><Space> inoremap <buffer> <S-Insert> <Esc>:w<CR>:silent ! xterm -bg ivory -fn 10x20 -e ispell %<CR>:e %<CR><Space> vnoremap <buffer> <S-Insert> <C-C>`<v`>s<Space><Esc>mq:e ispell.tmp<CR>i<C-R>"<Esc>:w<CR>:silent ! xterm -bg ivory -fn 10x20 -e ispell %<CR>:e %<CR><CR>ggVG<Esc>`<v`>s<Esc>:bwipeout!<CR>:!rm ispell.tmp*<CR>`q"_s<C-R>"<Esc> " }}} " Functions {{{ function! s:RunLatex() update exe "silent " . b:latex_command call <SID>NextTexError() endfunction " Stop warnings, since the log file is modified externally and then " read again. au BufRead *.log set bufhidden=unload function! s:NextTexError() silent only split wincmd j edit +1 %<.log if search('^l\.\d') == 0 bwipeout redraw call input("\nNo (More) Errors Found\n\nPress 'enter' to go on.") else syntax clear syntax match err /! .*/ syn match err /^ l\.\d.*\n.*$/ highlight link err ToDo let linenumber = matchstr(getline('.'), '\d\+') let errorposition = col("$") - strlen(linenumber) - 4 "Put a space in the .log file so that you can see where you were, "and move on to the next latex error. s/^/ / write wincmd k exe "normal " . linenumber . "G" . errorposition . "lzz\<C-W>wzz\<C-W>w" endif endfunction function! s:CheckReferences(name, ref) "exe "noremap \<buffer> \<C-L> :call \<SID>CheckReferences(\"" . a:name . "\",\"" . a:ref . "\")\<CR>\<Space>" only edit +1 %<.log syntax clear syntax match err /LaTeX Warning/ highlight link err ToDo if search('^LaTeX Warning: ' . a:name) == 0 edit # redraw call input("\nNo (More) " . a:name . " Errors Found\n\nPress 'enter' to go on.") else let linenumber = matchstr(getline('.'), '\d\+\.$') let linenumber = strpart(linenumber, 0, strlen(linenumber)-1) let reference = matchstr(getline('.'), "`.*\'") let reference = strpart(reference, 1, strlen(reference)-2) "Put a space in the .log file so that you can see where you were, "and move on to the next latex error. s/^/ / write split # exe "normal " . linenumber . "Gzz\<C-W>wzz\<C-W>w" exe "normal /\\\\" . a:ref . "{" . reference . "}\<CR>" exe "normal /" . reference . "\<CR>" endif endfunction function! s:LookAtLogFile() only edit +1 %<.log syntax clear syntax match err /LaTeX Warning/ syntax match err /! .*/ syntax match err /^Overfull/ syntax match err /^Underfull/ highlight link err ToDo noremap <buffer> K :call <SID>GetLineFromLogFile()<CR> split # wincmd b /LaTeX Warning\|^\s*!\|^Overfull\|^Underfull let @/='LaTeX Warning\|^\s*!\|^Overfull\|^Underfull' echo "\nGo to the line in the log file which mentions the error\nthen type K to go to the line\nn to go to the next warning\n" endfunction function! s:GetLineFromLogFile() let line = matchstr(getline("."), 'line \d\+') wincmd t exe strpart(line, 5, strlen(line)-5) endfunction " }}} " vim:fdm=marker |
From: Carl M. <cm...@ma...> - 2002-11-19 19:49:33
|
On Tue, Nov 19, 2002 at 02:31:32PM -0500, Carl Mueller wrote: > You might also want to consider a macro a got from Charles Campbell (and > modified), which allows you to run latex on a file or a highlighted region. Sorry, I meant running ispell, not latex. Best wishes, Carl |
From: Benji F. <fis...@bc...> - 2002-11-19 21:50:54
|
Carl Mueller wrote: > > I have some suggestions about running latex and viewing the errors. > > Once again, emacs did it right, in my opinion (in the auctex package). > After running latex, the .log file appears in its own window. > Typing C-c` will take you to the next tex error. The cursor is > placed on the exact position of the error. This is indicated in > the .log file by a split line, with the split at the postion of the > error. Also, the .log file has hints about correcting the error. If we want to load the .log file instead of the quickfix window, we could define a custom file type. We would explicitly :set ft=texlog instead of trying to have the filetype detected automatically. Then we could define custom syntax and key mappings to get the desired behavior. A lot of work, but possible. It might be possible (or easier) to get the same effect by fiddling with the quickfix window. > Less of that happens in quickfix mode. The cursor is not positioned > at the point of the error. (Of course, with :cn one can go to the line > of the error, but not the position within the line). Only a one-line > description of the error is given, while the .log file has lots of > information. I agree: I often miss the extra information in the .log file. Some time, I want to discuss the defaults: I think the warning level affects this. > Another issue is with xdvi. I don't know the situation with windows. [snip] > > I prefer automatic updating of xdvi. MikTeX (on windows) automatically updates the viewer when it gains focus. This is A Good Thing. That reminds me: is there any reason not to have RunLaTeX() start with :update ? > For this reason, I have 2 sets of macros. One of them has xdvi > automatically updating, but the errors do not automatically show up. > In the second, you have to click in xdvi to update, but the errors > automatically show up. [snip] I am sorry, I do not have time to look at these now. (Maybe not for a while ...) Are your two scripts exclusive? That is, can you not get both improvements at the same time? --Benji |
From: Carl M. <cm...@ma...> - 2002-11-19 22:36:06
|
Dear Benji, On Tue, Nov 19, 2002 at 04:52:08PM -0500, Benji Fisher wrote: > I am sorry, I do not have time to look at these now. (Maybe not > for a while ...) Are your two scripts exclusive? That is, can you not > get both improvements at the same time? > > --Benji > I didn't know that one could update xdvi from within vim. If that is possible, then one could combine the scripts. The only differences are in the RunLatex and NextTexError functions. Best wishes, Carl |
From: Srinath A. <sr...@ee...> - 2002-11-20 05:22:46
|
DQpIZWxsbyBDYXJsLA0KDQo+IEkgcHJlZmVyIGF1dG9tYXRpYyB1cGRhdGlu ZyBvZiB4ZHZpLg0KPg0KRmlyc3RseSwgdGhlIHRoaW5nIHdoZXJlIHlvdSBw cmVmZXIgdG8gdXBkYXRlIHRoZSB4ZHZpIHRoaW5nIGlzIGENCnNldHRpbmcg cHJvYmxlbSByYXRoZXIgdGhhbiBoYXZpbmcgdG8gcmV3cml0ZSBjb2RlLiBZ b3UgY291bGQgc2V0DQoNCmc6VGV4X0NvbXBpbGVSdWxlX2R2aSA9ICd4dGVy bSAtYmcgaXZvcnkgLWZuIDd4MTQgLWUgbGF0ZXggJCogJicNCg0KaWYgeW91 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cyBpdA0K cHJlc2VudGx5IGlzIGhhcyBiZWVuIGEgY29udGludWluZyBjaGFsbGVuZ2Uu Li4gSSB3b3VsZCByZWFsbHkgcHJlZmVyIGENCnNvbHV0aW9uIHdoaWNoIGVp dGhlciBldmVyeW9uZSBsaWtlcyBvciBpcyBjdXN0b21pemFibGUuLi4NCg0K VGhhbmtzLA0KDQpTcmluYXRoDQoNClBTOiBJIGp1c3Qgbm90aWNlZCB0aGF0 IHRoZXJlIGlzIGEgYnVnIChhZ2FpbikgaW4gdGhlIGNvbXBpbGVyICdtYWtl cHJnJw0Kc2V0dXAuIElmIHRoZSB1c2VyIHNldHMgZzpUZXhfQ29tcGlsZVJ1 bGVfZHZpIGRpcmVjdGx5IGluIGhpcyB+Ly52aW1yYywNCnRoYXQgc2V0dGlu ZyBpcyBpZ25vcmVkIHVudGlsIHRoZSBmaXJzdCB0aW1lIGhlIGRvZXMgOlRD VGFyZ2V0IGR2aS4NCldoaWNoIGlzIG9mY291cnNlIGJlY2F1c2UgZzpUZXhf Q29tcGlsZVJ1bGVfZHZpIGlzIG5ldmVyIHVzZWQgaW4NCmNvbXBpbGVyL3Rl eC52aW0uLi4NCg0KDQo= |
From: Srinath A. <sr...@ee...> - 2002-11-20 11:56:53
|
Dear Carl, Here's an update about the compiler part... I just had a go at adding the kind of functionality you wanted. As I previously mentioned, I like the quickfix window because it gives us a nice overview of the errors and also allows us to fix the errors out of sequence. You and Benji seem to prefer looking at the log file. Hence I made a compormize. Show both! So here's what happens in the latest version: -----------------------------------%<----------------------------------- When you press \ll, then the quickfix window with one error on each line opens up. Beneath the quickfix window, the log file is opened in a "preview" window. The display within the preview window is adjusted to match with the error currently being examined by the user. When the user moves around within the quickfix window, this display is automatically adjusted to keep in sync. When the user presses <enter> in the quickfix window, then he is taken to the correct line and column number of the .tex file. The column number is computed either from the length of the broken line after l.\d\+ in the log file or if we have a undefined citation, then search for the missing citation word... TODO: 1. multiple errors on the same line dont work. the preview window gets stuck on the first error. 2. test more robustly. 3. Ask people about various formats of LaTeX warnings, so we can guess column numbers in other situations too. As of now, only undefined citations and errors are caught well. For all other kinds, we goto the first column of the correct line number. -----------------------------------%<----------------------------------- Please try it out when you get a chance. http://vim-latex.sourceforge.net/download/latexSuite-beta.zip (Note: Its still "slightly" beta, but should be fixed up soon). BTW, Mikolaj and I have also included most of your suggestions about the environment macros. Right now, pressing <F5> in insert mode prompts for an environment to insert... We will soon also implement a customizable way to have <S-F1...4> map to common environments. The bracketing polymorphic functions have been merged into latex-suite (thanks!) as well as the ReadLine() function for splitting a line keeping $$ in the same line... All in all, almost all your suggestions so far have been incorporated :) Please remind us if we have forgotten something. Have a look, Srinath On Tue, 19 Nov 2002, Srinath Avadhanula wrote: > > Hello Carl, > > > I prefer automatic updating of xdvi. > > > Firstly, the thing where you prefer to update the xdvi thing is a > setting problem rather than having to rewrite code. You could set > > g:Tex_CompileRule_dvi =3D 'xterm -bg ivory -fn 7x14 -e latex $* &' > > if you want the xdvi to be updated. Thats why there are all these > customization options in latex-suite... so each person can be happy. I > dont think its a good idea to hardcode something like this in > latex-suite. As of now, I think this complaint/preference of yours can > be handled completeley within the existing structure. > > [ NOTE: I just found out that there is bug in latex-suite which makes > this suggestion of mine not true... see the post-script. The bug > is very easy to fix and I am on it now ] > > Also, when you say the .log file is not updated when you have the above > setting, thats obviously because you run the latex command in the > background and immediately look at the log file. What about doing > something like: > > g:Tex_CompileRule_dvi=3D 'xterm -bg ivory -fn 7x14 -e latex \nonstopmode = \input{$*}; cat $*.log' > > That will get the xterm to quit as soon as latex finishes and you get > the automatically updated quickfix window. > > I tried this out on my cygwin/xdvi/latex/xterm setup and it does work > pretty well... (there were a few problems with characters in the > quickfix window, but that doesn't seem like a big deal. A matter of > passing it through sed or something to chomp lines...) > > > I know people have put in a lot of work on the quickfix way of > > displaying tex errors. Could my suggestions be considered as > > an option? > > > Also, the quickfix window does not give you as little information as you > think... In fact, the line which you see in the quick-fix window is a > concatenation of all lines in the log file starting from the one > starting with '!' to the first blank line after that... I have never > found any information about the error beyond that... > > About the going to the exact location thing... > > I personally do not like :cnext but the :cwindow method, because it lets > me go to some arbitrary error without having to go in order. Therefore, > the method proposed here of indenting the .log file seems not the optmal > one. I think a solution which fits in better with the existing setup > (and which I think will be more elegant) is to first list things in > cwindow and if the user wants open a preview window or something... This > should be not hard to do at all... Just a matter of having something > like: > > map p :pedit ^l.10<CR>:wincmd w<CR> > > Anyway, setting up the compiler and making it as customizable as it > presently is has been a continuing challenge... I would really prefer a > solution which either everyone likes or is customizable... > > Thanks, > > Srinath > > PS: I just noticed that there is a bug (again) in the compiler 'makeprg' > setup. If the user sets g:Tex_CompileRule_dvi directly in his ~/.vimrc, > that setting is ignored until the first time he does :TCTarget dvi. > Which is ofcourse because g:Tex_CompileRule_dvi is never used in > compiler/tex.vim... > > > N=18=AC=B1=F9=DE=B5=E9=9A=8AX=AC=B2=9A'=B2=8A=DEu=BC=BEN=89^j=B9=ED=85=E6= =DA=B2',=A1=FB=1Er=EA=E2=9E=0C=A8=BA=BC=1En=C8=AD{=08=AD=85$=8BrX=9C=92=17= =ABz=DA z=D6=85DA=13D=80=0B=A1=F6=93=85=AC-y'=AB=BD=EA=C2z=BBb~' |
From: Srinath A. <sr...@ee...> - 2002-11-12 14:30:39
|
Hello, Luc and Benji discussed this just a while ago: Luc suggested quite a comprehensive algorithm for rerunning latex. If we want to go along the route, I think the following is best (Luc's idea). > I check the main loop for tex->dvi/pdf ... > > 1- if there exist a .idx file, makeindex is run, (a backup for the old > one beeing made) > 2- On the first passage in 2-, if there is '\bibdata' in the .aux file, > bibtex is run > 3- if is there exists a .bbl file, it is backuped > 4- run e\=\(pdf\)\=\(la\)=tex > 5- same as 2- > 6- checks if the .log file ask for a rerun (not always correctly > working) and check if the .idx has changed ; if either requires it, > goto 1- > > hum... may be I should delete 2- and change 6- to check the need of > re-running based of bibtex changes. I did take a look at tex-tools.vim and it already seems to be implemented :) So it shouldn't be too big of a deal to get it into latex-suite. Also, ref the steps above, what happens if there is no .aux file in step 2 above like carl says will happen the first time round... I'll put this on my TODO list. > I would also suggest that folding of math expressions be an > option, not the default behavior. When writing latex, you > always want to see the math expressions. Okay. To be frank, I haven't had a chance to actually do latex in quite some time... Thanks, Srinath -- Srinath Avadhanula Nov 12 6:27am Look out! Behind you! |
From: Luc H. <her...@fr...> - 2002-11-12 19:45:40
|
Hi, * On Tue, Nov 12, 2002 at 06:31:54AM -0800, Srinath Avadhanula <sr...@ee...> wrote: > Luc suggested quite a comprehensive algorithm for rerunning latex. If we > want to go along the route, I think the following is best (Luc's idea). > [...] > I did take a look at tex-tools.vim and it already seems to be > implemented :) :-) BTW, this script should be easy to integrate as it does not require any other script. Except searchInRuntime that will not be required anymore -- I used it to search for vim-tex.sh. I'll finish my current enhancements on mu-template, and then I will patch tex-tools to make it integrable into latex-suite > So it shouldn't be too big of a deal to get it into latex-suite. Also, > ref the steps above, what happens if there is no .aux file in step 2 > above like carl says will happen the first time round... I haven't been very deep in details, but I never check the content of files that don't exist (aux, bib, bbl, log, etc). Also, I haven't said that if an error is detected during the run, a message box ask the user weither he wishes to continue the compilation (ie to continue in the loop) or weither he'd rather stop it and see the errors-window. -- Luc Hermitte |