[Vim-latex-devel] (La)TeX compilation
Brought to you by:
srinathava,
tmaas
From: Luc H. <her...@fr...> - 2003-07-15 08:58:39
|
* On Tue, Jul 15, 2003 at 12:13:51AM -0700, Srinath Avadhanula <sr...@fa...> wrote: > On Tue, 15 Jul 2003, Luc Hermitte wrote: > > - Why > > exec 'silent! 0r! '.g:Tex_CatCmd.' '.a:filename > > and not just: > > if fileexists(a:filename) > > exec 'silent! 0r '.a:filename > > endif > > ? > > I tried doing :r {fname} before but found that it actually creates a > new buffer in the process. I think that creating unused buffers is a > greater evil than spawning a shell command. If you notice, I take a > lot of care to only create one temporary buffer in a session. What the hell ?! I wonder why ":r" and ":r! cat" differ so much. And what is the need of keeping an unused buffer ... Anyway. Thanks for the info! > Also r! {fname} seems to spawn the shell in the background in gvim, > so its not too intrusive... But, problem: what are the correct external-program amiga, macos, ... ? > I submitted a feature request about a function filecontents() in vim > which would basically return a <NL> seperated string of the contents > of a file, but I have a feeling its going to be neglected like always. > Sometimes I really wish viml had a few more basic building blocks. So do I. > > - Why > > if search(a:regexp, 'w') > > let retVal = 1 > > else > > let retVal = 0 > > endif > > instead of: > > let reVal = search(a:regexp, 'w') > 0 > > ? > Heh :) I guess it does make things more compact. I would go so far as to > say that I should have simply done: > > let retVal = search(..., ...) Yes and no. "search(...)" is not "boolean-like" as it is an int. "search(...)>0" is ; as it values 0 or 1. > [...] > So whats correct? Depending on return values from boolean algebra might > lead to inconsistencies, so be warned. I am. :) > BTW, Luc: how did you get the logic for what steps to follow to > generate the DVI file correctly? Mainly from Tomer Kol's initial program. So I will not be surprised to learn that it differs from the ones we can find in others Makefile/scripts. > I notice that TKMakeDVI first runs bibtex if file.aux contains > \bibdata even before running latex. > But this seems to be incorrect in situations where the modification is > to remove a bibliographic entry... i.e, if initially the file > contained > > \bibliography{fname} > > and I removed this line or changed fname and then did TKMakeDVI, then it > would wrongly make bibtex scan fname... I hope you see the problem. Yes indeed. However, bibtex is also run after latex. And if the .bbl file has changed then we know that latex must be re-run. May be to much compilations and bibtex executions are made. But the result will be correct. I don't remember why I/we considered the execution of bibtex after latex wasn't enough. Probably that sometimes bibtex need to be run twice. But I don't remember when -- I haven't use LaTeX for a while. So far, it seems that the following may be enough: 0.0- need_to_rerun = 1 x.0- while need_to_rerun x.1- latex 1.2- if !grep(\bibdata, mainfile.'.tex') => 1.3 if fileexists(mainfile.'.bbl') => backup bibtex if .bbl and .bll.bak differs => need_to_rerun = 1 x.3- if grep(Rerun, mainfile.'.log') x.0- while need_to_rerun x.1- latex y.2- nothing ... BTW: there is a thing i think is a strench of tex-tools: bibtex, makeindex, dvips, ... are used as 'makeprogram's => the errors can be seen in a :cwindow. This requires that compiler/tex.vim defines a function/command that reset &efm to (pdf)(La)TeX settings -- without having to resource this file. -- Luc Hermitte http://hermitte.free.fr/vim/ |