Fixed typo in manual.
[ebib.git] / manual / ebib-manual.muse
blobd085e4d46b9d4ad421611648a6266d9bda6b3eaf
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 regular 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, you
409 can call the function =ebib-insert-bibtex-key=. When you invoke this command,
410 Emacs prompts you for a key from the database(s) associated with the current
411 buffer, a citation command (that has to be typed *without* the backslash) and any
412 optional argument(s) the command allows. You can type the key using
413 TAB-completion, and after hitting =RET=, Emacs puts a BibTeX citation at the
414 cursor position in the current buffer with the key you selected.
416 You can also do it the other way around: if you're in the index buffer in Ebib,
417 you can *push* an entry to a LaTeX buffer. To do this, use the key =p=. Ebib will
418 ask you for a buffer to push the entry to, a citation command and also any
419 optional arguments, and then insert a citation at the current cursor position in
420 the buffer you've supplied.
422 The citation command that =ebib-insert-bibtex-key= and the command key =p= ask for
423 can be any command that you need. But it is also possible to predefine a list of
424 citation commands which you can then enter at this prompt using tab completion.
425 For details on setting this up, see [[#insertion-commands][Insertion Commands]].
427 There is another function that is available outside Ebib:
428 =ebib-entry-summary=. This command reads the key under the cursor in the
429 current buffer and displays the field values associated with that key in a
430 =*Help*= buffer. This allows you to quickly check a reference in a text.
432 Probably the easiest way to use both =ebib-insert-bibtex-key= and
433 =ebib-entry-summary= is to bind them to a key sequence. For example, you
434 could put the following in your =~/.emacs=:
436 <example>
437 (add-hook 'LaTeX-mode-hook #'(lambda ()
438           (local-set-key "\C-cb" 'ebib-insert-bibtex-key)))
439 </example>
441 This binds =C-c b= to the command =ebib-insert-bibtex-key= in AUCTeX's LaTeX
442 mode. (Note that commands of the form =C-c <letter>= are reserved for the
443 user, and should therefore not be set by any package. For this reasons,
444 Ebib does not set this command automatically.)
447 *** Consulting databases from within a LaTeX file
449 The commands =ebib-insert-bibtex-key= and =ebib-entry-summary= must consult the
450 database or databases loaded in Ebib, and Ebib tries to be smart about
451 which database(s) to consult. Usually, a LaTeX file has a =\bibliography=
452 command somewhere toward the end, which names the =.bib= file or files that
453 contain the bibliography entries. If you consult a BibTeX database from
454 within a LaTeX file, Ebib first looks for a =\bibliography= command, reads
455 the =.bib= files from it, and then sees if those files happen to be open. If
456 they are, Ebib uses them to let you pick an entry key (in the case of
457 =ebib-insert-entry-key=) or to search for the entry (in the case of
458 =ebib-entry-summary=).
460 Of course, it may be the case that the LaTeX file is actually part of a
461 bigger project, and that only the master file contains a =\bibliography=
462 command. To accommodate for this, Ebib checks whether the (buffer-local)
463 variable =TeX-master= is set to a filename. If it is, it reads that file and
464 tries to find the =\bibliography= command there. (Note: =TeX-master= is an
465 AUCTeX variable, which is used to keep track of multi-file projects. If you
466 don't use AUCTeX, this functionality doesn't work, and Ebib will only check
467 the current file for a =\bibliography= command.)
469 Note that if one of the =.bib= files in the =\bibliography= command isn't
470 loaded, Ebib issues a warning message about this, and continues to check
471 for the next =.bib= file. These warning messages appear in the minibuffer,
472 but are probably directly overwritten again by further messages or prompts
473 Ebib produces, so check the =*Messages*= buffer if Ebib doesn't seem to be
474 able to find an entry that you're sure is in one of your databases.
476 Another thing to keep in mind is that Ebib only looks for a =\bibliography=
477 command once: the first time either =ebib-insert-bibtex-entry= or
478 =ebib-entry-summary= is called. It stores the result of this search and uses
479 it the next time either of these commands is used. Therefore, if you make a
480 change to the =\bibliography= command, you must reload the file (use =M-x
481 revert-buffer=) to make sure Ebib rereads the =\bibliography= command.
483 If no =\bibliography= command is found at all, either in the LaTeX file
484 itself, or in the master file, Ebib simply consults the current database,
485 i.e. the database that was active when Ebib was lowered with =z=.
488 ** Cross-referencing
489 #cross-referencing
491 BibTeX has a cross-referencing facility. Suppose you have an entry =jones1998=,
492 which appeared in a book that is also in your database, say under =miller1998=.
493 You can tell BibTeX that =jones1998= is contained in =miller1998= by putting
494 =miller1998= in the =crossref= field. When BibTeX finds such a cross-reference, all
495 the fields of =jones1998= that don't have a value inherit their values from
496 =miller1998=. At the very least, this saves you some typing, but more importantly,
497 if two or more entries cross-reference the same entry, BibTeX automatically
498 includes the cross-referenced entry in the bibliography (and puts a reduced
499 reference in the cross-referencing entries).
501 When you fill in the =crossref= field in Ebib, Ebib displays the values of the
502 cross-referenced entry in the entry buffer. To indicate that they are just
503 inherited values, they are marked with =ebib-crossref-face=, which by default is
504 red. (You can customise it, of course. See the customisation option
505 [[#crossref-face][Crossref Face]].) These values are just displayed for convenience: otherwise, Ebib
506 treats these fields as if they are empty. That is, they cannot be edited (to
507 edit them, you need to edit the cross-referenced entry), and it's not possible
508 to copy these values to the kill ring.
510 If you're viewing an entry that has a cross-reference and you want to go to the
511 cross-referenced entry you can type =F=. This command reads the value of the
512 =crossref= field and then displays that entry. If you want to do the reverse,
513 i.e., see if the current entry is cross-referenced by any other entries, you can
514 use the key =N=. What this command actually does is to make the key of the current
515 entry the current search string and to search for its first occurrence *after* the
516 current entry. Like the normal search command =/=, =N= does not wrap and only
517 searches forward. So if you want to search for the next cross-referencing entry
518 you need to press =n= (i.e., lowercase =n=), and to continue searching from the
519 first entry, press =g= followed by =n=.
521 Note that if you want to use BibTeX's cross-referencing options, you need to set
522 the option [[#save-xrefs-first][Save Xrefs first]]. This tells Ebib to save all entries with a =crossref=
523 field first in the =.bib= file. Without this, BibTeX's cross-referencing will not
524 work reliably.
527 ** Printing the Database
528 #printing-database
530 Sometimes it may be useful to have a =.pdf= file or print-out of your
531 database. Although Ebib does not actually do the printing itself, it can
532 create a LaTeX file for you that you can compile and print. In fact, there
533 are two ways of doing this.
535 The first is the command =L=. This command creates a simple LaTeX document
536 that essentially contains a <verb>\nocite{*}</verb> command followed by a
537 <verb>\bibliography</verb> command referring to the =.bib= file belonging to
538 the current database. You can then run the usual sequence of LaTeX, BibTeX,
539 LaTeX, LaTeX on this file, creating a document containing a list of all the
540 references in your database.
542 The second command for printing a database is =P=. This command also creates
543 a LaTeX file. However, instead of simply providing a
544 <verb>\nocite{*}</verb> command, =P= creates a =tabular= environment for each
545 entry in the database listing all the fields of that entry and their
546 values.
548 The difference between =L= and =P= should be obvious: with =L=, you get a list of
549 references created by BibTeX. This means that the references look the way
550 they will when actually used in a document, but it also means that the list
551 only contains the information that BibTeX deems relevant.
553 With =P= you get an overview of your database with *all* the field values of
554 each entry, including the ones that BibTeX does not use. The entries are
555 not formatted as literature references, but in a way similar to how they
556 are shown in Ebib.
558 By default, =P= only shows single-line field values. That is, multiline
559 values are normally excluded. If you want to include multiline values in
560 the print-out, you have to set the option =Print Multiline= in Ebib's
561 customisation buffer. (See [[#customisation-buffer][The Customisation Buffer]].) With this option set,
562 Ebib will include all multiline values in the LaTeX file that =P=
563 creates. Note however that Ebib does not change anything about the
564 formatting of the text in a multiline value. So if you plan to make (heavy)
565 use of this option, make sure that the way you type your text conforms to
566 LaTeX's conventions (e.g. empty lines to mark paragraphs, etc.) and doesn't
567 contain any characters such as =&= that are illegal in LaTeX. (Or,
568 alternatively, use LaTeX code in your multiline fields.)
570 As mentioned, when you use either =L= or =P=, Ebib creates a LaTeX file. More
571 precisely, it creates a temporary buffer and writes the LaTeX code into it,
572 and then saves the contents of that buffer to a file. After it has done
573 that, Ebib lowers itself and instruct Emacs to open the file in a buffer,
574 which will then be properly set up as a LaTeX buffer. From there you can
575 run LaTeX and view the result.
577 Before doing all this, Ebib asks you which file to write to. Be careful
578 with this: since this is supposed to be a temporary file, Ebib simply
579 assumes that if you provide a filename of an existing file, it can
580 overwrite that file without warning!
582 A better way to tell Ebib which file to use is to set the option =Print
583 Tempfile= in Ebib's customisation buffer to some temporary file. When this
584 option is set, Ebib will always use this file to write to, and will not ask
585 you for a filename anymore when you type =L= or =P=.
587 There are two more customisation options for printing the database. These
588 are =Print Preamble= and =LaTeX Preamble=. With these options, you can specify
589 what Ebib should put in the preamble of the LaTeX files it creates. Use
590 this if you want to use specific packages
591 (e.g. <verb>\usepackage{a4}</verb> or
592 <verb>\usepackage{times})</verb>. This is especially useful for =L=, since by
593 default, Ebib uses BibTeX's standard bibliography style. With the option
594 =LaTeX Preamble= you can set your preferred bibliography style. Details are
595 discussed in the chapter on customisation, see [[#customisation-buffer][The Customisation Buffer]].
599 ** Marking Entries
601 Commands in the index buffer generally operate on one single entry, or on
602 all entries. For some, however, it may sometimes be useful to perform them
603 on more than one entry, but not necessarily all of them. This can be
604 achieved by marking entries. You can mark the entries you want to perform a
605 command on with the key =m=. This marks (or unmarks) the current
606 entry. Marked entries are displayed in inverse video (in GNU Emacs) or
607 white on red (in XEmacs; note that the face properties of marked entries
608 can be customised through the customisation option [[#marked-face][Marked Face]].)
610 Of the commands discussed so far, four can be used on marked entries: =d=, =p=,
611 =L= and =P=. Note, however, that it is not enough to mark the entries you want
612 and then type any of these commands. If you do so, they will behave as if
613 no entries were marked. To get these commands to work on the marked
614 entries, you have to type a semicolon before them. That is, =; d= deletes all
615 marked entries, and =; L= and =; P= create a LaTeX file of only the marked
616 entries. The command =m= itself can also be used with the =;= prefix. If there
617 are any marked entries, =; m= unmarks them all. Otherwise, =; m= marks all
618 entries.
620 =; p= pushes all marked entries to a LaTeX buffer. It does so by putting them
621 all in a single =\cite= command, separated by commas, not by putting them in
622 separate =\cite= commands.
625 ** Calling a Browser
627 With more and more scientific literature becoming available on-line, it
628 becomes common to store URLs in a BibTeX database. Sometimes you may want
629 to load such a URL in your browser. Ebib provides a convenient way for
630 doing so.
632 If you type =u= in the index buffer, Ebib takes the first URL stored in the
633 =url= field of the current entry and passes it to your browser. Furthermore,
634 in the entry buffer, you can use =u= on *any* field. If you happen to have more
635 than one URL stored in the relevant field, and you want to pass the second
636 (or third, etc.) to the browser, you can use a prefix argument. So typing
637 =M-2 u= sends the second URL to your browser, =M-3 u= the third, and so on.
639 It is not even necessary that the relevant field contains *only* URLs. It may
640 contain other text mixed with the URLs: Ebib simply searches the URLs in
641 the field and ignores the rest of the text. Ebib considers every string of
642 characters that starts with =http://= or =https://= and that does not contain
643 whitespace or any of the characters =" ' <= or =>= as a URL. Furthermore, Ebib
644 regards everything that is enclosed in a LaTeX <verb>\url{...}</verb>
645 command as a URL. This behaviour is controlled by a regular expression that
646 can be customised. (See [[#url-regexp][Url Regexp]].)
648 There exists an Emacs function =browse-url=, which provides a nifty interface
649 to calling an external browser. In principle, Ebib uses this
650 function. However, if this function is not present on your installation,
651 you can set the option [[#browser-command][Browser Command]] to call the browser.
653 As just explained, if you press =u= in the index buffer, Ebib searches the
654 =url= field of the current entry for URLs. If you have the habit of putting
655 your URLs in another field, however, you may change the customisation
656 option [[#standard-url-field][Standard Url Field]] and tell Ebib to use another field for searching
657 the URLs. (Keep in mind, though, that in the entry buffer, you can load a
658 URL from any field.)
661 ** Viewing Files
663 If you have electronic versions of the papers in your database stored on
664 your computer, you can use Ebib to call external viewers for these
665 files. The interface for this is similar to that for calling a browser: if
666 you press =f= in the index buffer, Ebib searches the =file= field for a
667 filename and when it finds one, calls an appropriate viewer.
669 Just as with =u=, you can use =f= in the entry buffer as well, in which case it
670 can be used on any field, not just the =file= field. It is also possible to
671 have more than one filename in a field: you can select the one you want to
672 view with the prefix argument.
674 Just as in the case of URLs, you can customise several things about the
675 file view functionality. The option [[#standard-file-field][Standard File Field]] allows you to
676 customise the field that =f= extracts filenames from when pressed in the
677 index buffer. Extracting filenames is done with a regular expression, which
678 can be customised through the option [[#file-regexp][File Regexp]].
680 The option [[#file-search-dirs][File Search Dirs]] allows you to tell Ebib which directories it
681 needs to search for files. The default value is =~=, which means Ebib just
682 looks in your home dir. Since this is probably not where you keep your
683 files, you may want to customise this. Note that you can specify more than
684 one directory.
686 Note that Ebib does not search directories recursively. It is possible,
687 however, to put subdirectories in the filenames. That is, if you put
688 something like =a/abney1987.pdf= in the =file= field, Ebib searches for the
689 relevant file in a subdirectory =a/= of the directories listed in the option
690 =File Search Dirs=. (Note that if you want to do this under Windows, you may
691 want to remove the backslash from the file regexp.)
693 Ebib can call different external programs depending on the file type of the
694 relevant file, but you have to specify which programs to call. The option
695 [[#file-associations][File Associations]] allows you to do this. By default, =.pdf= and =.ps= files are
696 handled, by =xpdf= and =gv=, respectively. You can specify further file types by
697 their extensions (do not include the dot). The program is searched for in
698 =PATH=, but you can of course specify the full path to the program.
701 * Advanced Features
703 The features discussed in the previous chapter should be sufficient to get
704 started using Ebib. However, Ebib has several more advanced features, which
705 are described in this chapter.
708 ** Screen Layout
709 #screen-layout
711 By default, Ebib takes over the entire Emacs frame it is started in. If you
712 have a wide enough screen, however, it may be more convenient to have Ebib
713 take up only part of the frame, so that you can have the LaTeX text you're
714 working on and Ebib visible at the same time. The option [[#layout][Layout]] allows you
715 to do this, by giving you the ability to choose between a full-frame or a
716 split-frame layout.
718 In the split-frame layout, the Ebib windows are displayed on the right of
719 the current frame, with the left part free for your document. In this
720 layout, some aspects of Ebib behave somewhat differently. Most importantly,
721 the multiline edit buffer is not displayed in the lower Ebib window, but in
722 the non-Ebib window on the left. (Obviously, after leaving the multiline
723 edit buffer, the original buffer is restored to that window.)
725 Furthermore, pressing =z= in the index buffer leaves Ebib, but keeps the
726 buffers visible. You can get back to Ebib with the command =M-x ebib= (or any
727 key bound to it, of course), or simply by manually switching to the index
728 buffer. If you want to remove the Ebib buffers from the frame but keep Ebib
729 in the background, you can use =Z= (i.e. capital =Z=) in the index
730 buffer. (Note that =Z= is also available in the full-frame layout, but there
731 it is identical to =z=.)
733 Lastly, the command =ebib-entry-summary= checks whether the Ebib buffers are
734 visible in the frame. If they are, it does not output the entry info in a
735 =*Help*= buffer, but rather displays the entry in Ebib itself.
738 ** Preloading =.bib= Files
740 Chances are that you will be doing most of your work with one or a few =.bib=
741 files, and you may find yourself opening the same file or files every time
742 you start Ebib. If so, you can tell Ebib to always load specific =.bib= files
743 on startup. To do this, specify the files in Ebib's customisation buffer,
744 under the option [[#preload-bib-files][Preload Bib Files]].
747 ** =@Preamble= Definition
749 Apart from database entries, BibTeX allows three more types of elements to
750 appear in a =.bib= file. These are =@comment=, =@preamble= and =@string=
751 definitions. Ebib provides facilities to handle the latter two. =@comment=
752 definitions cannot be added to a =.bib= file through Ebib, and if Ebib finds
753 one in a =.bib= file, it is simply ignored.
755 =@preamble= and =@string= definitions can be handled, however. Ebib allows you
756 to add one =@preamble= definition to the database.  In principle, BibTeX
757 allows more than one such definition, but really one suffices, because you
758 can use the concatenation character =#= to include multiple TeX or LaTeX
759 commands. So, rather than having two =@preamble= definitions such as:
761 <example>
762 @preamble{ "\newcommand{\noopsort}[1]{} " }
763 @preamble{ "\newcommand{\singleletter}[1]{#1} " }
764 </example>
766 <literal style="texinfo">@noindent</literal>you can write this in your =.bib=
767 file:
769 <example>
770 @preamble{ "\newcommand{\noopsort}[1]{} "
771          # "\newcommand{\singleletter}[1]{#1} " }
772 </example>
774 Creating or editing a =@preamble= definition in Ebib is done by hitting =r= in
775 the index buffer. Ebib uses the multiline edit buffer for editing the text
776 of the =@preamble= definition, which means that as discussed above, =C-x b=
777 stores the =@preamble= text and returns focus to the index buffer, while =C-x
778 k= returns focus to the index buffer while abandoning any changes you may
779 have made. (For details on using the multiline edit buffer, see
780 [[#multiline-edit-buffer][The Multiline Edit Buffer]].)
782 In order to create a =@preamble= as shown above in Ebib, you only have to
783 type the text between the braces.  Ebib takes care of including the braces
784 of the =@preamble= command, but otherwise it saves the text exactly as you
785 enter it. So in order to get the preamble above, you'd have to type the
786 following in Ebib:
788 <example>
789 "\newcommand{\noopsort}[1]{} "
790 # "\newcommand{\singleletter}[1]{#1} "
791 </example>
793 Note that when Ebib loads a =.bib= file that contains more than one =@preamble=
794 definition, it concatenates all the strings in them in the manner just
795 described and saves them in one =@preamble= definition.
798 ** =@String= Definitions
800 If you press =t= in the index buffer, Ebib hides the entry buffer in the
801 lower window and replaces it with the *strings buffer*. In this buffer, you
802 can add, delete and edit =@string= definitions.
804 Adding a =@string= definition is done with the command =a=. This will first ask
805 you for an abbreviation and then for the value to be associated with that
806 abbreviation. Once you've entered these, Ebib will sort the new
807 abbreviation into the buffer.
809 Moving between the =@string= definitions can be done in the usual way: the
810 cursor keys =up= and =down=, =C-p= and =C-n= and =k= and =j= move up and down. =Space=
811 and =PgDn= move ten strings down, while =b= and =PgUp= move in the other
812 direction. The keys =g=, =G=, =Home= and =End= also function as expected.
814 To delete a =@string= definition, use =d=. To edit the value of a definition,
815 use =e=. There is also a command =c=, which copies the value of the current
816 =@string= definition to the kill ring. Unlike in the entry buffer, there are
817 no corresponing commands =y= and =x=. (In fact, =x= does exist, but has another
818 function.) Yanking from the kill ring can be done with =C-y/M-y= in the
819 minibuffer when you edit a =@string='s value. Cutting a =@string='s value
820 is pointless, because a =@string= definition must have a value.
822 Having defined =@string= definitions, there must of course be a way to use
823 them. Just giving a field a string abbreviation as value will not do,
824 because Ebib puts braces around the value that you enter when it writes the
825 =.bib= file, so that BibTeX will not recognise the abbreviation, and will not
826 expand it. BibTeX will only recognise an abbreviation if it appears in the
827 =.bib= file outside of any braces.
829 To accomplish this, you must mark a field's value as *raw*. A raw field is a
830 field whose value is not surrounded by braces when the database is saved,
831 so that BibTeX recognises it as an abbreviation. To mark a field raw, press
832 =r=. An asterisk will appear before the field, indicating that it is
833 raw. Pressing =r= again will change the field back to normal. If you press =r=
834 on a field that does not have a value yet, Ebib will ask you for one.
836 Note that this also makes it possible to enter field values that are
837 composed of concatenations of strings and abbreviations. The BibTeX
838 documentation for example explains that if you have defined:
840 <example>
841 @string{WGA = "World Gnus Almanac"}
842 </example>
844 <literal style="texinfo">@noindent</literal>you can create a BibTeX field
845 like this:
847 <example>
848 title = 1966 # WGA
849 </example>
851 <literal style="texinfo">@noindent</literal>which will produce ``1966 World
852 Gnus Almanac''. Or you can do:
854 <example>
855 month = "1~" # jan
856 </example>
858 <literal style="texinfo">@noindent</literal>which will produce someting
859 like ``1 January'', assuming your bibliography style has defined the
860 abbreviation =jan=. All this is possible with Ebib, simply by entering the
861 exact text including quotes or braces around the strings, and marking the
862 relevant field as raw.
864 An easy way to enter a =@string= abbreviation as a field value is to use the
865 key =s= instead of =e=. If you type =s=, Ebib asks you for a =@string= abbreviation
866 to put in the current field, and automatically marks the field as raw. With
867 this command, Ebib only accepts =@string= definitions that are in the
868 database, so that by using =s= you can make sure you don't make any
869 typos. Note that you can use tab completion to complete a partial string.
872 ** Sorting the =.bib= file
873 #sorting-bib-file
875 By default, the entries in the database are saved to the =.bib= file in
876 alphabetical order according to entry key. If you only deal with the =.bib=
877 file through Ebib, you may not care in which order the entries are
878 saved. However, it may sometimes be desirable to be able to specify the
879 sort order of entries in more detail. (Apparently, this can be useful with
880 ConTeXt, for example.)
882 You can specify a sort order in Ebib's customisation buffer. To sort the
883 entries, you must set at least one sort level (that is, a field to sort the
884 entries on). You can also specify more than one sort level: if two entries
885 have identical values for the first sort level, they will be sorted on the
886 second sort level. E.g., if the first sort level is =author= and the second
887 is =year=, then the entries are sorted by author, and those entries that have
888 identical values for the =author= field are sorted by year.
890 A sort level is not restricted to a single field. You can specify more
891 fields for a single sort level. Within a single sort level, a second sort
892 field is used if the first sort field does not have a value. For example,
893 books that have an editor instead of an author will have an empty =author=
894 field. If you sort the database on the =author= field, such entries will all
895 appear at the beginning of the =.bib= file, which is most likely not what you
896 want.
898 To remedy this, you can specify both the =author= and the =editor= fields for
899 the first sort level. Ebib will then sort an entry on its =author= field if
900 it has a value, and will otherwise use the value of the =editor= field.
902 The difference between two sort fields within one sort level and two sort
903 levels is that a second sort *field* is an alternative for the first field
904 when it has no value, while a second sort *level* is an additional sort
905 criterion when two or more entries cannot be sorted on the first level,
906 because they have identical values.
908 By default, the option =Sort Order= has no value, which means that the
909 entries in the =.bib= file are sorted according to entry key. Those that wish
910 to customise the sort order will usually want to set the first sort level
911 to =author editor=, and the second to =year=. In that way, the entries in the
912 =.bib= file are sorted according to author/editor, and entries with the same
913 author/editor are sorted by year.
915 Entries that cannot be sorted on some sort level, because the sort fields
916 are empty, are sorted on entry key. (Keep in mind that if the first sort
917 level yields *no value* for a specific entry, Ebib does *not* use the second
918 sort level to sort that entry. It uses the entry key. The second sort level
919 is only used if the first yields *identical* values for two or more entries.)
921 Note that if you have set the option =Save Xrefs First= (see
922 [[#cross-referencing][Cross-referencing]]), it is pointless to set a sort order. Saving
923 cross-referencing entries first messes up any sort order, so Ebib simply
924 ignores the sort order if =Save Xrefs First= is set.
927 ** Merging and Importing
929 As described in the previous chapter, adding entries to a database can be
930 done manually with the key =a=. There are other ways of adding entries to a
931 database, however.
933 With the command =M= you can merge a second =.bib= file into your current
934 database. When you hit =M=, you are asked for a filename. Ebib then reads the
935 entries in this file and adds them to the database. Duplicate entries (that
936 is, entries with an entry key that already exists in the database) will not
937 be loaded. Ebib logs a warning about each duplicate entry to its log
938 buffer, and displays a warning after loading the =.bib= file when this
939 happens.
941 Another way to add entries to a database is to import them from an Emacs
942 buffer. If, for example, you find ready-formatted BibTeX entries in a text
943 file or e.g. on the internet, you can copy & paste them to any Emacs buffer
944 (e.g. the =*scratch*= buffer), and then execute the command =M-x
945 ebib-import=. Ebib then goes through the buffer and loads all BibTeX entries
946 it finds into the current database (i.e. the database that was active when
947 you lowered Ebib). If you call =ebib-import= while the region is active, Ebib
948 only reads the BibTeX entries in the region.
951 ** Exporting Entries
953 Sometimes it can be useful to copy entries from one database to another, or
954 to create a new =.bib= file with several entries from an existing
955 database. For this purpose, Ebib provides exporting facilities. To export
956 an entry to a =.bib= file, use the command =x=. Ebib will ask you for a
957 filename to export the entry to. (If you have already exported an entry
958 before, Ebib will present the filename you used as default, but you can of
959 course change it.)
961 For obvious reasons, Ebib appends the entry to the file that you enter if
962 it already exists, it does not overwrite the file. If this is not what you
963 want, delete the file first, as Ebib provides no way to do this.
965 If you have more than one database open in Ebib, it is also possible to
966 copy entries from one database to another. To do this, use the =x= command
967 with a numeric prefix argument. E.g., if the database you want to export an
968 entry to is the second database, type =M-2 x= to export the current entry to
969 it. The number of the database is given in the modeline of the index
970 buffer.
972 If the database you're copying an entry to already contains an entry with
973 the same entry key, Ebib won't copy the entry, and issues an appropriate
974 warning message.
976 Note that the command =x= can operate on marked entries. So to export several
977 entries in one go mark them and type =; x=. You can use a prefix argument in
978 the normal way: =M-2 ; x= exports the marked entries to database 2.
980 Apart from entries, it is also possible to export the =@preamble= and =@string=
981 definitions. The =@preamble= definition is exported with the command =X= in the
982 index buffer. =@string= definitions can be exported in the strings buffer: =x=
983 in this buffer exports the current string, while =X= exports all =@string=
984 definitions in one go. All these commands function in the same way: when
985 used without a prefix argument, they ask for a filename, and then append
986 the relevent data to that file. With a numeric prefix argument, they copy
987 the relevant data to the corresponding open database.
990 ** Timestamps
991 #timestamps
993 Ebib provides the possibility to add a timestamp to every new entry,
994 recording the time it was added to the database. The timestamp is recorded
995 in the (additional) field =timestamp=. (By default, this field is not shown,
996 but you can make it visible by pressing =H= in the index buffer.)
998 You can tell Ebib to create timestamps by setting the option =Use Timestamp=
999 in Ebib's customisation buffer. With this option set, a timestamp is
1000 included in entries added to the database with =a=. Ebib will also add a
1001 timestamp to entries imported from a buffer or merged from a file, and to
1002 entries exported to another database or to a file. When importing or
1003 exporting entries, existing timestamps will be overwritten. The logic
1004 behind this is that the timestamp records the date and time when the entry
1005 was added to the database, not when it was first created.
1007 Note that if this option is unset, the timestamp of an entry is retained
1008 when it's imported or exported. Therefore, if you record timestamps and
1009 want to im-/export entries without changing their timestamps, temporarily
1010 unset this option.
1012 Ebib uses the function =format-time-string= to create the timestamp. The
1013 format string that Ebib uses can be customised in Ebib's customisation
1014 buffer. The default string is ="%a %b %e %T %Y"=, which produces a timestamp
1015 of the form ="Mon Mar 12 01:03:26 2007"=. Obviously, this string is not
1016 suited for sorting, so if you want to be able to sort on timestamps, you'll
1017 need to customise the format string. See the documentation for
1018 =format-time-string= on the options that are available.
1021 ** Multiple Identical Fields
1022 #multiple-identical-fields
1024 Under normal circumstances, a BibTeX entry only contains one occurrence of
1025 each field. If BibTeX notices that an entry contains more than one
1026 occurrence of an obligatory or optional field, it issues a warning. Ebib is
1027 somewhat less gracious, it simply takes the value of the last occurrence
1028 without giving any warning. (Note, by the way, that BibTeX will use the
1029 value of the *first* occurrence, not the last.) When additional fields appear
1030 more than once in an entry, BibTeX does not warn you, since it ignores
1031 those fields anyway. Here, too, Ebib's standard behaviour is to ignore all
1032 but the last value.
1034 However, some online reference management services ``use'' this feature of
1035 BibTeX in that they put multiple =keywords= fields in the BibTeX entries that
1036 they produce. If you were to import such an entry into Ebib, you would lose
1037 all your keywords except the last one. To remedy this, you can tell Ebib
1038 that it should allow multiple occurrences of a single field in a BibTeX
1039 entry. You can do this by setting the customisation option
1040 [[#allow-identical-fields][Allow Identical Fields]].
1042 With this option set, Ebib collapses the multiple occurrences into a single
1043 occurrence. All the values of the different occurrences are collected and
1044 stored in the single occurrence, separated by semicolons. That is, Ebib
1045 does not retain the multiple occurrences, but it does retain the values. So
1046 suppose you have an entry that contains the following =keywords= fields:
1048 <example>
1049 @book{jones1998,
1050     author = {Jones, Joan},
1051     year = {1998},
1052     ...
1053     keywords = {sleep},
1054     keywords = {winter},
1055     keywords = {hybernation}
1057 </example>
1059 If you load this entry into Ebib with the option =Allow Identical Fields=
1060 set, you will get the following:
1062 <example>
1063 @book{jones1998,
1064     author = {Jones, Joan},
1065     year = {1998},
1066     ...
1067     keywords = {sleep; winter; hybernation}
1069 </example>
1072 ** Virtual Databases
1073 #virtual-databases
1075 In the previous chapter, Ebib's basic search functionality was
1076 discussed. (See [[#searching][Searching]].) Ebib also provides a much more sophisticated
1077 search and filtering mechanism in the form of *virtual databases*.
1079 A virtual database is a database that is not associated with any =.bib=
1080 file. Rather, it is created from another database by selecting entries from
1081 it based on a specific search pattern, called a *filter*. This allows you,
1082 for example, to select all entries from a database that contain the string
1083 ``Jones'' in their =author= field. A filter can be as complex as you want:
1084 you can select all entries that do *not* contain ``Jones'' in the =author=
1085 field, or all entries that contain ``Jones'' in either the =author= or the
1086 =editor= field, or all entries that contain ``Jones'' in the =author= field,
1087 and ``symbiotic hybernation'' in the =keyword= field, etc. Basically, the
1088 filter can consist of an arbitray number of search criteria combined with
1089 the logical operators =and, or= and =not=.
1092 *** Simple Selection
1094 Creating a virtual database is simple: press =&=, and Ebib will ask you for a
1095 field to select on, and for a regular expression to select with. So if you
1096 want to select all entries that contain ``Jones'' in the =author= field, you
1097 press =&= and type =author= as the field and =Jones= as the regexp to filter on.
1099 Ebib will then create a virtual database containing the entries matching
1100 your selection criterion. A virtual database has the same name as the
1101 database it is based on, prepended with =V:=. It also has a number like any
1102 other database, and you can move back and forth to other databases with the
1103 number or cursor keys.
1105 If you don't want to filter on one specific field but rather want to select
1106 all entries that match a certain regexp in any field, you can type =any= as
1107 the field to filter on. So specifying =any= as the field and =Jones= as the
1108 regexp, the virtual database will select all entries that have a field that
1109 contains ``Jones'' in them.
1112 *** Complex Filters
1114 Once you have a virtual database, it remains associated with the database
1115 it was created from. This means that you can refine or extend the selection
1116 (i.e. the filter) that the virtual database is based on. If, in the current
1117 example, you want to include all the entries that have ``Jones'' in the
1118 =editor= field, you have to perform a logical =or= operation: you want to
1119 select an entry if it contains ``Jones'' in the =author= field (which you
1120 already did) *or* if it contains ``Jones'' in the =editor= field.
1122 A short sidenote: the first impulse in a case like this might be to use =and=
1123 instead of =or=: after all, you want to select all entries that contain
1124 ``Jones'' in the =author= field *and* all entries that contain ``Jones'' in the
1125 =editor= field. However, the filter that you build up is used to test each
1126 entry *individually* whether it meets the selection criterion. An entry meets
1127 the criterion if it contains ``Jones'' in the =author= field *or* if it
1128 contains ``Jones'' in the =editor= field. Therefore, =or= is the required
1129 operator in this case. If you would use =and=, you would only get those
1130 entries that contain ``Jones'' in both the =author= *and* =editor= fields.
1132 To perform a logical =or= operation, press the key =|=. As before, you will be
1133 asked which field you want to filter on, and which regexp you want to
1134 filter with. Ebib will then update the virtual database with all entries in
1135 the original database that match the additional criterion.
1137 It is also possible to perform a logical =and= on the virtual database. Use
1138 this if you want to select those entries that contain ``Jones'' in the
1139 =author= field and e.g. ``symbiotic hybernation'' in the =keyword= field. A
1140 logical =and= operation is done with the key =&=. (Note: this is the same key
1141 that is used to create a virtual database. In fact, you can also create a
1142 virtual database with =|=: when used in a normal database, =&= and =|= are
1143 equivalent. They are only different in virtual databases.)
1145 Both the =&= and =|= commands can be used with the negative prefix argument =M--=
1146 (or =C-u -=, which is identical). In this case, the search criterion is
1147 negated. That is, the negative prefix argument performs a logical =not=
1148 operation on the search criterion.
1150 That is, if you want to select all entries from a database that do *not*
1151 contain ``Jones'' in the =author= field, you can do this by typing =M-- &= and
1152 then filling out the relevant field and regexp. This prefix argument is
1153 available both in real and in virtual databases.
1155 There is another way of performing a logical =not= operation, which is only
1156 available in virtual databases: by pressing the key =~=, you invert the
1157 current filter. That is, if you have a virtual database with all the
1158 entries containing ``Jones'' in the =author= or in the =editor= field, and you
1159 press =~=, the selection is inverted, and now contains all entries that do
1160 *not* have ``Jones'' in the =author= or =editor= field.
1162 Although =~= and the negative prefix argument to =&= or =|= both perform logical
1163 =not= operations, they are *not* equivalent: =~= negates the entire filter built
1164 up so far, while the negative prefix argument only negates the single
1165 selection criterion you enter with it.
1167 If you want to know what the filter for the current virtual database is
1168 exactly, you can type =V=. This command displays the current filter in the
1169 minibuffer. The filter is specified as a Lisp expression, meaning that the
1170 operators appear before their operands, not in between them. That is, =x and
1171 y= is written as =(and x y)=.
1173 With a prefix argument (any prefix argument will do), the command =V= not
1174 only displays the current filter, but also reapplies it. This can be useful
1175 when you've made changes to the source database: Ebib does not
1176 automatically update a virtual database when its source database is
1177 modified.
1180 *** Properties of Virtual Databases
1182 Virtual databases differ from normal databases in several ways. First, they
1183 cannot be modified: you cannot add or delete entries, and you cannot modify
1184 the contents of fields. It is also not possible to import entries to them
1185 or merge another file with them. Furthermore, it is not possible to export
1186 entries to them or from them.
1188 A virtual database cannot be saved in the normal way with =s=, and the
1189 command =S= to save all databases ignores virtual databases. If you want to
1190 save a virtual database, you can use the command =w=. This command not only
1191 saves the virtual database, it also changes it into a normal database, and
1192 detaches it from its original source database, so that you can modify it
1193 without affecting the source database.
1195 The command =L= also doesn't work with virtual databases. The reason for this
1196 is that the virtual database is not associated with an actual =.bib= file, so
1197 there is no file to create a list of references from. However, it is
1198 possible to use the command =P= with a virtual database to create a list of
1199 entries. See [[#printing-database][Printing the Database]], for details on these two commands.
1202 ** The Multiline Edit Buffer
1203 #multiline-edit-buffer
1205 As mentioned several times before, Ebib has a special multiline edit
1206 buffer, which is used to edit field values that contain newlines (so-called
1207 *multiline fields*), and also to edit the contents of the =@preamble=
1208 command. This section discusses the details of this buffer.
1210 Ebib enters multiline edit mode in one of three cases: when you press =P= in
1211 the index buffer, to edit the =@preamble= definition, when you hit =l= in the
1212 entry buffer to edit the current field as multiline, or when you hit =e= on
1213 the =annote= field, or on a field whose value already is multiline.
1215 The multiline edit buffer uses a special major mode,
1216 =ebib-multiline-edit-mode=, which is derived from =text-mode=. The changes with
1217 respect to =text-mode= are minor (see below), which means that any
1218 customisations you may have made to =text-mode= will be available in the
1219 multiline edit buffer.
1221 The settings that are specific for =ebib-multiline-edit-mode= are the
1222 functions assigned to the key sequences =C-x b=, =C-x k= and =C-x C-s=. These key
1223 sequences do not have their usual functions, but rather are redefined to
1224 fit Ebib. Both =C-x b= and =C-x k= can be used to leave the multiline edit
1225 buffer. =C-x b= will store the text as it is to the database, while =C-x k=
1226 leaves the multiline edit buffer *without* storing the text, i.e., the
1227 original value of the field or preamble that you were editing is
1228 retained. If the text in the buffer was modified, =C-x k= asks you if you
1229 really want to abandon your changes.
1231 If you leave the multitiline edit buffer with =C-x b= when the buffer is
1232 empty (i.e., you deleted all the text, including the final newline), and
1233 you were editing a field value or the =@preamble= definition, the field value
1234 or preambleis deleted. (This is in fact the *only* way to delete the
1235 =@preamble= definition. Field values on the other hand can also be deleted by
1236 hitting =x= or =d= on them in the entry buffer.)
1238 The third command that is redefined in the multiline edit buffer is =C-x
1239 C-s=. This command can be used to save the database. Because Ebib does not
1240 do an autosave of the current database, it is advisable to save the
1241 database manually every now and then to prevent data loss in case of
1242 crashes. It would be annoying to have to leave the multiline edit buffer
1243 every time you want to do this, so =C-x C-s= has been redefined to allow you
1244 to do this from within the buffer.
1247 * The Ebib Buffers
1248 #ebib-buffers
1250 This chapter lists all the key commands that exist in Ebib, with a short
1251 description and the actual command that they call. The latter information
1252 is needed if you want to customise Ebib's key bindings. (See
1253 [[#modifying-key-bindings][Modifying Key Bindings]].)
1257 ** The Index Buffer
1259   =Up= :: go to previous entry. =(ebib-prev-entry)=
1261   =Down= :: go to next entry. =(ebib-next-entry)=
1263   =Right= :: move to the next database. =(ebib-next-database)=
1264   
1265   =Left= :: move to the previous database. =(ebib-prev-database)=
1267   =PgUp= :: scroll the index buffer down. =(ebib-index-scroll-down)=
1269   =PgDn= :: scroll the index buffer up. =(ebib-index-scroll-up)=
1270   
1271   =Home= :: go to first entry. =(ebib-goto-first-entry)=
1273   =End= :: go to last entry. =(ebib-goto-last-entry)=
1275   =Return= :: make the entry under the cursor current. Use after e.g. =C-s=.
1276 =(ebib-select-entry)=
1277   
1278   =Space= :: equivalent to =PgDn=.
1279   
1280   =1-9= :: jump to the corresponding database.
1282   =/= :: search the database. =(ebib-search)=
1283   
1284   =&= :: Create a virtual database, or perform a logical =and= on the current
1285 virtual database. With negative prefix argument: apply a logical =not= to the
1286 selectional criterion. =(ebib-virtual-db-and)=
1288   =|= :: Create a virtual database, or perform a logical =or= on the current
1289 virtual database. With negative prefix argument: apply a logical =not= to the
1290 selectional criterion. =(ebib-virtual-db-or)=
1292   =~= :: Perform a logical =not= on the current virtual
1293 database. =(ebib-virtual-db-not)=
1295   =a= :: add an entry. =(ebib-add-entry)=
1297   =b= :: equivalent to =Pgup=.
1299   =c= :: close the database. =(ebib-close-database)=
1300   
1301   =C= :: customise Ebib. =(ebib-customize)=
1303   =d= :: delete the current entry. =(ebib-delete-entry)=
1305   =; d= :: delete all marked entries.
1307   =e= :: edit the current entry. =(ebib-edit-entry)=
1308   
1309   =E= :: edit the key of the current entry. =(ebib-edit-keyname)=
1311   =f= :: extract a filename from the =file= field and send it to an
1312 appropriate viewer. With numeric prefix argument, extract the *n*-th
1313 filename.
1315   =F= :: follow =crossref= field. =(ebib-follow-crossref)=
1317   =g= :: equivalent to =Home=.
1319   =G= :: equivalent to =End=.
1321   =H= :: show/hide hidden fields. =(ebib-toggle-hidden)=
1323   =j= :: equivalent to =Down=.
1325   =J= :: jump to another database. This accepts a numeric prefix argument,
1326 but will ask you for a database number if there is
1327 none. =(ebib-switch-to-database)=
1329   =k= :: equivalent to =Up=.
1331   =l= :: show the log buffer. (=ebib-show-log=)
1333   =L= :: create a LaTeX file from the current database that produces a list
1334 of references formatted by BibTeX. =(ebib-latex-database)=
1336   =; L= :: create a LaTeX file with the marked entries only.
1338   =m= :: mark (or unmark) the current entry. =(ebib-mark-entry)=
1340   =; m= :: unmark all marked entries.
1342   =M= :: merge a =.bib= file. =(ebib-merge-bibtex-file)=
1343   
1344   =n= :: find next occurrence of the search string. =(ebib-search-next)=
1346   =N= :: search for entries cross-referencing the current one. =(ebib-search-crossref)=
1348   =C-n= :: equivalent to =Down=.
1350   =M-n= :: equivalent to =PgDn=.
1351   
1352   =o= :: open a =.bib= file. =(ebib-load-bibtex-file)=
1354   =p= :: push an entry to a LaTeX buffer =(ebib-push-bibtex-key)=
1356   =; p= :: push the marked entries to a LaTeX buffer.
1358   =C-p= :: equivalent to =Up=.
1360   =M-p= :: equivalent to =PgUp=.
1362   =P= :: create a LaTeX file for printing the database, listing the entire
1363 contents of each entry. =(ebib-print-database)=
1365   =; P= :: create a LaTeX file with the marked entries.
1367   =r= :: show and edit the =@preamble= definition in the
1368 database. =(ebib-edit-preamble)=
1370   =q= :: quit Ebib. This sets all variables to nil, unloads the database(s)
1371 and quits Ebib. =(ebib-quit)=
1373   =s= :: save the database. =(ebib-save-current-database)=
1375   =S= :: save all modified databases. =(ebib-save-all-databases)=
1377   =t= :: show and edit the =@string= definitions in the
1378 database. =(ebib-edit-strings)=
1380   =u= :: extract a URL from the =url= field and send it to a browser. With
1381 numeric prefix argument, extract the *n*-th url.
1383   =V= :: Display the filter of the current virtual database in the
1384 minibuffer. With prefix argument: reapply the filter. =(ebib-print-filter)=
1386   =w= :: write the database to a different file. =(ebib-write-database)=
1388   =x= :: export the current entry to a file, or, when used with numeric
1389 prefix argument, to another database. =(ebib-export-entry)=
1391   =; x= :: export the marked entries to a file, or, when used with a numeric
1392 prefix argument, to another database.
1394   =C-x b= :: equivalent to =z=.
1396   =C-x k= :: equivalent to =q=.
1398   =X= :: export the =@preamble= definition to a file or, when used with a
1399 numeric prefix argument, to another database. =(ebib-export-preamble)=
1401   =z= :: move focus away from the Ebib windows. =(ebib-leave-ebib-windows)=
1403   =Z= :: put Ebib in the background. =(ebib-lower)=
1405 One function is not bound to any key: =ebib-print-filename=.
1407 ** The Entry Buffer
1409   =Up= :: go to the previous field. =(ebib-prev-field)=
1411   =Down= :: go to the next field. =(ebib-next-field)=
1413   =PgUp= :: go to the previous set of fields. =(ebib-goto-prev-set)=
1415   =PgDn= :: go to the next set of fields. =(ebib-goto-next-set)=
1416   
1417   =Home= :: go to the first field. =(ebib-goto-first-field)=
1418   
1419   =End= :: go to the last field. =(ebib-goto-last-field)=
1421   =Space= :: equivalent to =PgDn=.
1423   =b= :: equivalent to =PgUp=.
1425   =c= :: copy the contents of the current field to the kill
1426 ring. =(ebib-copy-field-contents)=
1428   =d= :: delete the value of the current field. The deleted contents will *not*
1429 be put in the kill ring, and is therefore irretrievably
1430 lost. =(ebib-delete-field-contents)=
1431   
1432   =e= :: edit the current field. =(ebib-edit-fields)=
1434   =f= :: extract a filename from the current field and send it to an
1435 appropriate viewer. With numeric prefix argument, extract the *n*-th
1436 filename.
1438   =g= :: equivalent to =Home=.
1439   
1440   =G= :: equivalent to =End=.
1442   =j= :: go to the next field. =(ebib-next-field)=
1444   =k= :: go to the previous field. =(ebib-prev-field)=
1446   =l= :: edit the current field as multiline. =(ebib-edit-multiline-field)=
1448   =C-n= :: equivalent to =Down=.
1450   =M-n= :: equivalent to =PgDn=.
1451   
1452   =C-p= :: equivalent to =Up=.
1454   =M-p= :: equivalent to =PgUp=.
1456   =q= :: quit editing the current entry and return focus to the index
1457 buffer. =(ebib-quit-entry-buffer)=
1459   =r= :: toggle a field's ``raw'' status. =(ebib-toggle-raw)=
1460   
1461   =s= :: insert an abbreviation from the =@string= definitions in the
1462 database. =(ebib-insert-abbreviation)=
1464   =u= :: extract a URL from the current field and send it to a browser. With
1465 numeric prefix argument, extract the *n*-th url.
1467   =x= :: cut the contents of the current field. Like =c=, =x= puts the contents
1468 of the current field in the kill ring. =(ebib-cut-field-contents)=
1470   =y= :: yank the last element in the kill ring to the current
1471 field. Repeated use of =y= functions like =C-y/M-y=. Note that no text will be
1472 yanked if the field already has a value. =(ebib-yank-field-contents)=
1475 ** The Strings Buffer
1477   =Up= :: go to the previous string. =(ebib-prev-string)=
1479   =Down= :: go to the next string. =(ebib-next-string)=
1481   =PgUp= :: go ten strings up. =(ebib-strings-page-up)=
1483   =PgDn= :: go ten strings down. =(ebib-strings-page-down)=
1485   =Home= :: go to the first string. =(ebib-goto-first-string)=
1486   
1487   =End= :: go to the last string. =(ebib-goto-last-string)=
1489   =Space= :: equivalent to =PgDn=.
1491   =a= :: add a new =@string= definition. =(ebib-add-string)=
1493   =b= :: equivalent to =PgUp=.
1495   =c= :: copy the text of the current string to the kill
1496 ring. =(ebib-copy-string-contents)=
1497   
1498   =d= :: delete the current =@string= definition from the database. You will be
1499 asked for confirmation. =(ebib-delete-string)=
1500   
1501   =e= :: edit the value of the current string. =(ebib-edit-string)=
1503   =g= :: equivalent to =Home=.
1504   
1505   =G= :: equivalent to =End=.
1507   =j= :: equivalent to =Down=.
1509   =k= :: equivalent to =Up=.
1511   =l= :: edit the value of the current string as
1512 multiline. =(ebib-edit-multiline-string)=
1514   =C-n= :: equivalent to =Down=.
1516   =M-n= :: equivalent to =PgDn=.
1518   =C-p= :: equivalent to =Up=.
1520   =M-p=  :: equivalent to =PgUp=.
1522   =q= :: quit the strings buffer and return focus to the index
1523 buffer. =(ebib-quit-strings-buffer)=
1525   =x= :: export the current =@string= definition to a file or, when used with a
1526 prefix argument, to another database. =(ebib-export-string)=
1527   
1528   =X= :: export all the =@string= definitions to a file or, when used with a
1529 prefix argument, to another database. =(ebib-export-all-strings)=
1532 * Customisation
1533 #customisation
1535 Ebib can be customised through Emacs' standard customisation interface. The
1536 only thing that cannot be customised in this way are the key bindings. If
1537 you wish to customise those, you have to use the file =~/.ebibrc=.
1540 ** The Customisation Buffer
1541 #customisation-buffer
1543 Ebib's customisation group is a subgroup of the =Tex= group. It can be
1544 invoked by typing =M-x customize-group RET ebib RET=, or by pressing =C= in
1545 the index buffer. This chapter gives a short description of all the options
1546 available in the customisation buffer.
1549 *** Default Type
1551 The default type is the default entry type given to a new entry. Every
1552 entry in the Ebib database must have a type, because the type defines which
1553 fields are available. When a new entry is created, Ebib gives it a default
1554 type, which can be customised through this option. The standard value is
1555 =article=.
1558 *** Preload Bib Files
1559 #preload-bib-files
1561 This option allows you to specify which file(s) Ebib is to load when it
1562 starts up. Specify one file per line, press the =INS= button to add more
1563 files. You can complete a partial filename with =M-TAB=.
1566 *** Additional Fields
1567 #additional-fields
1569 The additional fields are those fields that are available for all entry
1570 types, and which BibTeX generally ignores. This option allows you to
1571 specify which additional fields you wish to use in your database. Specify
1572 one field per line, press the =INS= button to add more fields.
1574 By default, the following additional fields are defined: =crossref, url,
1575 annote, abstract, keywords, file= and =timestamp=.
1578 *** Layout
1579 #layout
1581 The default value of this option is =full=, which means that Ebib takes over
1582 the entire frame when it runs. Alternatively, you can select to specify a
1583 width (in characters) yourself, in which case Ebib takes up the right part
1584 of the frame, leaving the left part free. See [[#screen-layout][Screen Layout]] for details.
1588 *** Index Window Size
1590 This option lets you specify the size of the index window at the top of the
1591 Ebib screen. The default value is 10.
1594 *** Index Display Fields
1595 #index-display-fields
1597 This option allows you to specify fields that should be displayed next to
1598 the entry key in the index buffer. By default, the index buffer only shows
1599 the key of each entry, but if this is too little information, you can use
1600 this option to display e.g. the title of each entry as well.
1603 *** Insertion Commands
1604 #insertion-commands
1606 With the command =ebib-insert-bibtex-key= or with the command key =p= in the index
1607 buffer, you can insert a BibTeX key into a LaTeX buffer. This option allows you
1608 to define the commands that are available through tab completion when these
1609 functions ask for a citation command.
1611 The citation commands must be given *without* the leading backslash, as Ebib adds one.
1612 Furthermore, you need to specify how many optional arguments each command can
1613 have. When Ebib prompts you for a citation key, it will ask for as many optional
1614 arguments as you specify here. (If you don't want to be asked for those optional
1615 arguments, just fill in 0.)
1617 When Ebib prompts you for a citation command, the commands specified in this
1618 option can be obtained through tab completion. However, it is not necessary to
1619 fill in a command from this list here. You can also enter another command (in
1620 which case Ebib asks for exactly one optional argument) or even no command at
1621 all. In the latter case, Ebib does not ask for any optional arguments and simply
1622 puts the key in the buffer without adding a backslash or curly braces.
1626 *** Sort Order
1628 The use of this option is explained above, see [[#sorting-bib-file][Sorting the .bib file]]. To
1629 create a sort order, click the =INS= button to create a sort level, and then
1630 click the =INS= button under that sort level to enter a sort field. If you
1631 want to add more than one sort field to the sort level, simply hit =INS=
1632 again.
1635 *** Save Xrefs First
1636 #save-xrefs-first
1638 For cross-referencing to work, the cross-referencing entries must appear in
1639 the =.bib= file *before* the cross-referenced entries. In order to tell Ebib to
1640 save all entries with a =crossref= field first, you must set the option =Save
1641 Xrefs First= in Ebib's customisation buffer. With this option set, BibTeX's
1642 crossreferencing options work as intended.
1644 By default, this option is unset, because it (marginally) slows down saving
1645 the =.bib= file somewhat.
1648 *** Crossref Face
1649 #crossref-face
1651 Field values inherited from a cross-referenced entry are marked with this
1652 face. By default, the face has red as foreground colour.
1655 *** Marked Face
1656 #marked-face
1658 When entries are marked (with =m=), they are highlighted in this face. By
1659 default, GNU Emacs uses the text property =highlight=. XEmacs only allows
1660 this on terminals, therefore it displays marked entries with a red
1661 background and a white foreground colour. This option allows you to change
1662 these defaults.
1665 *** Use Timestamp
1667 If this option is set, Ebib will add a =timestamp= field to every new entry,
1668 recording the date and time it was added to the database. See [[#timestamps][Timestamps]].
1671 *** Timestamp Format
1673 This option specifies the format string that is used to create the
1674 timestamp. The format string is used by =format-time-string= to create a time
1675 representation. The default value is ="%a %b %e %T %Y"=, which produces a
1676 timestamp of the form ="Mon Mar 12 01:03:26 2007"=. See the documentation for
1677 =format-time-string= for the forms that the format string can take.
1680 *** Standard Url Field
1681 #standard-url-field
1683 This is the field that Ebib searches for URLs if you press =u= in the index
1684 buffer. Its default value is =url=.
1687 *** Url Regexp
1688 #url-regexp
1690 This is the regular expression that Ebib uses to search for URLs in a
1691 field. The default value is:
1693 <example>
1694 \\url{\(.*\)}\|https?://[^ '<>\"\n\t\f]+
1695 </example>
1697 With this regular expression, Ebib considers everything that is in a LaTeX
1698 <verb>\url{...}</verb> command as a URL, and furthermore every string of
1699 text that starts with =http://= or =https://= and does not contain whitespace
1700 or one of the characters =' " <= or =>=.
1703 *** Browser Command
1704 #browser-command
1706 If this option is unset (which is the default), Ebib uses the Emacs
1707 function =browse-url= to start a browser. If this function does not exist,
1708 you can set this option. For example, if you use the Firefox browser, set
1709 this option to =firefox=.
1711 For this to work, the browser that you use must be able to handle a URL on
1712 the command line.
1715 *** Standard File Field
1716 #standard-file-field
1718 This is the field that Ebib searches for filenames if you press =f= in the
1719 index buffer. Its default value is =file=.
1722 *** File Associations
1723 #file-associations
1725 The programs used to view files. By default, programs for =.pdf= and =.ps=
1726 files are specified, which should be available on most linux systems. If
1727 you prefer other programs or are running on Windows, you'll can specify
1728 them here. Note that Ebib searches the PATH for the programs, but you can
1729 also specify full path names. Of course, it is also possible to add new
1730 associations.
1732 Note that GNU/Emacs 23 (as yet unreleased) comes with =doc-view-mode=, which
1733 provides a way to view =.pdf= and =.ps= files inside Emacs. (The files are
1734 converted to =.png= format first.) If you prefer to use this mode, simply
1735 leave the program field blank for the relevant file type.
1738 *** File Regexp
1739 #file-regexp
1741 In order to find files in a field, Ebib uses a regular expression. The
1742 default value is:
1744 <example>
1745   [^?|\:*<>\" \n\t\f]+
1746 </example>
1748 This essentially means that every string of characters not containing any
1749 of the characters
1751 <example>? | \ : * < > "</example>
1753 or space, newline, tab of formfeed. URLs can easily by recognised by the
1754 prefix =http:=, but recognising files is not so straightforward. It is
1755 therefore not advisable to put anything but filenames in the =file= field.
1758 *** File Search Dirs
1759 #file-search-dirs
1761 This is the list of directories that Ebib searches for files. Note that
1762 searching is not recursive: only the files listed here are searched, not
1763 their subdirectories.
1766 *** Print Preamble
1768 This option specifies the preamble that is to be added to the LaTeX file
1769 Ebib creates for printing the database (i.e., the =P= command). By default,
1770 the preamble is empty. You can set your own <verb>\usepackage</verb>
1771 commands, or anything else you may need.
1774 *** Print Multiline
1776 When this options is set, Ebib includes multiline field values when it
1777 creates a LaTeX file with =P= (=ebib-print-database=). When unset, multiline
1778 values are excluded, which saves space. By default, this option is unset.
1781 *** Latex Preamble
1783 This option specifies the preamble to be added to the LaTeX file for
1784 creating a list of references from the database (i.e., the =L= command). By
1785 default, the line <verb>\bibliographystyle{plain}</verb> is put in the
1786 preamble, but you may want to specify your own BibTeX packages and options.
1789 *** Print Tempfile
1791 This option specifies the name and location of the temporary file Ebib
1792 creates with the commands =ebib-print-database= and
1793 =ebib-latex-database=. By default, this option has no value,
1794 which means that Ebib will ask for a filename each time either of these
1795 commands is called.
1798 *** Allow Identical Fields
1799 #allow-identical-fields
1801 If this option is set, Ebib stores the values of multiple occurrences of a
1802 single field within an entry in a single occurrence of that field,
1803 separated by semicolons. By default, this option is unset, because it slows
1804 down the loading of =.bib= files. See [[#multiple-identical-fields][Multiple Identical Fields]].
1807 *** Entry Types
1808 #entry-types
1810 This option allows you to customise the entry types that Ebib uses. Each
1811 entry type has a name, a set of obligatory fields and a set of optional
1812 fields. You can add, alter or delete single fields in an entry type, or
1813 whole entry types.
1815 If you want to add an entry type, hit the =INS= key on the top level and give
1816 the new entry a name, then add obligatory and/or optional fields. It is not
1817 necessary that an entry type has both obligatory and optional fields, you
1818 can define an entry that has only obligatory or only optional fields.
1821 ** Modifying Key Bindings
1822 #modifying-key-bindings
1824 If you are unhappy about Ebib's standard key bindings, you can change them
1825 to anything you like. To do this, you have to create a file =~/.ebibrc= and
1826 write your preferred key bindings in it. A key binding definition is built
1827 up as follows:
1829 <example>
1830 (ebib-key <buffer> <key> <command>)
1831 </example>
1833 =<buffer>= is either =index=, =entry= or =strings=, for the corresponding
1834 buffer. =<key>= is a standard Emacs key description, and =<command>= is the
1835 Ebib command to be associated with the key. The commands that can be used
1836 here are listed in [[#ebib-buffers][The Ebib Buffers]]. Note that it is possible to bind more
1837 than one key to a single function: just add as many =ebib-key= statements as
1838 necessary.
1840 As an example, the following binds =C-s= to =ebib-search= in the index buffer,
1841 so that the database can be searched with =C-s= as well as with =/=:
1843 <example>
1844 (ebib-key index "\C-s" ebib-search)
1845 </example>
1847 If you want to unbind a key, you can simply leave out =<command>=. So if you
1848 want to bind the command =ebib-delete-entry= to =D= rather than =d=, you need to
1849 put the following in =.ebibrc=:
1851 <example>
1852 (ebib-key index "D" ebib-delete-entry)
1853 (ebib-key index "d")
1854 </example>
1856 The first line binds =D= to the command =ebib-delete-entry=. The second line
1857 unbinds =d=.
1859 If a command can be called with a prefix key (as for example
1860 =ebib-delete-entry= can), =ebib-key= will automatically rebind the prefixed
1861 version as well. So in the example above, the first line not only binds =D=,
1862 it also binds =; D=. Similarly, the second line not only unbinds =d=, but also
1863 =; d=.
1865 It is also possible to redefine the prefix key itself. To do this, you must
1866 specify =mark-prefix= for =<buffer>=. The value of =<command>= is irrelevant
1867 here, so it can be left out:
1869 <example>
1870 (ebib-key mark-prefix ":")
1871 </example>
1873 This sets up =:= as the new prefix key. Doing this automatically unbinds the
1874 existing prefix key.
1876 </div>