Dear Marko,
thanks for this enquiry. In my system, the file compiler.vim is located
elsewhere, namely in the directory
/usr/share/vim/site/ftplugin/latex-suite/. But this is not important, I
guess. The file header is as follows:
"=============================================================================
" File: compiler.vim
" Author: Srinath Avadhanula
" Created: Tue Apr 23 05:00 PM 2002 PST
"
" Description: functions for compiling/viewing/searching latex documents
"=============================================================================
and it has a total of 875 lines. I am not quite sure we are comparing the
same versions, since I found the lines you mention slightly elsewhere.
Instead of the code located around lines 608 and 617, I think you mean
these lines:
580 " If the .bbl file changed after running bibtex, we need to
581 " latex again.
582 if biblinesAfter != biblinesBefore
583 echomsg 'Need to rerun because bibliography file changed...'
584 call Tex_Debug('Tex_CompileMultipleTimes: Need to rerun
because bibliography file changed...', 'comp')
585 let needToRerun = 1
589 " check if latex asks us to rerun
590 let auxlinesAfter = Tex_GetAuxFile(auxFileName)
591 if auxlinesAfter != auxlinesBefore
592 echomsg "Need to rerun because the AUX file changed..."
593 call Tex_Debug("Tex_CompileMultipleTimes: Need to rerun to get
cross-references right...", 'comp')
594 let needToRerun = 1
595 endif
One question is whether these two criteria are well chosen and sufficient;
as you wrote, it seems that swapping two citations is a sufficient reason
for triggering BibTeX but may not necessarily change the number of lines
in the .aux file.
Another question is whether these tests in the procedure work as they were
intended. In this respect, I have doubts. I checked that when I compile my
.tex file, and this compilation _does_ produce an .aux file with a number
of lines different from before the compilation, I get anyway the message
in gvim:
Ran latex 1 time(s)
and BibTeX is not run (no new .bbl file is produced).
As for the other test concerning the number of lines in the .bbl files, I
could not verify because BibTeX is not triggered in this way.
Debugging the .vim script does not seem easy to me, so I don't know how to
proceed now.
All the best,
Filip
On Wed, 24 Feb 2021, Mirko Hessel-von Molo wrote:
Dear Filip,
from lines 608 and 617 of
/usr/share/vim/addons/ftplugin/latex-suite/compiler.vim I gather that
a second (or further) run of pdflatex is issued when either the _number of
lines_ of the bib file or of the aux file
has changed during the first run.
So when you just rearrange the cite commands in your file, this presumably
won't change the number of lines of either of those files.
In that way, the multiple compile function is not adapted to bibliography
styles which number references by the order of first appearance.
You could check what happens when you add a new citation to your tex file.
Best regards, Mirko
Am Mittwoch, den 24.02.2021, 11:36 +0100 schrieb Filip Kadlec:
Hi, Mirko,
thank you for your reply. Having explored the two hints you suggested,
first I think you are right that the synctex option should only be
preceded by a single dash; that is in agreement with the man page.. I do
not know exactly why the double dash was there; someone has advised me
this line a long time ago, but I cannot exclude I later accidentally added
a second dash without noticing. So I have fixed this in my .vimrc file.
As for the debugging procedure, I have done as you advised, and the result
is the following:
comp : +Tex_RunLaTeX, b:fragmentFile = 0
comp : Tex_RunLaTeX: compiling to target [pdf]
comp : Tex_RunLaTeX: getting dependency chain = [pdf]
comp : +Tex_SetTeXCompilerTarget: setting target to [pdf] for Compiler
comp : Tex_RunLaTeX: setting target to pdf
comp : Tex_RunLaTeX: compiling file multiple times via Tex_CompileMultipleTimes
comp : Tex_CompileMultipleTimes: latex run number : 1
comp : Tex_CompileLatex: getting mainfname = [NbN-ver1.tex] from
Tex_GetMainFileName
comp : Tex_CompileLatex: execing [make! NbN-ver1.tex]
comp : Tex_CompileMultipleTimes: errors = []
comp : Tex_CompileMultipleTimes: Ran latex 1 time(s)
comp : Tex_RunLaTeX: errlist = [
1: ]
comp : Tex_SetupErrorWindow: mfnlog = NbN-ver1.log
comp : -Tex_RunLaTeX
I was not able to find any suspicious message there. The .bbl file is
still not updated when I recompile the main file after a change in the
order of references. It seems the Tex_CompileMultipleTimes procedure does
not notice there was a change in the .aux file.
Otherwise, there is a workaround I found in some discussion list, which
consists in running
:!latexmk -pdf %
on the command line. This will update also the bibliography as one would
wish, but, unfortunately, the produced pdf file then does not support the
inverse search feature. At least it kind of proves BibTeX is functional.
By the way, also my forward search has problems, which is quite an old
issue but off-topic here.
Thank you for your effort,
Filip
On Tue, 23 Feb 2021, Mirko Hessel-von Molo wrote:
Dear Filip,
since noone else who is more competent than me seems to be here to answer, let
us try it together.
I'm just an "ordinary vim-latexsuite user" with no particular experience in
writing or debugging vim addons,
but let's see how far we get.
You could try adding
let g:Tex_Debug=1
to your vimrc file. This enables debugging function within latex-suite.
Then when a compilation run is done (and multiple compilation has not worked)
issue the command
:call Tex_PrintDebug()
within vim. What results does this give?
Besides, I'm a bit puzzled by the value given in your vimrc to the
g:Tex_CompileRule_pdf variable.
Are you quite sure that it should read "--synctex=1" and not "-synctex=1" ?
(Two dashes versus one?)
Best regards, Mirko
Am Freitag, den 19.02.2021, 16:56 +0100 schrieb Filip Kadlec:
Hello all,
since years, I have been using successfully the LaTeX suite under OpenSUSE
Linux. Having configured the compilation to pdf format, it has always
worked straightforwardly. Since recently, however, I have problems with
the multiple compilation feature, described in part 6.3 of :h
latex-suite.txt. In situations, where the required routine pdflatex -
bibtex - pdflatex - pdflatex would be triggered automatically by a single
compilation command, now only a single pdflatex compilation appears to
occur. This is obviously annoying.
In my ~/.vimrc, I have the following settings:
let g:tex_flavor='latex'
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_MultipleCompileFormats='pdf'
let g:Tex_ViewRule_pdf = 'okular --unique'
let g:Tex_CompileRule_pdf = 'pdflatex --synctex=1 -interaction=nonstopmode
-file-line-error $* -inverse-search "gvim --servername GVIM --remo
te +\%l \%f"'
I reused documents which I compiled earlier; currently, swapping some
citations in the .tex file leads to a wrong order of their numbering in
the output pdf file if just a single compilation command is triggered.
I suspect the reason that the multiple compilation has stopped working is
some update in texlive; or perhaps an update of vim-latex? Anyway, I
wonder how I can debug this problem. Any help would be appreciated.
By the way, since this forum has been quite inactive, I thought of posting
this elsewhere, but I am not sure what the best place would be.
Best regards, Filip
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel