Skip to content

Commit

Permalink
Fixes xuhdev#46
Browse files Browse the repository at this point in the history
Run tex engine before and after bib executable
Add support for both `bibtex` and `biber`
 - Add global variable `g:livepreview_biber`
Add Bibliography section to README
 - Detail usage of `g:livepreview_biber`
 - Detail usage with `biblatex`
  • Loading branch information
sunwukonga committed Apr 3, 2020
1 parent 855c309 commit a8be1c4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,26 @@ hold (autocmd events `CursorHold` and `CursorHoldI`), use the feature flag:
let g:livepreview_cursorhold_recompile = 0
```

### Bibliography executable

`LLP` uses `bibtex` as the default executable to process `.bib` files. This can
be overridden by setting the `g:livepreview_biber` variable.

```vim
let g:livepreview_biber = 1
```

Please note that the package `biblatex` can use both `bibtex` and the newer
`biber`, but uses `biber` by default. To use `bibtex`, add `backend=bibtex`
to your `biblatex` usepackage declaration.

```
\usepackage[backend=bibtex]{biblatex}
```

Please note that `biblatex` will NOT work straight out of the box, you will
need to set either `g:livepreview_biber` or `backend=bibtex`, but not both.

Known issues
------------

Expand Down
11 changes: 10 additions & 1 deletion plugin/latexlivepreview.vim
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,23 @@ EEOOFF
\ l:tmp_root_dir . '/' . bib_fn) " TODO: may fail if same bibfile names in different dirs
endfor

if exists('g:livepreview_biber') && g:livepreview_biber > 0
let s:bibexec = 'biber *.bcf'
else
let s:bibexec = 'bibtex *.aux'
endif

" 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']
\ . ': ' .
\ 'bibtex ' . l:tmp_root_dir . '/*.aux' .
\ ' && ' .
\ b:livepreview_buf_data['run_cmd'] .
\ ' && ' .
\ 'cd ' . l:tmp_root_dir . ' && ' . s:bibexec .
\ ' && ' .
\ b:livepreview_buf_data['run_cmd']

Expand Down

0 comments on commit a8be1c4

Please sign in to comment.