Closed ChrisLane closed 4 years ago
Hi @ChrisLane! Thank you very much for your clear bug report!
Running the bib compiler by hand, I got it failing with this error message:
This is BibTeX, Version 0.99d (TeX Live 2017/Arch Linux)
The top-level auxiliary file: test.aux
I found no \citation commands---while reading file test.aux
I found no \bibdata command---while reading file test.aux
I found no \bibstyle command---while reading file test.aux
(There were 3 error messages)
According to Google, these are bibtex
related errors. Running biber
instead compiles correctly. Unfortunately, changing bibtex
to biber
in vim-llp#L195 leads to a bunch of new errors, that need to be fixed... IMHO, the proper way to handle such an edge case would be to rewrite the plugin to use latexmk
, but it is still WIP.
For now, a workaround for you is to change the second line of your test.tex
to \usepackage[style=authoryear,backend=bibtex]{biblatex}
, in order to make it compliant with the tools this plugin uses.
Thanks for your response. I do typically use latexmk when I want to actually output a PDF and so I look forward to that work that's underway.
What I find strange is that a PDF is generated but the plugin doesn't open it in the viewer. I tried making the line change that you mentioned but am still getting the same "Failed to compile bibliography".
Okay, actually the backend=bibtex
only works if some test-blx.bib
exists in the main directory. It roughly looks like:
@Comment{$ biblatex control file $}
@Comment{$ biblatex version 2.8 $}
Do not modify this file!
This is an auxiliary file used by the 'biblatex' package.
This file may safely be deleted. It will be recreated as
required.
@Control{biblatex-control,
options = {2.8:0:0:1:0:1:1:0:0:1:0:2:3:1:79:+:nyt},
}
It can be created by running pdflatex test
in the main directory once (dirty workaround, but still).
I couldn't get the PDF properly generated in the tmp directory. There is one (first pdflatex compilation), but bibliography is missing (bib compilation fails and further pdflatex compilations are aborted).
Hopefully there will be a clean solution to this soon :smile:
ASAP ( but I didn't have enough time to fix it yet 🙈 )
I have a similar issue. Trying to preview the document using :LLPStartPreview gives the error: failed to compile bibliography. Compiling with \ll works fine and a dvi file is created which looks right that can be opened with okular. I am trying to compile this latex template available here: https://www.overleaf.com/latex/templates/wppm-thesis-template/npxqzncsmsch#.Wqk6tUso9hF
I tried using pdflatex BasicDoc.tex which generates BasicDoc-blx.bib and changed the line in Preamble.tex to have backend=bibtex but get the same error. Is there a workaround for this or some very obvious thing i am missing probably ?
same problem
same here
same here
Same here !
Oh, sadly still a problem in 2019
Still a problem 11/28/2019
Still a Problem 2020
Still a problem 3/5/2020. I have an alternative trick to skip this bug in Ubuntu 18.04. First, rename the "bibdata.bib" to "bibdata_bib_bk". Second, manually compile the project. "pdflatex main.tex; bibtex main". Third, open vim and type "LL", a pdf preview file without references will be generated. Finally, rename "bibdata_bib_bk" to "bibdata.lib". The pdf preview file will include the references and then you can use it as usual.
I don't have time for a pull request right this minute, but to get this going with bibtex (what the code is already using), you'd need to change your tex
file as mentioned above
\usepackage[style=authoryear,backend=bibtex]{biblatex}
and make the following adjustments to how bibtex is called:
" Update compile command with bibliography
let b:livepreview_buf_data['run_cmd'] =
\ 'env ' .
\ 'TEXMFOUTPUT=' . l:tmp_root_dir . ' ' .
\ 'TEXINPUTS=' . l:tmp_root_dir
\ . ':' . b:livepreview_buf_data['root_dir']
\ . ': ' .
\ ' && ' .
\ b:livepreview_buf_data['run_cmd'] .
\ ' && ' .
\ 'cd ' . l:tmp_root_dir . ' && bibtex *.aux' .
\ ' && ' .
\ b:livepreview_buf_data['run_cmd']
This calls pdflatex
orxelatex
on your tex
file, and produces the necessary .aux
file for bibtex
. It then moves to the appropriate directory to run bibtex
on all the produced aux
files. Absolute paths will NOT work unless you have loosened a particular security restriction in your texmf.cnf
file.
In summary, it wouldn't work before because:
pdflatex
before and after bibtex
This can also be done for biber
as well:
tex
could remain the same, because biblatex
uses biber
by default*.aux
to *.bcf
used by biber
Ultimately, which executable to use [biber
, bibtex
], could be selected either by doing a regex for a combination of conditions on the tex
file, default bibtex
except when biblatex
package used with no backend=bibtex
option, OR by creating a new option g:livepreview_biber
to use biber
explicitly, otherwise default to bibtex
.
Expected behaviour
Expect the plugin to compile successfully and display the PDF.
Actual behaviour
Vim displays "Failed to compile bibliography". From looking at the files in /tmp, everything seems to have compiled fine and the PDF looks correct.
Steps to reproduce
System configuration
Vim version: https://paste2.org/G0vV2hjJ
Platform: Arch Linux "4.13.5-1-ARCH"