xuhdev / vim-latex-live-preview

A Vim Plugin for Lively Previewing LaTeX PDF Output
https://www.topbug.net/blog/2013/06/13/live-preview-of-latex-in-vim/
GNU General Public License v3.0
834 stars 74 forks source link

"Failed to compile bibliography" with no bibliography #21

Closed dylan-chong closed 6 years ago

dylan-chong commented 8 years ago

Sorry, I'm relatively to Vim and the command line in general actually, so I've probably missed something obvious here. Anyway, I've just installed the plugin with Vundle on the latest Mac OS using the latest Vim installed from Homebrew. When I try to run this example code from Wikipedia:


\documentclass[12pt]{article}
\usepackage{amsmath}
\title{\LaTeX}
\date{}
\begin{document}
\maketitle
\LaTeX{} is a document preparation system for
the \TeX{} typesetting program. It offers
programmable desktop publishing features and
extensive facilities for automating most
aspects of typesetting and desktop publishing,
including numbering and  cross-referencing,
tables and figures, page layout,
bibliographies, and much more. \LaTeX{} was
originally written in 1984 by Leslie Lamport
and has become the  dominant method for using
\TeX; few people write in plain \TeX{} anymore.
The current version is \LaTeXe.
\end{document}

I get this error:


Failed to compile
Failed to compile bibliography

There doesn't appear to be bibliography, so why would it fail to compile? Also, a new window of Evince is still opened when the compilation fails, which is a little annoying since you have to close them one-by-one.

Tortea commented 8 years ago

Solution is to reinstall the Latex Compiler. I reinstalled the light version (https://tug.org/mactex/morepackages.html) the full version will most probably work.

yiulau commented 7 years ago

I get a similar error with a script like this

\documentclass{article}

\begin{document}
\maketitle
Hello
$x^2+y^2=z^2$

\end{document}

And I get the error

Failed to compile
Failed to compile bibliography

The evince page still pops up, but now it doesn't auto-reload, which defeats the purpose of having live preview in the first place. I installed the latest MacTex but it doesn't seem to make a difference.

latex -v
pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016)
kpathsea version 6.2.2
Copyright 2016 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.21; using libpng 1.6.21
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with xpdf version 3.04

Information about Vim installation

vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr  5 2016 14:53:37)
Compiled by root@apple.com
Normal version without GUI.  Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent 
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs 
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path 
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv 
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent 
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape 
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse 
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype 
+path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn 
-python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind +signs 
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary 
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
 -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo 
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
 -xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses
dylan-chong commented 7 years ago

What happens if you install a more updated version of vim with homebrew? (brew install vim)

Did you try reinstall the latex compiler linked above? It's been a while, but I think reinstalling that worked for me (or maybe it was something else).

WhyNotHugo commented 7 years ago

I'm having the same issue, on ArchLinux:

$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 15 2016 18:04:06)
Included patches: 1-86
Compiled by Arch Linux
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     +tcl/dyn
+balloon_eval    +folding         +mouse_xterm     +termguicolors
+browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     +gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
+clientserver    +insert_expand   +packages        +toolbar
+clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl/dyn        +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python/dyn      +vreplace
+cscope          +lispindent      +python3/dyn     +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con_gui  +lua/dyn         +rightleft       +writebackup
+diff            +menu            +ruby/dyn        +X11
+digraphs        +mksession       +scrollbind      -xfontset
+dnd             +modify_fname    +signs           +xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      +mouseshape      +startuptime     +xsmp_interact
+eval            +mouse_dec       +statusline      +xterm_clipboard
+ex_extra        +mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax          
+farsi           +mouse_netterm   +tag_binary      
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -lncurses -lelf -lnsl    -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/core_perl/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc   -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lieee -lm     
$ latex --version
pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016/Arch Linux)
kpathsea version 6.2.2
Copyright 2016 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.26; using libpng 1.6.26
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.49.0
ghost commented 7 years ago

Same issue here.

$ vim --version
NVIM 0.1.7
Build type: RelWithDebInfo
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -I/tmp/neovim-20161228-96193-1qroqr3/neovim-0.1.7/build/config -I/tmp/neovim-20161228-96193-1qroqr3/neovim-0.1.7/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/usr/include -I/tmp/neovim-20161228-96193-1qroqr3/neovim-0.1.7/build/src/nvim/auto -I/tmp/neovim-20161228-96193-1qroqr3/neovim-0.1.7/build/include
Compiled by samvv@Sams-MBP

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.1.7/share/nvim"
$ latex --version
pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016)
kpathsea version 6.2.2
Copyright 2016 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.21; using libpng 1.6.21
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with xpdf version 3.04
ghost commented 7 years ago

Wait, nvm, suddenly it works. Doing a brew uninstall neovim; brew install neovim fixed the issue.

WhyNotHugo commented 7 years ago

Not applicable for me, since I'm not using brew/macOS.

xuhdev commented 7 years ago

@hobarrera Can you build the pdf successfully outside Vim?

WhyNotHugo commented 7 years ago

@xuhdev Yes, pdflatex cv.pdf worked fine.

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed. Thanks for contributing to vim-llp!

ecly commented 7 years ago

I have the same issue on arch - compiling just fine with pdflatex outside of vim

badouralix commented 7 years ago

@ecly could you provide your working pdflatex command and the output of :echo b:livepreview_buf_data after running :LLPStartPreview in vim?

ecly commented 7 years ago

@badouralix Running a hello world in latex with the following input of test.tex:

\documentclass{article}
\begin{document}
Hello World!
\end{document}

I can run pdflatex successfully with plain: pdflatex test.tex.

In vim with the same tex file open, the result of :echo b:livepreview_buf_data after attempting to run :LLPStartPreview gives:

{'root_dir': '/home/ecly', 'tmp_dir': '/tmp/vim-latex-live-preview-NUNBVM', 'run_cmd': 'env TEXMFOUTPUT=/tmp/vim-latex-live-preview-NUNBVM/home/ecly TEXINPUTS=/tmp/vim-latex-live-preview-NUNBVM/home/ecly:/home/ecly: bibtex /tmp/vim
-latex-live-preview-NUNBVM/home/ecly/*.aux && env TEXMFOUTPUT=/tmp/vim-latex-live-preview-NUNBVM/home/ecly TEXINPUTS=/tmp/vim-latex-live-preview-NUNBVM/home/ecly:/home/ecly: pdflatex -shell-escape -interaction=nonstopmode -output-d
irectory=/tmp/vim-latex-live-preview-NUNBVM/home/ecly /tmp/vim-latex-live-preview-NUNBVM/home/ecly/test.tex', 'tmp_src_file': '/tmp/vim-latex-live-preview-NUNBVM/home/ecly/test.tex'}
badouralix commented 7 years ago

I guess you don't get the error Failed to compile, but only Failed to compile bibliography. Do you have any .bib file in your directory or subdirectories?

ecly commented 7 years ago

@badouralix Roger - it seems my issue was unrelated to theirs. My bad - I had set up a simple test.tex in a directory in which there were other directories, one of which has a previous latex project. I moved the .tex file to a directory of its' own and it works. Thanks for pointing out that behavior!

badouralix commented 7 years ago

Cool! Still, this behavior is kind of buggy, and my bet is that using latexmk as suggested in #38 will fix it properly.

ecly commented 7 years ago

@badouralix actually same result with latexmk, using: let g:livepreview_engine = 'latexmk -pdf' But for all practical applications I'll have it in a directory of its own anyways, so I won't complain!

badouralix commented 7 years ago

Failure because of these lines: they should be removed when using latexmk

ecly commented 7 years ago

@badouralix ah, alright! I'll keep that in mind if I go over to using latexmk! Cheers!

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed. Thanks for contributing to vim-llp!

Niki25672729 commented 6 years ago

When I run :LLPStartPreview in an empty file It returns Error detected while processing function 39_StartPreview:
line 63: E502: "/var/folders/lz/zt0053v1281dyp5kbtt1w4kc0000gn/T/vim-latex-live-preview-r dq1ylqq" is a directory Failed to compile Press ENTER or type command to continue

If I run in a nonempty file(ex: helloworld.tex) It will stock for a long time and return Failed to compile bibliography

Does anyone know what's wrong?

System configuration

# output of `vim --version`
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 30 2018 07:37:16)
macOS version
Included patches: 1-1650
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    -tcl
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    -gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          -toolbar
+cindent           +insert_expand     +path_extra        +user_commands
-clientserver      +job               +perl              +vertsplit
+clipboard         +jumplist          +persistent_undo   +virtualedit
+cmdline_compl     +keymap            +postscript        +visual
+cmdline_hist      +lambda            +printer           +visualextra
+cmdline_info      +langmap           +profile           +viminfo
+comments          +libcall           -python            +vreplace
+conceal           +linebreak         +python3           +wildignore
+cryptv            +lispindent        +quickfix          +wildmenu
+cscope            +listcmds          +reltime           +windows
+cursorbind        +localmap          +rightleft         +writebackup
+cursorshape       -lua               +ruby              -X11
+dialog_con        +menu              +scrollbind        -xfontset
+diff              +mksession         +signs             -xim
+digraphs          +modify_fname      +smartindent       -xpm
-dnd               +mouse             +startuptime       -xsmp
-ebcdic            -mouseshape        +statusline        -xterm_clipboard
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
+eval              -mouse_gpm         +syntax            
+ex_extra          -mouse_jsbterm     +tag_binary        
+extra_search      +mouse_netterm     +tag_old_static    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -framework AppKit   -mmacosx-version-min=10.13 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.26.1/lib/perl5/5.26.1/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -framework CoreFoundation  -lruby.2.5.1 -lobjc
# output of `latex --version`
pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.29; using libpng 1.6.29
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 3.04