File viewing functionality fully implemented
[ebib.git] / manual / ebib-manual.muse
blob0858584c3d05618c58fff7a75fd54d55e13093e9
1 #author Joost Kremers
2 #title Ebib Manual
4 <div id="menu">
6 <contents>
8 </div>
10 <div id="main">
12 Ebib is a program with which you can manage BibTeX database files without
13 having to edit the raw =.bib= files. It runs in GNU/Emacs, version 21.1 or
14 higher (lower versions are not supported) and XEmacs (at least from version
15 21.4; lower version have not been tested, but may work.)
16   
17 It should be noted that Ebib is *not* a minor or major mode for editing
18 BibTeX files. It is a program in itself, which just happens to make use of
19 Emacs as a working environment, in the same way that for example Gnus is.
20   
21 The advantage of having a BibTeX database manager inside Emacs is that X is
22 no longer required, as Emacs can run on the console, and also that some
23 integration with Emacs' TeX and LaTeX modes becomes possible.  For example,
24 you can push a BibTeX key from Ebib to a LaTeX buffer, or, vice versa, when
25 you're in a LaTeX buffer, you can consult your BibTeX database and insert a
26 key from it into the document. Another advantage of Ebib is that it is
27 completely controlled by key commands: no stressful mouse movements are
28 required, as with most other (usually X-based) BibTeX database managers.
31 * Installation
33 To install Ebib, so that it will be loaded automatically when Emacs is
34 started, simply copy the file =ebib.el= to somewhere in your load path and
35 add the following line to Emacs' init file (=~/.emacs= for GNU/Emacs,
36 =~/.xemacs/init.el= for XEmacs):
38 <example>
39 (autoload 'ebib "ebib" "Ebib, a BibTeX database manager." t)
40 </example>
42 Note: if you do not know what your load path is set to, go to the =*scratch*=
43 buffer, type =load-path= on an empty line, put the cursor right after it and
44 type =C-j=. The value of =load-path= will then appear in the buffer.
46 When Ebib is loaded, you can run it with =M-x ebib=. This command is also
47 used to return to Ebib when you have put the program in the background. You
48 can bind this command to a key sequence by putting something like the
49 following in Emacs' init file:
51 <example>
52 (global-set-key "\C-ce" 'ebib)
53 </example>
55 You can of course choose any key combination you like. (In Emacs, key
56 combinations of =C-c <letter>= are reserved for the user, so that no package
57 may set them.)
59 It is recommended to byte-compile the source, Ebib runs quite a lot faster
60 when it is byte-compiled. You can do this either within Emacs with =M-x
61 byte-compile-file=, or from your shell by going into the directory where you
62 put =ebib.el= and typing:
64 <example>
65 emacs -batch -f batch-byte-compile ebib.el
66 </example>
68 (Substitute =emacs= with =xemacs= if you use XEmacs.) This will create a file
69 =ebib.elc=, which Emacs will load instead of =ebib.el=. Byte-compiling Ebib may
70 produce a warning about functions that are ``not known to be
71 defined''. This can be safely ignored. GNU Emacs and XEmacs have some small
72 differences, and the functions reported in this warning are those used by
73 the other version. Ebib makes sure that the correct functions are called.
77 * Basic Usage
79 A BibTeX database is somewhat of a free-form database. A BibTeX entry
80 consists of a set of field-value pairs. Furthermore, each entry is known by
81 a unique key. The way that Ebib navigates this database is by having two
82 windows, one that contains a list of all the entry keys in the database,
83 and one that contains the fields and values of the currently highlighted
84 entry.
86 When Ebib is started, the current windows in Emacs are hidden and the Emacs
87 frame is divided into two windows. The top one contains a buffer that is
88 called the *index buffer*, while the lower window contains the *entry
89 buffer*. When a database is loaded, the index buffer holds a list of all the
90 keys in the database. You can move through these keys with the cursor
91 keys. In the entry buffer, the fields of the currently highlighted entry
92 are shown, with their values.
94 In this chapter, all basic functions of Ebib are described, so that you can
95 get startet with it. At times, reference will be made to later chapters,
96 where more specific functions are described.
100 ** Getting Started
102 Ebib is started with the command =M-x ebib=. Entering this command hides all
103 the windows in the current Emacs frame and replaces them with two windows:
104 the top one contains the index buffer, the bottom one, taking up the larger
105 part of the screen, contains the entry buffer. The index buffer is named
106 =none=, to indicate that no database has been loaded. If you open a database,
107 or start a new one, the index buffer will carry its name.
109 You can quit Ebib by typing =q=. You will be asked for confirmation, and you
110 will receive a warning if you happen to have an unsaved database. The
111 command =z= can also be used to leave Ebib. However, unlike =q=, which
112 completely quits Ebib, =z= only lowers it, so that it remains active in the
113 background. The =.bib= files that you have opened remain loaded, and you can
114 return to them by typing =M-x ebib= again.
117 *** Opening a =.bib= file
119 Loading a =.bib= file into Ebib is done with the command =o=. Ebib reads the
120 file that you specify, and reports how many entries it found, how many
121 =@string= definitions it found, and whether a =@preamble= was found. Note that
122 when Ebib reads a =.bib= file, it only reads entry types (e.g. =book, article,
123 phdthesis= etc.) that it knows about. Fields (e.g. =author, title, year= etc.)
124 that Ebib does not know about, are loaded (and saved) but not displayed, so
125 they cannot be edited. Therefore, you should make sure that all the entry
126 types and fields that your databases use are defined. A sensible set has
127 been predefined, so that anyone who's using standard BibTeX entry types
128 should have no problem loading an existing =.bib= file into Ebib. If,
129 however, you have custom entry types, or custom fields in your =.bib= files,
130 you should read the chapter on customising Ebib to learn how to define
131 them, so that Ebib knows about them. (See [[#entry-types][Entry types]].)
133 Every time Ebib reads a =.bib= file, it produces a few log messages. These
134 are written into a special buffer =*Ebib-log*=. If Ebib encounters entry
135 types in the =.bib= file that it doesn't know, it will log a warning. If Ebib
136 finds something that it believes to be incorrect, an error will be
137 logged. If any warnings or errors occur while loading the =.bib= file, Ebib
138 tells you so after loading the file. To view the log file, press =l= in the
139 index buffer.
141 Note that even if it detects warnings or errors, Ebib will try to continue
142 parsing the rest of the =.bib= file. That means that normally, only the entry
143 in which an error occurs is not read. Entries occurring after the
144 problematic one are read.
147 *** Navigating a =.bib= file
149 Once you've opened a =.bib= file, the keys of all the entries in the file are
150 shown in alphabetical order in the index buffer in the top Ebib window. (In
151 fact, it is possible to show more than just the entry key in this
152 buffer. See [[#index-display-fields][Index Display Fields]] on how to accomplish this.) The first
153 entry is highlighted, meaning it is the current entry. The fields it holds
154 and their values are shown in the entry buffer in the bottom Ebib
155 window. The first field is the type field, which tells you what kind of
156 entry you're dealing with (i.e. =book, article=, etc.).
158 Below the type field, Ebib displays (up to) three sets of fields. The first
159 set are the so-called obligatory fields, the fields that BibTeX requires to
160 be filled. The second group are the optional fields, which do not have to
161 be filled but which BibTeX will normally add to the bibliography if they do
162 have a value. The third group are the so-called additional fields. These
163 fields are usually ignored by BibTeX (note that BibTeX normally ignores
164 *all* fields it does not know), although there are bibliography styles that
165 treat some of these fields as optional rather than as additional; (i.e.,
166 the =harvard= styles do typeset the =url= field, if present.)
168 The first two groups of fields are different for each entry type, while the
169 third group are common to all entry types. You can use the additional
170 fields, for example, to add personal comments to the works in your
171 database. Ebib by default defines the following additional fields:
172 =crossref, url, annote, abstract, keywords, file= and =timestamp=. If these are
173 not sufficient for you, you need to customise Ebib and add your own
174 fields. (See [[#additional-fields][Additional Fields]], if you need to find out how to do that.)
176 To move around in the index buffer, you can use the =up= and =down= cursor
177 keys, =C-p= and =C-n=, or for those more used to mutt's key bindings, =k= and
178 =j=. Furthermore, =Space= and =PgDn= move a screenful of entries down, while =b=
179 and =PgUp= move in the other direction. Lastly, =g= and =Home= move to the first
180 entry, while =G= and =End= move to the last one.
182 Ebib is not restricted to opening just one =.bib= file at a time. You can
183 open more files by just typing =o= again and entering the filename. Ebib
184 numbers the databases: the number of each database is shown in the mode
185 line of the index buffer, directly before the database name. The keys 1--9
186 provide a quick way of jumping from one database to another. Note that the
187 numbering is dynamic: if you have three databases opened and then close the
188 second, database 3 becomes database 2.
190 With the =left= and =right= cursor keys, you can move to the previous or next
191 database. These keys wrap, so if you hit the =left= cursor key while the
192 first database is active, you move to the last database. If you are done
193 with a database and want to close it, type =c=. This closes the current
194 database. It does not leave Ebib, and all other databases you have open
195 will remain so.
198 *** Starting a New =.bib= File
200 If you want to start a new =.bib= file from scratch, you cannot just go and
201 enter entries. You first have to give the database a name. So, to start a
202 new database, type =o= first, and give the new file a name. Once you have
203 done this, you can start adding entries to the database.
206 ** Editing the Database
208 Of course, being able to open and view =.bib= files is only half the fun. One
209 needs to be able to edit the files as well. Ebib's essential editing
210 facilities are discussed here.
213 *** Adding and Deleting Entries
215 To add an entry to a database, you type =a=. When you do this, Ebib first
216 asks you for an entry key, as every entry must be identified by a unique
217 key. Just type a name for the new entry (say =jones1998=). Since the entry
218 key must be unique, Ebib will complain if you enter a key that already
219 exists.
221 Note that if you should later decide that you want to change the key of an
222 entry, you can do so with the command =E=. So if you have an entry with the
223 key =jones1998= and you want to add another entry by Jones from 1998, you can
224 call the new one =jones1998b= and rename the existing one to =jones1998a=.
226 Deleting an entry is done with =d=. Be careful with this: you will be asked
227 for confirmation, but once you've confirmed, the entry is gone, and it is
228 not possible to bring it back. There is no undo in Ebib. (If you haven't
229 saved the database yet, it is still possible to retrieve the deleted entry
230 from the =.bib= file, and otherwise it may still be in the backup file that
231 Ebib creates. See [[#saving-database][Saving a Database]].)
234 *** Editing Fields Values
236 Editing the field values for an entry is done in the lower of the two Ebib
237 buffers, the so-called entry buffer. You can move focus to the entry buffer
238 by typing the command =e= in the index buffer.
240 You can move between fields with the same keys that you use to move between
241 entries in the index buffer: the cursor keys =up= and =down=, =C-p= and =C-n=, or =j=
242 and =k=. =Space= and =PgDn= move to the next set of fields, while =PgUp= and =b= move
243 to the previous set of fields. =g= and =G=, and =Home= and =End= also work as
244 expected.
246 Editing a field value can be done with =e=. For most fields, Ebib simply asks
247 you for a string value in the minibuffer. (Here, =RET= confirms the edit,
248 while =C-g= cancels it.) Although BibTeX requires that field values be
249 surrounded by braces {} (or double quotes "", but Ebib does not use those,
250 even though it can of course handle them when they are used in an existing
251 =.bib= file) you do not need to type these. Ebib adds them when it saves the
252 =.bib= file.
254 Some fields, however, are handled in a special way. The first of these is
255 the =type= field: if you edit this field, you must enter one of the
256 predefined entry types. Ebib won't allow you to enter anything else. You
257 can use tab-completion in this case. Similarly, if you edit the =crossref=
258 field, Ebib requires that you fill in a key from the database. Here, too,
259 you can use tab-completion.
261 Note that if you're adding a new entry, Ebib automatically puts you in the
262 entry buffer after you've typed the entry key: you don't have to type =e= to
263 move to the entry buffer. When creating a new entry, it is best to set the
264 =type= field first, because the =type= field determines which other fields are
265 available for an entry.
267 Note also that after editing a field, Ebib (usually) puts you on the next
268 field. This is convenient if you're creating a new entry and need to fill
269 out several fields in a row.
271 If you're done editing the fields of the entry, type =q= to move focus back
272 to the index buffer. (Note: keys may have different functions in the index
273 buffer and the entry buffer. =q= is a typical example: in the entry buffer,
274 it quits editing the entry and moves focus back to the index buffer. In the
275 index buffer, however, =q= quits Ebib.)
278 *** Editing Multiline Values
280 Apart from the =type= and =crossref= field, there is another field that Ebib
281 handles in a special way when you edit its value. This is the =annote=
282 field. Most field values normally consist of a single line of
283 text. However, because the =annote= field is meant for creating annotated
284 bibliographies, it would not be very useful if you could only write one
285 line of text in this field. Therefore, when you edit the =annote= field, Ebib
286 puts you in the so-called *multiline edit buffer*. This is essentially a text
287 mode buffer that allows you to enter as much text as you like. To store the
288 text and leave the multiline edit buffer, type =C-x b=. (This is of course
289 the standard Emacs command to switch buffers. It is redefined in Ebib's
290 multiline edit buffer.)
292 If you want to leave the multiline edit buffer without saving the text you
293 have just typed, you can use the command =C-x k=. This too is redefined in
294 the multiline edit buffer: it leaves the multiline edit buffer (and hides
295 it), but it does not actually kill the buffer.
297 Multiline values are not restricted to the =annote= field. Any field can in
298 fact hold a multiline value. (Except of course the =type= and =crossref=
299 fields.) To give a field a multiline value, use =l= instead of =e=. You will
300 again be put in the multiline edit buffer, where you can edit the
301 value. Note that you can use =l= even if a field already has a single line
302 value. Ebib will just make that the first line in the multiline edit
303 buffer.
305 When a field has a multiline value, only the first line is shown in the
306 entry buffer, for space reasons. To indicate that the value is multiline, a
307 plus sign =+= is placed in front of the value.
309 By the way, the =e= key is smart about the way an entry must be edited. If
310 you press =e= on a field that already has a multiline value, regardless of
311 the fact whether it is the =annote= field or not, Ebib puts you in the
312 multiline edit buffer. Therefore, you need =l= only if you want to give a
313 field a multiline value when it doesn't have one yet.
315 For more details on working with the multiline edit buffer, see
316 [[#multiline-edit-buffer][The Multiline Edit Buffer]].
319 *** Copy, cut, paste (yank), and delete
321 A few more commands are available when you're in the entry buffer editing
322 field values. The commands =c=, =x= and =y= implement a copy and paste system: =c=
323 copies the contents of the current field to the kill ring, =x= kills the
324 contents of the current field to the kill ring, and =y= yanks (pastes) the
325 most recently killed text in the kill ring. You can type =y= repeatedly to
326 get the same effect you get in Emacs when you type =M-y= after an initial
327 =C-y=: every additional use of =y= moves back in the kill ring.
329 Lastly, there is the command =d=, which deletes the contents of the current
330 field, without asking questions and without storing the text in the kill
331 ring.
333 Note that =y= only works when the current field does not have a value
334 yet. This is to prevent you from accidentally overwriting a field value. If
335 you do want to yank text into a field that already has a value, simply hit
336 =d= first to delete the text.
339 ** Saving a Database
340 #saving-database
342 When you have undertaken any kind of editing action on a database, it is
343 marked as modified, which is indicated in the mode line for the index
344 buffer. A modified database can be saved by typing =s=. This saves the
345 database to the file it was loaded from without asking for
346 confirmation. (It is similar to =C-x C-s= in Emacs.) If you're saving a file
347 for the first time after loading it, Ebib creates a backup file under the
348 same name appended with a tilde: =<filename>.bib~=.
350 If you have multiple databases open, have made changes in more than one of
351 them, and want to save all of them without going through each yourself, you
352 can use =S=. (That's a capital =S=.) This command saves all modified databases.
354 Another way to save a database is to use the command =w=. Use this if you
355 want to write the database to another file than the one it was loaded
356 from. Ebib will ask you for a filename to save to, and will of course warn
357 you if that file happens to exist already. Note that this command is
358 similar to =C-x C-w= in Emacs, so that after using it, the new =.bib= file
359 becomes associated with the database.
362 ** Searching
363 #searching
365 Ebib provides several search methods. First, if you are in the index
366 buffer, the normal Emacs incremental searches, =C-s= and =C-r=, function as
367 expected. You can use them to search entry keys. Note that once you've
368 found the key you're searching, you must hit =ENTER= to make it active. Ebib
369 does not update the entry buffer during incremental search, as this would
370 be rather pointless: you're only interested in the entry you're searching
371 for, not in the entries you pass along the way.
373 Of course, it is also possible to search the database itself. If you type
374 =/=, Ebib asks you for a search term. This can be a regural expression, to
375 allow for flexibility in searching. After hitting =ENTER=, Ebib will start
376 searching the database (starting from the current entry, *not* from the first
377 entry!) and will display the entry with the first occurrence of the search
378 string that it finds. All the occurrences of the search string in that
379 entry are highlighted.
381 Ebib searches all the fields of each entry. It is not possible with =/= to
382 specify the fields to search. Note that if the search term is found in a
383 field with a multiline value, Ebib will highlight the =+= sign that it
384 displays in front of the field value. Keep an eye out for this when doing a
385 search, because Ebib only shows the first line of multiline values, and if
386 the search term appears in another line, the highlighted =+= is the only
387 indication that the search term was found. (Well, that and the fact that
388 Ebib does *not* say =Search string not found=, of course...)
390 A search term may of course appear more than once in the database. To
391 search for the next occurrence, type =n=. This will continue searching for
392 the search string in the rest of the database. Again, the first entry found
393 to contain the search string is displayed. Note that =n= does not wrap: if
394 the end of the database is reached, Ebib stops searching. To continue
395 searching from the top, hit =g= and then =n=.
397 The functions described here form Ebib's basic search functionality. Ebib
398 also has a much more powerful search mechanism in the form of *virtual
399 databases*. These are described later. (See [[#virtual-databases][Virtual Databases]].)
402 ** LaTeX Integration
404 Having a BibTeX database manager running inside Emacs has an additional
405 advantage: it makes it trivially easy to insert BibTeX keys in your LaTeX
406 documents.
408 Ebib provides two functions for this. First, if you're in a LaTeX buffer,
409 you can call the function =ebib-insert-bibtex-key=. When you invoke this
410 command, Emacs prompts you for a key from the database(s) associated with
411 the current buffer. You can type the key, using TAB-completion, and after
412 hitting =RET=, Emacs puts a BibTeX citation at the cursor position in the
413 current buffer with the key you selected.
415 You can also do it the other way around: if you're in the index buffer in
416 Ebib, you can *push* an entry to a LaTeX buffer. To do this, use the key =p=.
417 Ebib will ask you for a buffer to push the entry to, and will then insert
418 the string =\cite{<key>}= at the current cursor position in the buffer you've
419 supplied.
421 By default, both =ebib-insert-bibtex-key= and the command key =p= in the index
422 buffer insert the key into the LaTeX buffer with command =\cite=. It is
423 possible to change this, however. In fact, it is possible to define
424 multiple insertion strings, so that you can have Ebib insert a variety of
425 citation commands with an entry key. For details on defining and using
426 custom insertion strings, see [[#insertion-strings][Insertion Strings]].
428 There is another function that is available outside Ebib:
429 =ebib-entry-summary=. This command reads the key under the cursor in the
430 current buffer and displays the field values associated with that key in a
431 =*Help*= buffer. This allows you to quickly check a reference in a text.
433 Probably the easiest way to use both =ebib-insert-bibtex-key= and
434 =ebib-entry-summary= is to bind them to a key sequence. For example, you
435 could put the following in your =~/.emacs=:
437 <example>
438 (add-hook 'LaTeX-mode-hook #'(lambda ()
439           (local-set-key "\C-cb" 'ebib-insert-bibtex-key)))
440 </example>
442 This binds =C-c b= to the command =ebib-insert-bibtex-key= in AUCTeX's LaTeX
443 mode. (Note that commands of the form =C-c <letter>= are reserved for the
444 user, and should therefore not be set by any package. For this reasons,
445 Ebib does not set this command automatically.)
448 *** Consulting databases from within a LaTeX file
450 The commands =ebib-insert-bibtex-key= and =ebib-entry-summary= must consult the
451 database or databases loaded in Ebib, and Ebib tries to be smart about
452 which database(s) to consult. Usually, a LaTeX file has a =\bibliography=
453 command somewhere toward the end, which names the =.bib= file or files that
454 contain the bibliography entries. If you consult a BibTeX database from
455 within a LaTeX file, Ebib first looks for a =\bibliography= command, reads
456 the =.bib= files from it, and then sees if those files happen to be open. If
457 they are, Ebib uses them to let you pick an entry key (in the case of
458 =ebib-insert-entry-key=) or to search for the entry (in the case of
459 =ebib-entry-summary=).
461 Of course, it may be the case that the LaTeX file is actually part of a
462 bigger project, and that only the master file contains a =\bibliography=
463 command. To accommodate for this, Ebib checks whether the (buffer-local)
464 variable =TeX-master= is set to a filename. If it is, it reads that file and
465 tries to find the =\bibliography= command there. (Note: =TeX-master= is an
466 AUCTeX variable, which is used to keep track of multi-file projects. If you
467 don't use AUCTeX, this functionality doesn't work, and Ebib will only check
468 the current file for a =\bibliography= command.)
470 Note that if one of the =.bib= files in the =\bibliography= command isn't
471 loaded, Ebib issues a warning message about this, and continues to check
472 for the next =.bib= file. These warning messages appear in the minibuffer,
473 but are probably directly overwritten again by further messages or prompts
474 Ebib produces, so check the =*Messages*= buffer if Ebib doesn't seem to be
475 able to find an entry that you're sure is in one of your databases.
477 Another thing to keep in mind is that Ebib only looks for a =\bibliography=
478 command once: the first time either =ebib-insert-bibtex-entry= or
479 =ebib-entry-summary= is called. It stores the result of this search and uses
480 it the next time either of these commands is used. Therefore, if you make a
481 change to the =\bibliography= command, you must reload the file (use =M-x
482 revert-buffer=) to make sure Ebib rereads the =\bibliography= command.
484 If no =\bibliography= command is found at all, either in the LaTeX file
485 itself, or in the master file, Ebib simply consults the current database,
486 i.e. the database that was active when Ebib was lowered with =z=.
489 ** Cross-referencing
490 #cross-referencing
492 BibTeX has a cross-referencing facility. Suppose you have an entry
493 =jones1998=, which appeared in a book that is also in your database, say
494 under =miller1998=. You can tell BibTeX that =jones1998= is contained in
495 =miller1998= by putting =miller1998= in the =crossref= field. When BibTeX finds
496 such a cross-reference, all the fields of =jones1998= that don't have a value
497 inherit their values from =miller1998=. At the very least, this saves you
498 some typing, but more importantly, if two or more entries cross-reference
499 the same entry, BibTeX automatically includes the cross-referenced entry in
500 the bibliography (and puts a reduced reference in the cross-referencing
501 entries).
503 When you fill in the =crossref= field in Ebib, Ebib displays the values of
504 the cross-referenced entry in the entry buffer. To indicate that they are
505 just inherited values, they are marked with =ebib-crossref-face=, which by
506 default is red. (You can customise it, of course. See the customisation
507 option [[#crossref-face][Crossref Face]].) These values are just displayed for convenience:
508 otherwise, Ebib treats these fields as if they are empty. That is, they
509 cannot be edited (to edit them, you need to edit the cross-referenced
510 entry), and it's not possible to copy these values to the kill ring.
512 If you're viewing an entry that has a cross-reference, and want to go to
513 the cross-referenced entry you can type =F=. This command reads the value of
514 the =crossref= field and then displays that entry.
516 Note that if you want to use BibTeX's cross-referencing options, you need
517 to set the option [[#save-xrefs-first][Save Xrefs first]]. This tells Ebib to save all entries
518 with a =crossref= field first in the =.bib= file. Without this, BibTeX's
519 cross-referencing will not work reliably. 
522 ** Printing the Database
523 #printing-database
525 Sometimes it may be useful to have a =.pdf= file or print-out of your
526 database. Although Ebib does not actually do the printing itself, it can
527 create a LaTeX file for you that you can compile and print. In fact, there
528 are two ways of doing this.
530 The first is the command =L=. This command creates a simple LaTeX document
531 that essentially contains a <verb>\nocite{*}</verb> command followed by a
532 <verb>\bibliography</verb> command referring to the =.bib= file belonging to
533 the current database. You can then run the usual sequence of LaTeX, BibTeX,
534 LaTeX, LaTeX on this file, creating a document containing a list of all the
535 references in your database.
537 The second command for printing a database is =P=. This command also creates
538 a LaTeX file. However, instead of simply providing a
539 <verb>\nocite{*}</verb> command, =P= creates a =tabular= environment for each
540 entry in the database listing all the fields of that entry and their
541 values.
543 The difference between =L= and =P= should be obvious: with =L=, you get a list of
544 references created by BibTeX. This means that the references look the way
545 they will when actually used in a document, but it also means that the list
546 only contains the information that BibTeX deems relevant.
548 With =P= you get an overview of your database with *all* the field values of
549 each entry, including the ones that BibTeX does not use. The entries are
550 not formatted as literature references, but in a way similar to how they
551 are shown in Ebib.
553 By default, =P= only shows single-line field values. That is, multiline
554 values are normally excluded. If you want to include multiline values in
555 the print-out, you have to set the option =Print Multiline= in Ebib's
556 customisation buffer. (See [[#customisation-buffer][The Customisation Buffer]].) With this option set,
557 Ebib will include all multiline values in the LaTeX file that =P=
558 creates. Note however that Ebib does not change anything about the
559 formatting of the text in a multiline value. So if you plan to make (heavy)
560 use of this option, make sure that the way you type your text conforms to
561 LaTeX's conventions (e.g. empty lines to mark paragraphs, etc.) and doesn't
562 contain any characters such as =&= that are illegal in LaTeX. (Or,
563 alternatively, use LaTeX code in your multiline fields.)
565 As mentioned, when you use either =L= or =P=, Ebib creates a LaTeX file. More
566 precisely, it creates a temporary buffer and writes the LaTeX code into it,
567 and then saves the contents of that buffer to a file. After it has done
568 that, Ebib lowers itself and instruct Emacs to open the file in a buffer,
569 which will then be properly set up as a LaTeX buffer. From there you can
570 run LaTeX and view the result.
572 Before doing all this, Ebib asks you which file to write to. Be careful
573 with this: since this is supposed to be a temporary file, Ebib simply
574 assumes that if you provide a filename of an existing file, it can
575 overwrite that file without warning!
577 A better way to tell Ebib which file to use is to set the option =Print
578 Tempfile= in Ebib's customisation buffer to some temporary file. When this
579 option is set, Ebib will always use this file to write to, and will not ask
580 you for a filename anymore when you type =L= or =P=.
582 There are two more customisation options for printing the database. These
583 are =Print Preamble= and =LaTeX Preamble=. With these options, you can specify
584 what Ebib should put in the preamble of the LaTeX files it creates. Use
585 this if you want to use specific packages
586 (e.g. <verb>\usepackage{a4}</verb> or
587 <verb>\usepackage{times})</verb>. This is especially useful for =L=, since by
588 default, Ebib uses BibTeX's standard bibliography style. With the option
589 =LaTeX Preamble= you can set your preferred bibliography style. Details are
590 discussed in the chapter on customisation, see [[#customisation-buffer][The Customisation Buffer]].
594 ** Marking Entries
596 Commands in the index buffer generally operate on one single entry, or on
597 all entries. For some, however, it may sometimes be useful to perform them
598 on more than one entry, but not necessarily all of them. This can be
599 achieved by marking entries. You can mark the entries you want to perform a
600 command on with the key =m=. This marks (or unmarks) the current
601 entry. Marked entries are displayed in inverse video (in GNU Emacs) or
602 white on red (in XEmacs; note that the face properties of marked entries
603 can be customised through the customisation option [[#marked-face][Marked Face]].)
605 Of the commands discussed so far, four can be used on marked entries: =d=, =p=,
606 =L= and =P=. Note, however, that it is not enough to mark the entries you want
607 and then type any of these commands. If you do so, they will behave as if
608 no entries were marked. To get these commands to work on the marked
609 entries, you have to type a semicolon before them. That is, =; d= deletes all
610 marked entries, and =; L= and =; P= create a LaTeX file of only the marked
611 entries. The command =m= itself can also be used with the =;= prefix. If there
612 are any marked entries, =; m= unmarks them all. Otherwise, =; m= marks all
613 entries.
615 =; p= pushes all marked entries to a LaTeX buffer. It does so by putting them
616 all in a single =\cite= command, separated by commas, not by putting them in
617 separate =\cite= commands.
620 ** Calling a Browser
622 With more and more scientific literature becoming available on-line, it
623 becomes common to store URLs in a BibTeX database. Sometimes you may want
624 to load such a URL in your browser. Ebib provides a convenient way for
625 doing so.
627 If you type =u= in the index buffer, Ebib takes the first URL stored in the
628 =url= field of the current entry and passes it to your browser. Furthermore,
629 in the entry buffer, you can use =u= on *any* field. If you happen to have more
630 than one URL stored in the relevant field, and you want to pass the second
631 (or third, etc.) to the browser, you can use a prefix argument. So typing
632 =M-2 u= sends the second URL to your browser, =M-3 u= the third, and so on.
634 It is not even necessary that the relevant field contains *only* URLs. It may
635 contain other text mixed with the URLs: Ebib simply searches the URLs in
636 the field and ignores the rest of the text. Ebib considers every string of
637 characters that starts with =http://= or =https://= and that does not contain
638 whitespace or any of the characters =" ' <= or =>= as a URL. Furthermore, Ebib
639 regards everything that is enclosed in a LaTeX <verb>\url{...}</verb>
640 command as a URL. This behaviour is controlled by a regular expression that
641 can be customised. (See [[#url-regexp][Url Regexp]].)
643 There exists an Emacs function =browse-url=, which provides a nifty interface
644 to calling an external browser. In principle, Ebib uses this
645 function. However, if this function is not present on your installation,
646 you can set the option [[#browser-command][Browser Command]] to call the browser.
648 As just explained, if you press =u= in the index buffer, Ebib searches the
649 =url= field of the current entry for URLs. If you have the habit of putting
650 your URLs in another field, however, you may change the customisation
651 option [[#standard-url-field][Standard Url Field]] and tell Ebib to use another field for searching
652 the URLs. (Keep in mind, though, that in the entry buffer, you can load a
653 URL from any field.)
656 ** Viewing files
658 If you have electronic versions of the papers in your database stored on
659 your computer, you can use Ebib to call external viewers for these
660 files. The interface for this is similar to that for calling a browser: if
661 you press =f= in the index buffer, Ebib searches the =file= field for a
662 filename and when it finds one, calls an appropriate viewer.
664 Just as with =u=, you can use =f= in the entry buffer as well, in which case it
665 can be used on any field, not just the =file= field. It is also possible to
666 have more than one filename in a field: you can select the one you want to
667 view with the prefix argument.
669 Just as in the case of URLs, you can customise several things about the
670 file view functionality. The option [[#standard-file-field][Standard File Field]] allows you to
671 customise the field that =f= extracts filenames from when pressed in the
672 index buffer. Extracting filenames is done with a regular expression, which
673 can be customised through the option [[#file-regexp][File Regexp]].
675 The option [[#file-search-dirs][File Search Dirs]] allows you to tell Ebib which directories it
676 needs to search for files. The default value is =~=, which means Ebib just
677 looks in your home dir. Since this is probably not where you keep your
678 files, you may want to customise this. Note that you can specify more than
679 one directory.
681 Note that Ebib does not search directories recursively. It is possible,
682 however, to put subdirectories in the filenames. That is, if you put
683 something like =a/abney1987.pdf= in the =file= field, Ebib searches for the
684 relevant file in a subdirectory =a/= of the directories listed in the option
685 =File Search Dirs=. (Note that if you want to do this under Windows, you may
686 want to remove the backslash from the file regexp.)
688 Ebib can call different external programs depending on the file type of the
689 relevant file, but you have to specify which programs to call. The option
690 [[#file-associations][File Associations]] allows you to do this. By default, =.pdf= and =.ps= files are
691 handled, by =xpdf= and =gv=, respectively. You can specify further file types by
692 their extensions (do not include the dot). The program is searched for in
693 PATH, but you can of course specify the full path to the program.
696 * Advanced Features
698 The features discussed in the previous chapter should be sufficient to get
699 started using Ebib. However, Ebib has several more advanced features, which
700 are described in this chapter.
703 ** Preloading =.bib= files
705 Chances are that you will be doing most of your work with one or a few =.bib=
706 files, and you may find yourself opening the same file or files every time
707 you start Ebib. If so, you can tell Ebib to always load specific =.bib= files
708 on startup. To do this, specify the files in Ebib's customisation buffer,
709 under the option [[#preload-bib-files][Preload Bib Files]].
712 ** =@Preamble= Definition
714 Apart from database entries, BibTeX allows three more types of elements to
715 appear in a =.bib= file. These are =@comment=, =@preamble= and =@string=
716 definitions. Ebib provides facilities to handle the latter two. =@comment=
717 definitions cannot be added to a =.bib= file through Ebib, and if Ebib finds
718 one in a =.bib= file, it is simply ignored.
720 =@preamble= and =@string= definitions can be handled, however. Ebib allows you
721 to add one =@preamble= definition to the database.  In principle, BibTeX
722 allows more than one such definition, but really one suffices, because you
723 can use the concatenation character =#= to include multiple TeX or LaTeX
724 commands. So, rather than having two =@preamble= definitions such as:
726 <example>
727 @preamble{ "\newcommand{\noopsort}[1]{} " }
728 @preamble{ "\newcommand{\singleletter}[1]{#1} " }
729 </example>
731 <literal style="texinfo">@noindent</literal>you can write this in your =.bib=
732 file:
734 <example>
735 @preamble{ "\newcommand{\noopsort}[1]{} "
736          # "\newcommand{\singleletter}[1]{#1} " }
737 </example>
739 Creating or editing a =@preamble= definition in Ebib is done by hitting =r= in
740 the index buffer. Ebib uses the multiline edit buffer for editing the text
741 of the =@preamble= definition, which means that as discussed above, =C-x b=
742 stores the =@preamble= text and returns focus to the index buffer, while =C-x
743 k= returns focus to the index buffer while abandoning any changes you may
744 have made. (For details on using the multiline edit buffer, see
745 [[#multiline-edit-buffer][The Multiline Edit Buffer]].)
747 In order to create a =@preamble= as shown above in Ebib, you only have to
748 type the text between the braces.  Ebib takes care of including the braces
749 of the =@preamble= command, but otherwise it saves the text exactly as you
750 enter it. So in order to get the preamble above, you'd have to type the
751 following in Ebib:
753 <example>
754 "\newcommand{\noopsort}[1]{} "
755 # "\newcommand{\singleletter}[1]{#1} "
756 </example>
758 Note that when Ebib loads a =.bib= file that contains more than one =@preamble=
759 definition, it concatenates all the strings in them in the manner just
760 described and saves them in one =@preamble= definition.
763 ** =@String= Definitions
765 If you press =t= in the index buffer, Ebib hides the entry buffer in the
766 lower window and replaces it with the *strings buffer*. In this buffer, you
767 can add, delete and edit =@string= definitions.
769 Adding a =@string= definition is done with the command =a=. This will first ask
770 you for an abbreviation and then for the value to be associated with that
771 abbreviation. Once you've entered these, Ebib will sort the new
772 abbreviation into the buffer.
774 Moving between the =@string= definitions can be done in the usual way: the
775 cursor keys =up= and =down=, =C-p= and =C-n= and =k= and =j= move up and down. =Space=
776 and =PgDn= move ten strings down, while =b= and =PgUp= move in the other
777 direction. The keys =g=, =G=, =Home= and =End= also function as expected.
779 To delete a =@string= definition, use =d=. To edit the value of a definition,
780 use =e=. There is also a command =c=, which copies the value of the current
781 =@string= definition to the kill ring. Unlike in the entry buffer, there are
782 no corresponing commands =y= and =x=. (In fact, =x= does exist, but has another
783 function.) Yanking from the kill ring can be done with =C-y/M-y= in the
784 minibuffer when you edit a =@string='s value. Cutting a =@string='s value
785 is pointless, because a =@string= definition must have a value.
787 Having defined =@string= definitions, there must of course be a way to use
788 them. Just giving a field a string abbreviation as value will not do,
789 because Ebib puts braces around the value that you enter when it writes the
790 =.bib= file, so that BibTeX will not recognise the abbreviation, and will not
791 expand it. BibTeX will only recognise an abbreviation if it appears in the
792 =.bib= file outside of any braces.
794 To accomplish this, you must mark a field's value as *raw*. A raw field is a
795 field whose value is not surrounded by braces when the database is saved,
796 so that BibTeX recognises it as an abbreviation. To mark a field raw, press
797 =r=. An asterisk will appear before the field, indicating that it is
798 raw. Pressing =r= again will change the field back to normal. If you press =r=
799 on a field that does not have a value yet, Ebib will ask you for one.
801 Note that this also makes it possible to enter field values that are
802 composed of concatenations of strings and abbreviations. The BibTeX
803 documentation for example explains that if you have defined:
805 <example>
806 @string{WGA = "World Gnus Almanac"}
807 </example>
809 <literal style="texinfo">@noindent</literal>you can create a BibTeX field
810 like this:
812 <example>
813 title = 1966 # WGA
814 </example>
816 <literal style="texinfo">@noindent</literal>which will produce ``1966 World
817 Gnus Almanac''. Or you can do:
819 <example>
820 month = "1~" # jan
821 </example>
823 <literal style="texinfo">@noindent</literal>which will produce someting
824 like ``1 January'', assuming your bibliography style has defined the
825 abbreviation =jan=. All this is possible with Ebib, simply by entering the
826 exact text including quotes or braces around the strings, and marking the
827 relevant field as raw.
829 An easy way to enter a =@string= abbreviation as a field value is to use the
830 key =s= instead of =e=. If you type =s=, Ebib asks you for a =@string= abbreviation
831 to put in the current field, and automatically marks the field as raw. With
832 this command, Ebib only accepts =@string= definitions that are in the
833 database, so that by using =s= you can make sure you don't make any
834 typos. Note that you can use tab completion to complete a partial string.
837 ** Sorting the =.bib= file
838 #sorting-bib-file
840 By default, the entries in the database are saved to the =.bib= file in
841 alphabetical order according to entry key. If you only deal with the =.bib=
842 file through Ebib, you may not care in which order the entries are
843 saved. However, it may sometimes be desirable to be able to specify the
844 sort order of entries in more detail. (Apparently, this can be useful with
845 ConTeXt, for example.)
847 You can specify a sort order in Ebib's customisation buffer. To sort the
848 entries, you must set at least one sort level (that is, a field to sort the
849 entries on). You can also specify more than one sort level: if two entries
850 have identical values for the first sort level, they will be sorted on the
851 second sort level. E.g., if the first sort level is =author= and the second
852 is =year=, then the entries are sorted by author, and those entries that have
853 identical values for the =author= field are sorted by year.
855 A sort level is not restricted to a single field. You can specify more
856 fields for a single sort level. Within a single sort level, a second sort
857 field is used if the first sort field does not have a value. For example,
858 books that have an editor instead of an author will have an empty =author=
859 field. If you sort the database on the =author= field, such entries will all
860 appear at the beginning of the =.bib= file, which is most likely not what you
861 want.
863 To remedy this, you can specify both the =author= and the =editor= fields for
864 the first sort level. Ebib will then sort an entry on its =author= field if
865 it has a value, and will otherwise use the value of the =editor= field.
867 The difference between two sort fields within one sort level and two sort
868 levels is that a second sort *field* is an alternative for the first field
869 when it has no value, while a second sort *level* is an additional sort
870 criterion when two or more entries cannot be sorted on the first level,
871 because they have identical values.
873 By default, the option =Sort Order= has no value, which means that the
874 entries in the =.bib= file are sorted according to entry key. Those that wish
875 to customise the sort order will usually want to set the first sort level
876 to =author editor=, and the second to =year=. In that way, the entries in the
877 =.bib= file are sorted according to author/editor, and entries with the same
878 author/editor are sorted by year.
880 Entries that cannot be sorted on some sort level, because the sort fields
881 are empty, are sorted on entry key. (Keep in mind that if the first sort
882 level yields *no value* for a specific entry, Ebib does *not* use the second
883 sort level to sort that entry. It uses the entry key. The second sort level
884 is only used if the first yields *identical* values for two or more entries.)
886 Note that if you have set the option =Save Xrefs First= (see
887 [[#cross-referencing][Cross-referencing]]), it is pointless to set a sort order. Saving
888 cross-referencing entries first messes up any sort order, so Ebib simply
889 ignores the sort order if =Save Xrefs First= is set.
892 ** Merging and Importing
894 As described in the previous chapter, adding entries to a database can be
895 done manually with the key =a=. There are other ways of adding entries to a
896 database, however.
898 With the command =M= you can merge a second =.bib= file into your current
899 database. When you hit =M=, you are asked for a filename. Ebib then reads the
900 entries in this file and adds them to the database. Duplicate entries (that
901 is, entries with an entry key that already exists in the database) will not
902 be loaded. Ebib logs a warning about each duplicate entry to its log
903 buffer, and displays a warning after loading the =.bib= file when this
904 happens.
906 Another way to add entries to a database is to import them from an Emacs
907 buffer. If, for example, you find ready-formatted BibTeX entries in a text
908 file or e.g. on the internet, you can copy & paste them to any Emacs buffer
909 (e.g. the =*scratch*= buffer), and then execute the command =M-x
910 ebib-import=. Ebib then goes through the buffer and loads all BibTeX entries
911 it finds into the current database (i.e. the database that was active when
912 you lowered Ebib). If you call =ebib-import= while the region is active, Ebib
913 only reads the BibTeX entries in the region.
916 ** Exporting Entries
918 Sometimes it can be useful to copy entries from one database to another, or
919 to create a new =.bib= file with several entries from an existing
920 database. For this purpose, Ebib provides exporting facilities. To export
921 an entry to a =.bib= file, use the command =x=. Ebib will ask you for a
922 filename to export the entry to. (If you have already exported an entry
923 before, Ebib will present the filename you used as default, but you can of
924 course change it.)
926 For obvious reasons, Ebib appends the entry to the file that you enter if
927 it already exists, it does not overwrite the file. If this is not what you
928 want, delete the file first, as Ebib provides no way to do this.
930 If you have more than one database open in Ebib, it is also possible to
931 copy entries from one database to another. To do this, use the =x= command
932 with a numeric prefix argument. E.g., if the database you want to export an
933 entry to is the second database, type =M-2 x= to export the current entry to
934 it. The number of the database is given in the modeline of the index
935 buffer.
937 If the database you're copying an entry to already contains an entry with
938 the same entry key, Ebib won't copy the entry, and issues an appropriate
939 warning message.
941 Note that the command =x= can operate on marked entries. So to export several
942 entries in one go mark them and type =; x=. You can use a prefix argument in
943 the normal way: =M-2 ; x= exports the marked entries to database 2.
945 Apart from entries, it is also possible to export the =@preamble= and =@string=
946 definitions. The =@preamble= definition is exported with the command =X= in the
947 index buffer. =@string= definitions can be exported in the strings buffer: =x=
948 in this buffer exports the current string, while =X= exports all =@string=
949 definitions in one go. All these commands function in the same way: when
950 used without a prefix argument, they ask for a filename, and then append
951 the relevent data to that file. With a numeric prefix argument, they copy
952 the relevant data to the corresponding open database.
955 ** Timestamps
956 #timestamps
958 Ebib provides the possibility to add a timestamp to every new entry,
959 recording the time it was added to the database. The timestamp is recorded
960 in the (additional) field =timestamp=. (By default, this field is not shown,
961 but you can make it visible by pressing =H= in the index buffer.)
963 You can tell Ebib to create timestamps by setting the option =Use Timestamp=
964 in Ebib's customisation buffer. With this option set, a timestamp is
965 included in entries added to the database with =a=. Ebib will also add a
966 timestamp to entries imported from a buffer or merged from a file, and to
967 entries exported to another database or to a file. When importing or
968 exporting entries, existing timestamps will be overwritten. The logic
969 behind this is that the timestamp records the date and time when the entry
970 was added to the database, not when it was first created.
972 Note that if this option is unset, the timestamp of an entry is retained
973 when it's imported or exported. Therefore, if you record timestamps and
974 want to im-/export entries without changing their timestamps, temporarily
975 unset this option.
977 Ebib uses the function =format-time-string= to create the timestamp. The
978 format string that Ebib uses can be customised in Ebib's customisation
979 buffer. The default string is ="%a %b %e %T %Y"=, which produces a timestamp
980 of the form ="Mon Mar 12 01:03:26 2007"=. Obviously, this string is not
981 suited for sorting, so if you want to be able to sort on timestamps, you'll
982 need to customise the format string. See the documentation for
983 =format-time-string= on the options that are available.
986 ** Multiple Identical Fields
987 #multiple-identical-fields
989 Under normal circumstances, a BibTeX entry only contains one occurrence of
990 each field. If BibTeX notices that an entry contains more than one
991 occurrence of an obligatory or optional field, it issues a warning. Ebib is
992 somewhat less gracious, it simply takes the value of the last occurrence
993 without giving any warning. (Note, by the way, that BibTeX will use the
994 value of the *first* occurrence, not the last.) When additional fields appear
995 more than once in an entry, BibTeX does not warn you, since it ignores
996 those fields anyway. Here, too, Ebib's standard behaviour is to ignore all
997 but the last value.
999 However, some online reference management services ``use'' this feature of
1000 BibTeX in that they put multiple =keywords= fields in the BibTeX entries that
1001 they produce. If you were to import such an entry into Ebib, you would lose
1002 all your keywords except the last one. To remedy this, you can tell Ebib
1003 that it should allow multiple occurrences of a single field in a BibTeX
1004 entry. You can do this by setting the customisation option
1005 [[#allow-identical-fields][Allow Identical Fields]].
1007 With this option set, Ebib collapses the multiple occurrences into a single
1008 occurrence. All the values of the different occurrences are collected and
1009 stored in the single occurrence, separated by semicolons. That is, Ebib
1010 does not retain the multiple occurrences, but it does retain the values. So
1011 suppose you have an entry that contains the following =keywords= fields:
1013 <example>
1014 @book{jones1998,
1015     author = {Jones, Joan},
1016     year = {1998},
1017     ...
1018     keywords = {sleep},
1019     keywords = {winter},
1020     keywords = {hybernation}
1022 </example>
1024 If you load this entry into Ebib with the option =Allow Identical Fields=
1025 set, you will get the following:
1027 <example>
1028 @book{jones1998,
1029     author = {Jones, Joan},
1030     year = {1998},
1031     ...
1032     keywords = {sleep; winter; hybernation}
1034 </example>
1037 ** Virtual Databases
1038 #virtual-databases
1040 In the previous chapter, Ebib's basic search functionality was
1041 discussed. (See [[#searching][Searching]].) Ebib also provides a much more sophisticated
1042 search and filtering mechanism in the form of *virtual databases*.
1044 A virtual database is a database that is not associated with any =.bib=
1045 file. Rather, it is created from another database by selecting entries from
1046 it based on a specific search pattern, called a *filter*. This allows you,
1047 for example, to select all entries from a database that contain the string
1048 ``Jones'' in their =author= field. A filter can be as complex as you want:
1049 you can select all entries that do *not* contain ``Jones'' in the =author=
1050 field, or all entries that contain ``Jones'' in either the =author= or the
1051 =editor= field, or all entries that contain ``Jones'' in the =author= field,
1052 and ``symbiotic hybernation'' in the =keyword= field, etc. Basically, the
1053 filter can consist of an arbitray number of search criteria combined with
1054 the logical operators =and, or= and =not=.
1057 *** Simple Selection
1059 Creating a virtual database is simple: press =&=, and Ebib will ask you for a
1060 field to select on, and for a regular expression to select with. So if you
1061 want to select all entries that contain ``Jones'' in the =author= field, you
1062 press =&= and type =author= as the field and =Jones= as the regexp to filter on.
1064 Ebib will then create a virtual database containing the entries matching
1065 your selection criterion. A virtual database has the same name as the
1066 database it is based on, prepended with =V:=. It also has a number like any
1067 other database, and you can move back and forth to other databases with the
1068 number or cursor keys.
1070 If you don't want to filter on one specific field but rather want to select
1071 all entries that match a certain regexp in any field, you can type =any= as
1072 the field to filter on. So specifying =any= as the field and =Jones= as the
1073 regexp, the virtual database will select all entries that have a field that
1074 contains ``Jones'' in them.
1077 *** Complex Filters
1079 Once you have a virtual database, it remains associated with the database
1080 it was created from. This means that you can refine or extend the selection
1081 (i.e. the filter) that the virtual database is based on. If, in the current
1082 example, you want to include all the entries that have ``Jones'' in the
1083 =editor= field, you have to perform a logical =or= operation: you want to
1084 select an entry if it contains ``Jones'' in the =author= field (which you
1085 already did) *or* if it contains ``Jones'' in the =editor= field.
1087 A short sidenote: the first impulse in a case like this might be to use =and=
1088 instead of =or=: after all, you want to select all entries that contain
1089 ``Jones'' in the =author= field *and* all entries that contain ``Jones'' in the
1090 =editor= field. However, the filter that you build up is used to test each
1091 entry *individually* whether it meets the selection criterion. An entry meets
1092 the criterion if it contains ``Jones'' in the =author= field *or* if it
1093 contains ``Jones'' in the =editor= field. Therefore, =or= is the required
1094 operator in this case. If you would use =and=, you would only get those
1095 entries that contain ``Jones'' in both the =author= *and* =editor= fields.
1097 To perform a logical =or= operation, press the key =|=. As before, you will be
1098 asked which field you want to filter on, and which regexp you want to
1099 filter with. Ebib will then update the virtual database with all entries in
1100 the original database that match the additional criterion.
1102 It is also possible to perform a logical =and= on the virtual database. Use
1103 this if you want to select those entries that contain ``Jones'' in the
1104 =author= field and e.g. ``symbiotic hybernation'' in the =keyword= field. A
1105 logical =and= operation is done with the key =&=. (Note: this is the same key
1106 that is used to create a virtual database. In fact, you can also create a
1107 virtual database with =|=: when used in a normal database, =&= and =|= are
1108 equivalent. They are only different in virtual databases.)
1110 Both the =&= and =|= commands can be used with the negative prefix argument =M--=
1111 (or =C-u -=, which is identical). In this case, the search criterion is
1112 negated. That is, the negative prefix argument performs a logical =not=
1113 operation on the search criterion.
1115 That is, if you want to select all entries from a database that do *not*
1116 contain ``Jones'' in the =author= field, you can do this by typing =M-- &= and
1117 then filling out the relevant field and regexp. This prefix argument is
1118 available both in real and in virtual databases.
1120 There is another way of performing a logical =not= operation, which is only
1121 available in virtual databases: by pressing the key =~=, you invert the
1122 current filter. That is, if you have a virtual database with all the
1123 entries containing ``Jones'' in the =author= or in the =editor= field, and you
1124 press =~=, the selection is inverted, and now contains all entries that do
1125 *not* have ``Jones'' in the =author= or =editor= field.
1127 Although =~= and the negative prefix argument to =&= or =|= both perform logical
1128 =not= operations, they are *not* equivalent: =~= negates the entire filter built
1129 up so far, while the negative prefix argument only negates the single
1130 selection criterion you enter with it.
1132 If you want to know what the filter for the current virtual database is
1133 exactly, you can type =V=. This command displays the current filter in the
1134 minibuffer. The filter is specified as a Lisp expression, meaning that the
1135 operators appear before their operands, not in between them. That is, =x and
1136 y= is written as =(and x y)=.
1138 With a prefix argument (any prefix argument will do), the command =V= not
1139 only displays the current filter, but also reapplies it. This can be useful
1140 when you've made changes to the source database: Ebib does not
1141 automatically update a virtual database when its source database is
1142 modified.
1145 *** Properties of Virtual Databases
1147 Virtual databases differ from normal databases in several ways. First, they
1148 cannot be modified: you cannot add or delete entries, and you cannot modify
1149 the contents of fields. It is also not possible to import entries to them
1150 or merge another file with them. Furthermore, it is not possible to export
1151 entries to them or from them.
1153 A virtual database cannot be saved in the normal way with =s=, and the
1154 command =S= to save all databases ignores virtual databases. If you want to
1155 save a virtual database, you can use the command =w=. This command not only
1156 saves the virtual database, it also changes it into a normal database, and
1157 detaches it from its original source database, so that you can modify it
1158 without affecting the source database.
1160 The command =L= also doesn't work with virtual databases. The reason for this
1161 is that the virtual database is not associated with an actual =.bib= file, so
1162 there is no file to create a list of references from. However, it is
1163 possible to use the command =P= with a virtual database to create a list of
1164 entries. See [[#printing-database][Printing the Database]], for details on these two commands.
1167 ** The Multiline Edit Buffer
1168 #multiline-edit-buffer
1170 As mentioned several times before, Ebib has a special multiline edit
1171 buffer, which is used to edit field values that contain newlines (so-called
1172 *multiline fields*), and also to edit the contents of the =@preamble=
1173 command. This section discusses the details of this buffer.
1175 Ebib enters multiline edit mode in one of three cases: when you press =P= in
1176 the index buffer, to edit the =@preamble= definition, when you hit =l= in the
1177 entry buffer to edit the current field as multiline, or when you hit =e= on
1178 the =annote= field, or on a field whose value already is multiline.
1180 The multiline edit buffer uses a special major mode,
1181 =ebib-multiline-edit-mode=, which is derived from =text-mode=. The changes with
1182 respect to =text-mode= are minor (see below), which means that any
1183 customisations you may have made to =text-mode= will be available in the
1184 multiline edit buffer.
1186 The settings that are specific for =ebib-multiline-edit-mode= are the
1187 functions assigned to the key sequences =C-x b=, =C-x k= and =C-x C-s=. These key
1188 sequences do not have their usual functions, but rather are redefined to
1189 fit Ebib. Both =C-x b= and =C-x k= can be used to leave the multiline edit
1190 buffer. =C-x b= will store the text as it is to the database, while =C-x k=
1191 leaves the multiline edit buffer *without* storing the text, i.e., the
1192 original value of the field or preamble that you were editing is
1193 retained. If the text in the buffer was modified, =C-x k= asks you if you
1194 really want to abandon your changes.
1196 If you leave the multitiline edit buffer with =C-x b= when the buffer is
1197 empty (i.e., you deleted all the text, including the final newline), and
1198 you were editing a field value or the =@preamble= definition, the field value
1199 or preambleis deleted. (This is in fact the *only* way to delete the
1200 =@preamble= definition. Field values on the other hand can also be deleted by
1201 hitting =x= or =d= on them in the entry buffer.)
1203 The third command that is redefined in the multiline edit buffer is =C-x
1204 C-s=. This command can be used to save the database. Because Ebib does not
1205 do an autosave of the current database, it is advisable to save the
1206 database manually every now and then to prevent data loss in case of
1207 crashes. It would be annoying to have to leave the multiline edit buffer
1208 every time you want to do this, so =C-x C-s= has been redefined to allow you
1209 to do this from within the buffer.
1212 * The Ebib Buffers
1213 #ebib-buffers
1215 This chapter lists all the key commands that exist in Ebib, with a short
1216 description and the actual command that they call. The latter information
1217 is needed if you want to customise Ebib's key bindings. (See
1218 [[#modifying-key-bindings][Modifying Key Bindings]].)
1222 ** The Index Buffer
1224   =Up= :: go to previous entry. =(ebib-prev-entry)=
1226   =Down= :: go to next entry. =(ebib-next-entry)=
1228   =Right= :: move to the next database. =(ebib-next-database)=
1229   
1230   =Left= :: move to the previous database. =(ebib-prev-database)=
1232   =PgUp= :: scroll the index buffer down. =(ebib-index-scroll-down)=
1234   =PgDn= :: scroll the index buffer up. =(ebib-index-scroll-up)=
1235   
1236   =Home= :: go to first entry. =(ebib-goto-first-entry)=
1238   =End= :: go to last entry. =(ebib-goto-last-entry)=
1240   =Return= :: make the entry under the cursor current. Use after e.g. =C-s=.
1241 =(ebib-select-entry)=
1242   
1243   =Space= :: equivalent to =PgDn=.
1244   
1245   =1-9= :: jump to the corresponding database.
1247   =/= :: search the database. =(ebib-search)=
1248   
1249   =&= :: Create a virtual database, or perform a logical =and= on the current
1250 virtual database. With negative prefix argument: apply a logical =not= to the
1251 selectional criterion. =(ebib-virtual-db-and)=
1253   =|= :: Create a virtual database, or perform a logical =or= on the current
1254 virtual database. With negative prefix argument: apply a logical =not= to the
1255 selectional criterion. =(ebib-virtual-db-or)=
1257   =~= :: Perform a logical =not= on the current virtual
1258 database. =(ebib-virtual-db-not)=
1260   =a= :: add an entry. =(ebib-add-entry)=
1262   =b= :: equivalent to =Pgup=.
1264   =c= :: close the database. =(ebib-close-database)=
1265   
1266   =C= :: customise Ebib. =(ebib-customize)=
1268   =d= :: delete the current entry. =(ebib-delete-entry)=
1270   =; d= :: delete all marked entries.
1272   =e= :: edit the current entry. =(ebib-edit-entry)=
1273   
1274   =E= :: edit the key of the current entry. =(ebib-edit-keyname)=
1276   =f= :: extract a filename from the =file= field and send it to an
1277 appropriate viewer. With numeric prefix argument, extract the *n*-th
1278 filename.
1280   =F= :: follow =crossref= field. =(ebib-follow-crossref)=
1282   =g= :: equivalent to =Home=.
1284   =G= :: equivalent to =End=.
1286   =h= :: show help for the index buffer. =(ebib-index-help)=
1288   =H= :: show/hide hidden fields. =(ebib-toggle-hidden)=
1290   =j= :: equivalent to =Down=.
1292   =J= :: jump to another database. This accepts a numeric prefix argument,
1293 but will ask you for a database number if there is
1294 none. =(ebib-switch-to-database)=
1296   =k= :: equivalent to =Up=.
1298   =l= :: show the log buffer. (=ebib-show-log=)
1300   =L= :: create a LaTeX file from the current database that produces a list
1301 of references formatted by BibTeX. =(ebib-latex-database)=
1303   =; L= :: create a LaTeX file with the marked entries only.
1305   =m= :: mark (or unmark) the current entry. =(ebib-mark-entry)=
1307   =; m= :: unmark all marked entries.
1309   =M= :: merge a =.bib= file. =(ebib-merge-bibtex-file)=
1310   
1311   =n= :: find next occurrence of the search string. =(ebib-search-next)=
1313   =C-n= :: equivalent to =Down=.
1315   =M-n= :: equivalent to =PgDn=.
1316   
1317   =o= :: open a =.bib= file. =(ebib-load-bibtex-file)=
1319   =p= :: push an entry to a LaTeX buffer =(ebib-push-entry-key)=
1321   =; p= :: push the marked entries to a LaTeX buffer.
1323   =C-p= :: equivalent to =Up=.
1325   =M-p= :: equivalent to =PgUp=.
1327   =P= :: create a LaTeX file for printing the database, listing the entire
1328 contents of each entry. =(ebib-print-database)=
1330   =; P= :: create a LaTeX file with the marked entries.
1332   =r= :: show and edit the =@preamble= definition in the
1333 database. =(ebib-edit-preamble)=
1335   =q= :: quit Ebib. This sets all variables to nil, unloads the database(s)
1336 and quits Ebib. =(ebib-quit)=
1338   =s= :: save the database. =(ebib-save-current-database)=
1340   =S= :: save all modified databases. =(ebib-save-all-databases)=
1342   =t= :: show and edit the =@string= definitions in the
1343 database. =(ebib-edit-strings)=
1345   =u= :: extract a URL from the =url= field and send it to a browser. With
1346 numeric prefix argument, extract the *n*-th url.
1348   =V= :: Display the filter of the current virtual database in the
1349 minibuffer. With prefix argument: reapply the filter. =(ebib-print-filter)=
1351   =w= :: write the database to a different file. =(ebib-write-database)=
1353   =x= :: export the current entry to a file, or, when used with numeric
1354 prefix argument, to another database. =(ebib-export-entry)=
1356   =; x= :: export the marked entries to a file, or, when used with a numeric
1357 prefix argument, to another database.
1359   =C-x b= :: equivalent to =z=.
1361   =C-x k= :: equivalent to =q=.
1363   =X= :: export the =@preamble= definition to a file or, when used with a
1364 numeric prefix argument, to another database. =(ebib-export-preamble)=
1366   =z= :: lower Ebib. =(ebib-lower)=
1368 One function is not bound to any key: =ebib-print-filename=.
1370 ** The Entry Buffer
1372   =Up= :: go to the previous field. =(ebib-prev-field)=
1374   =Down= :: go to the next field. =(ebib-next-field)=
1376   =PgUp= :: go to the previous set of fields. =(ebib-goto-prev-set)=
1378   =PgDn= :: go to the next set of fields. =(ebib-goto-next-set)=
1379   
1380   =Home= :: go to the first field. =(ebib-goto-first-field)=
1381   
1382   =End= :: go to the last field. =(ebib-goto-last-field)=
1384   =Space= :: equivalent to =PgDn=.
1386   =b= :: equivalent to =PgUp=.
1388   =c= :: copy the contents of the current field to the kill
1389 ring. =(ebib-copy-field-contents)=
1391   =d= :: delete the value of the current field. The deleted contents will *not*
1392 be put in the kill ring, and is therefore irretrievably
1393 lost. =(ebib-delete-field-contents)=
1394   
1395   =e= :: edit the current field. =(ebib-edit-fields)=
1397   =f= :: extract a filename from the current field and send it to an
1398 appropriate viewer. With numeric prefix argument, extract the *n*-th
1399 filename.
1401   =g= :: equivalent to =Home=.
1402   
1403   =G= :: equivalent to =End=.
1405   =h= :: show help for the entry buffer. =(ebib-entry-help)=
1407   =j= :: go to the next field. =(ebib-next-field)=
1409   =k= :: go to the previous field. =(ebib-prev-field)=
1411   =l= :: edit the current field as multiline. =(ebib-edit-multiline-field)=
1413   =C-n= :: equivalent to =Down=.
1415   =M-n= :: equivalent to =PgDn=.
1416   
1417   =C-p= :: equivalent to =Up=.
1419   =M-p= :: equivalent to =PgUp=.
1421   =q= :: quit editing the current entry and return focus to the index
1422 buffer. =(ebib-quit-entry-buffer)=
1424   =r= :: toggle a field's ``raw'' status. =(ebib-toggle-raw)=
1425   
1426   =s= :: insert an abbreviation from the =@string= definitions in the
1427 database. =(ebib-insert-abbreviation)=
1429   =u= :: extract a URL from the current field and send it to a browser. With
1430 numeric prefix argument, extract the *n*-th url.
1432   =x= :: cut the contents of the current field. Like =c=, =x= puts the contents
1433 of the current field in the kill ring. =(ebib-cut-field-contents)=
1435   =y= :: yank the last element in the kill ring to the current
1436 field. Repeated use of =y= functions like =C-y/M-y=. Note that no text will be
1437 yanked if the field already has a value. =(ebib-yank-field-contents)=
1440 ** The Strings Buffer
1442   =Up= :: go to the previous string. =(ebib-prev-string)=
1444   =Down= :: go to the next string. =(ebib-next-string)=
1446   =PgUp= :: go ten strings up. =(ebib-strings-page-up)=
1448   =PgDn= :: go ten strings down. =(ebib-strings-page-down)=
1450   =Home= :: go to the first string. =(ebib-goto-first-string)=
1451   
1452   =End= :: go to the last string. =(ebib-goto-last-string)=
1454   =Space= :: equivalent to =PgDn=.
1456   =a= :: add a new =@string= definition. =(ebib-add-string)=
1458   =b= :: equivalent to =PgUp=.
1460   =c= :: copy the text of the current string to the kill
1461 ring. =(ebib-copy-string-contents)=
1462   
1463   =d= :: delete the current =@string= definition from the database. You will be
1464 asked for confirmation. =(ebib-delete-string)=
1465   
1466   =e= :: edit the value of the current string. =(ebib-edit-string)=
1468   =g= :: equivalent to =Home=.
1469   
1470   =G= :: equivalent to =End=.
1472   =h= :: show help for the strings buffer. =(ebib-strings-help)=
1474   =j= :: equivalent to =Down=.
1476   =k= :: equivalent to =Up=.
1478   =l= :: edit the value of the current string as
1479 multiline. =(ebib-edit-multiline-string)=
1481   =C-n= :: equivalent to =Down=.
1483   =M-n= :: equivalent to =PgDn=.
1485   =C-p= :: equivalent to =Up=.
1487   =M-p=  :: equivalent to =PgUp=.
1489   =q= :: quit the strings buffer and return focus to the index
1490 buffer. =(ebib-quit-strings-buffer)=
1492   =x= :: export the current =@string= definition to a file or, when used with a
1493 prefix argument, to another database. =(ebib-export-string)=
1494   
1495   =X= :: export all the =@string= definitions to a file or, when used with a
1496 prefix argument, to another database. =(ebib-export-all-strings)=
1499 * Customisation
1500 #customisation
1502 Ebib can be customised through Emacs' standard customisation interface. The
1503 only thing that cannot be customised in this way are the key bindings. If
1504 you wish to customise those, you have to use the file =~/.ebibrc=.
1507 ** The Customisation Buffer
1508 #customisation-buffer
1510 Ebib's customisation group is a subgroup of the =Tex= group. It can be
1511 invoked by typing =M-x customize-group RET ebib RET=, or by pressing =C= in
1512 the index buffer. This chapter gives a short description of all the options
1513 available in the customisation buffer.
1516 *** Default Type
1518 The default type is the default entry type given to a new entry. Every
1519 entry in the Ebib database must have a type, because the type defines which
1520 fields are available. When a new entry is created, Ebib gives it a default
1521 type, which can be customised through this option. The standard value is
1522 =article=.
1525 *** Preload Bib Files
1526 #preload-bib-files
1528 This option allows you to specify which file(s) Ebib is to load when it
1529 starts up. Specify one file per line, press the =INS= button to add more
1530 files. You can complete a partial filename with =M-TAB=.
1533 *** Additional Fields
1534 #additional-fields
1536 The additional fields are those fields that are available for all entry
1537 types, and which BibTeX generally ignores. This option allows you to
1538 specify which additional fields you wish to use in your database. Specify
1539 one field per line, press the =INS= button to add more fields.
1541 By default, the following additional fields are defined: =crossref, url,
1542 annote, abstract, keywords, file= and =timestamp=.
1545 *** Index Window Size
1547 This option lets you specify the size of the index window at the top of the
1548 Ebib screen. The default value is 10.
1551 *** Index Display Fields
1552 #index-display-fields
1554 This option allows you to specify fields that should be displayed next to
1555 the entry key in the index buffer. By default, the index buffer only shows
1556 the key of each entry, but if this is too little information, you can use
1557 this option to display e.g. the title of each entry as well.
1560 *** Insertion Strings
1561 #insertion-strings
1563 With the command =ebib-insert-bibtex-key= or with the command key =p= in the
1564 index buffer, you can insert a BibTeX key into a LaTeX buffer. This option
1565 allows you to customise the string that Ebib inserts in the buffer.
1567 In fact, it is possible to define multiple strings. Each string must be
1568 numbered: this number provides a way to identify the string that you want
1569 to use. You can select the desired string by calling =ebib-insert-bibtex-key=
1570 or by hitting =p= with a numeric prefix argument corresponding to the string.
1572 Each string *must* contain a =%s= directive, which is replaced with the BibTeX
1573 key. For example, it is possible to define the following:
1575 <example>
1576 0:  {%s}
1577 1:  \cite{%s}
1578 2:  \nocite{%s}
1579 </example>
1581 With this, typing =M-2 M-x ebib-insert-bibtex-key=, followed by a BibTeX key
1582 inserts the command <verb>\nocite{<key>}</verb> into the current
1583 buffer. Typing =M-2 p= in the index buffer does the same for the LaTeX buffer
1584 you choose. (Note that the prefix argument also works when you have bound
1585 =ebib-insert-bibtex-key= to a key sequence. That is, if you have bound it to
1586 say =C-c b=, typing =M-2 C-c b= inserts the second string.)
1588 Even if you have specified multiple strings, you can still use
1589 =ebib-insert-bibtex-key= or hit =p= without prefix argument. In that case, Ebib
1590 just inserts string number 1. Note that if you define only one custom
1591 string, it still needs to be numbered. Give it number 1, so that you can
1592 enter it without prefix argument.
1594 The default value of this option is =((0 . "%s") (1 . "\cite{%s}"))=. With
1595 this setting, both =ebib-insert-bibtex-key= and =p= insert the key with the
1596 LaTeX command <verb>\cite</verb> by default, and they can furthemore be
1597 used with a prefix argument =0= (i.e. =M-0 ebib-insert-bibtex-key= or =M-0 p=) to
1598 insert just the bare key, without a <verb>\cite</verb> command.
1601 *** Sort Order
1603 The use of this option is explained above, see [[#sorting-bib-file][Sorting the .bib file]]. To
1604 create a sort order, click the =INS= button to create a sort level, and then
1605 click the =INS= button under that sort level to enter a sort field. If you
1606 want to add more than one sort field to the sort level, simply hit =INS=
1607 again.
1610 *** Save Xrefs First
1611 #save-xrefs-first
1613 For cross-referencing to work, the cross-referencing entries must appear in
1614 the =.bib= file *before* the cross-referenced entries. In order to tell Ebib to
1615 save all entries with a =crossref= field first, you must set the option =Save
1616 Xrefs First= in Ebib's customisation buffer. With this option set, BibTeX's
1617 crossreferencing options work as intended.
1619 By default, this option is unset, because it (marginally) slows down saving
1620 the =.bib= file somewhat.
1623 *** Crossref Face
1624 #crossref-face
1626 Field values inherited from a cross-referenced entry are marked with this
1627 face. By default, the face has red as foreground colour.
1630 *** Marked Face
1631 #marked-face
1633 When entries are marked (with =m=), they are highlighted in this face. By
1634 default, GNU Emacs uses the text property =highlight=. XEmacs only allows
1635 this on terminals, therefore it displays marked entries with a red
1636 background and a white foreground colour. This option allows you to change
1637 these defaults.
1640 *** Use Timestamp
1642 If this option is set, Ebib will add a =timestamp= field to every new entry,
1643 recording the date and time it was added to the database. See [[#timestamps][Timestamps]].
1646 *** Timestamp Format
1648 This option specifies the format string that is used to create the
1649 timestamp. The format string is used by =format-time-string= to create a time
1650 representation. The default value is ="%a %b %e %T %Y"=, which produces a
1651 timestamp of the form ="Mon Mar 12 01:03:26 2007"=. See the documentation for
1652 =format-time-string= for the forms that the format string can take.
1655 *** Standard Url Field
1656 #standard-url-field
1658 This is the field that Ebib searches for URLs if you press =u= in the index
1659 buffer. Its default value is =url=.
1662 *** Url Regexp
1663 #url-regexp
1665 This is the regular expression that Ebib uses to search for URLs in a
1666 field. The default value is:
1668 <example>
1669 \\url{\(.*\)}\|https?://[^ '<>\"\n\t\f]+
1670 </example>
1672 With this regular expression, Ebib considers everything that is in a LaTeX
1673 <verb>\url{...}</verb> command as a URL, and furthermore every string of
1674 text that starts with =http://= or =https://= and does not contain whitespace
1675 or one of the characters =' " <= or =>=.
1678 *** Browser Command
1679 #browser-command
1681 If this option is unset (which is the default), Ebib uses the Emacs
1682 function =browse-url= to start a browser. If this function does not exist,
1683 you can set this option. For example, if you use the Firefox browser, set
1684 this option to =firefox=.
1686 For this to work, the browser that you use must be able to handle a URL on
1687 the command line.
1690 *** Standard File Field
1691 #standard-file-field
1693 This is the field that Ebib searches for filenames if you press =f= in the
1694 index buffer. Its default value is =file=.
1697 *** File Associations
1698 #file-associations
1700 The programs used to view files. By default, programs for =.pdf= and =.ps=
1701 files are specified, which should be available on most linux systems. If
1702 you prefer other programs or are running on Windows, you'll can specify
1703 them here. Note that Ebib searches the PATH for the programs, but you can
1704 also specify full path names. Of course, it is also possible to add new
1705 associations.
1707 Note that GNU/Emacs 23 (as yet unreleased) comes with =doc-view-mode=, which
1708 provides a way to view =.pdf= and =.ps= files inside Emacs. (The files are
1709 converted to =.png= format first.) If you prefer to use this mode, simply
1710 leave the program field blank for the relevant file type.
1713 *** File Regexp
1714 #file-regexp
1716 In order to find files in an field, Ebib uses a regural expression. The
1717 default value is:
1719 <example>
1720   [^?|\:*<>\" \n\t\f]+
1721 </example>
1723 This essentially means that every string of characters not containing any
1724 of the characters <example>? | \ : * < > "</example> or space, newline, tab
1725 of formfeed. URLs can easily by recognised by the prefix =http:=, but
1726 recognising files is not so straightforward. It is therefore not advisable
1727 to put anything but filenames in the =file= field.
1730 *** File Search Dirs
1731 #file-search-dirs
1733 This is the list of directories that Ebib searches for files. Note that
1734 searching is not recursive: only the files listed here are searched, not
1735 their subdirectories.
1738 *** Print Preamble
1740 This option specifies the preamble that is to be added to the LaTeX file
1741 Ebib creates for printing the database (i.e., the =P= command). By default,
1742 the preamble is empty. You can set your own <verb>\usepackage</verb>
1743 commands, or anything else you may need.
1746 *** Print Multiline
1748 When this options is set, Ebib includes multiline field values when it
1749 creates a LaTeX file with =P= (=ebib-print-database=). When unset, multiline
1750 values are excluded, which saves space. By default, this option is unset.
1753 *** Latex Preamble
1755 This option specifies the preamble to be added to the LaTeX file for
1756 creating a list of references from the database (i.e., the =L= command). By
1757 default, the line <verb>\bibliographystyle{plain}</verb> is put in the
1758 preamble, but you may want to specify your own BibTeX packages and options.
1761 *** Print Tempfile
1763 This option specifies the name and location of the temporary file Ebib
1764 creates with the commands =ebib-print-database= and
1765 =ebib-latex-database=. By default, this option has no value,
1766 which means that Ebib will ask for a filename each time either of these
1767 commands is called.
1770 *** Allow Identical Fields
1771 #allow-identical-fields
1773 If this option is set, Ebib stores the values of multiple occurrences of a
1774 single field within an entry in a single occurrence of that field,
1775 separated by semicolons. By default, this option is unset, because it slows
1776 down the loading of =.bib= files. See [[#multiple-identical-fields][Multiple Identical Fields]].
1779 *** Entry Types
1780 #entry-types
1782 This option allows you to customise the entry types that Ebib uses. Each
1783 entry type has a name, a set of obligatory fields and a set of optional
1784 fields. You can add, alter or delete single fields in an entry type, or
1785 whole entry types.
1787 If you want to add an entry type, hit the =INS= key on the top level and give
1788 the new entry a name, then add obligatory and/or optional fields. It is not
1789 necessary that an entry type has both obligatory and optional fields, you
1790 can define an entry that has only obligatory or only optional fields.
1793 ** Modifying Key Bindings
1794 #modifying-key-bindings
1796 If you are unhappy about Ebib's standard key bindings, you can change them
1797 to anything you like. To do this, you have to create a file =~/.ebibrc= and
1798 write your preferred key bindings in it. A key binding definition is built
1799 up as follows:
1801 <example>
1802 (ebib-key <buffer> <key> <command>)
1803 </example>
1805 =<buffer>= is either =index=, =entry= or =strings=, for the corresponding
1806 buffer. =<key>= is a standard Emacs key description, and =<command>= is the
1807 Ebib command to be associated with the key. The commands that can be used
1808 here are listed in [[#ebib-buffers][The Ebib Buffers]]. Note that it is possible to bind more
1809 than one key to a single function: just add as many =ebib-key= statements as
1810 necessary.
1812 As an example, the following binds =C-s= to =ebib-search= in the index buffer,
1813 so that the database can be searched with =C-s= as well as with =/=:
1815 <example>
1816 (ebib-key index "\C-s" ebib-search)
1817 </example>
1819 If you want to unbind a key, you can simply leave out =<command>=. So if you
1820 want to bind the command =ebib-delete-entry= to =D= rather than =d=, you need to
1821 put the following in =.ebibrc=:
1823 <example>
1824 (ebib-key index "D" ebib-delete-entry)
1825 (ebib-key index "d")
1826 </example>
1828 The first line binds =D= to the command =ebib-delete-entry=. The second line
1829 unbinds =d=.
1831 If a command can be called with a prefix key (as for example
1832 =ebib-delete-entry= can), =ebib-key= will automatically rebind the prefixed
1833 version as well. So in the example above, the first line not only binds =D=,
1834 it also binds =; D=. Similarly, the second line not only unbinds =d=, but also
1835 =; d=.
1837 It is also possible to redefine the prefix key itself. To do this, you must
1838 specify =mark-prefix= for =<buffer>=. The value of =<command>= is irrelevant
1839 here, so it can be left out:
1841 <example>
1842 (ebib-key mark-prefix ":")
1843 </example>
1845 This sets up =:= as the new prefix key. Doing this automatically unbinds the
1846 existing prefix key.
1848 </div>