Latex-Suite provides an easy way of entering bibliographic entries. Four
insert-mode mappings: BBB
, BBL
,
BBH
and BBX
are provided, all of
which essentially act in the same manner. When you type any of these in
insert-mode, you will get a prompt asking you to choose a entry type
for the bibliographic entry.
When you choose an entry type, a bibliographic entry template will be
inserted. For example, if you choose the option
'book'
via the map BBB
, then
the following template will be inserted:
@BOOK{<+key+>, author = {<++>}, editor = {<++>}, title = {<++>}, publisher = {<++>}, year = {<++>}, otherinfo = {<++>} }<++>
<+key+>
will be highlighted in select-mode and
you can type in the bib-key. After that you can use
<Ctrl-J>
to navigate to successive locations
in the template and enter new values.
BBB
inserts a template with only the fields
mandatorily required for a given entry type. BBL
inserts a template with commonly used extra options.
BBH
inserts a template with more options which are
not as commonly used. BBX
inserts a template with
all the fields which the entry type supports.
B
for Bibliographic entry, L
for Large entry, H
for Huge entry, and
X
stands for all eXtras.
If you wish the BBB
command to insert a few
additional fields in addition to the fields it creates, then you will
need to define global variables of the form
g:Bib_{type}_options
in you $VIM/ftplugin/bib.vim
file, where
{type}
is a string like
'article'
, 'book'
etc. This
variable should contain one of the letters defined in the following
table
Character | Field Type |
---|---|
w | address |
a | author |
b | booktitle |
c | chapter |
d | edition |
e | editor |
h | howpublished |
i | institution |
k | isbn |
j | journal |
m | month |
z | note |
n | number |
o | organization |
p | pages |
q | publisher |
r | school |
s | series |
t | title |
u | type |
v | volume |
y | year |
For example, by default, choosing 'article'
via
BBB
inserts the following template by default
@ARTICLE{<+key+>, author = {<++>}, title = {<++>}, journal = {<++>}, year = {<++>}, otherinfo = {<++>} }<++>
However, if g:Bib_article_options
is defined as
'mnp'
, then 'article'
will
insert the following template
@ARTICLE{<+key+>, author = {<++>}, title = {<++>}, journal = {<++>}, year = {<++>}, month = {<++>}, number = {<++>}, pages = {<++>}, otherinfo = {<++>} }<++>
If you have some other fields you wish to associate with an article
which are not listed above, then you will have to use the
Bib_{type}_extrafields
option. This is a newline
separated string of complete field names which will be included in the
template. For example, if you define
let g:Bib_article_extrafields = "crossref\nabstract"
then the article template will include the lines
crossref = {<++>}, abstract = {<++>},
You will need to define Bib_*
settings in your
$VIMRUNTIME/ftplugin/bib.vim
file.