Fixed manual
[ebib.git] / manual / ebib-manual.muse
blobee67c774f8edf252bf346f12d2713997a3713d80
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,
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 ** Screen Layout
704 #screen-layout
706 By default, Ebib takes over the entire Emacs frame it is started in. If you
707 have a wide enough screen, however, it may be more convenient to have Ebib
708 take up only part of the frame, so that you can have the LaTeX text you're
709 working on and Ebib visible at the same time. The option [[#layout][Layout]] allows you
710 to do this, by giving you the ability to choose between a full-frame or a
711 split-frame layout.
713 In the split-frame layout, the Ebib windows are displayed on the right of
714 the current frame, with the left part free for your document. In this
715 layout, some aspects of Ebib behave somewhat differently. Most importantly,
716 the multiline edit buffer is not displayed in the lower Ebib window, but in
717 the non-Ebib window on the left. (Obviously, after leaving the multiline
718 edit buffer, the original buffer is restored to that window.)
720 Furthermore, pressing =z= in the index buffer leaves Ebib, but keeps the
721 buffers visible. You can get back to Ebib with the command =M-x ebib= (or any
722 key bound to it, of course), or simply by manually switching to the index
723 buffer. If you want to remove the Ebib buffers from the frame but keep Ebib
724 in the background, you can use =Z= (i.e. capital =Z=) in the index
725 buffer. (Note that =Z= is also available in the full-frame layout, but there
726 it is identical to =z=.)
728 Lastly, the command =ebib-entry-summary= checks whether the Ebib buffers are
729 visible in the frame. If they are, it does not output the entry info in a
730 =*Help*= buffer, but rather displays the entry in Ebib itself.
733 ** Preloading =.bib= Files
735 Chances are that you will be doing most of your work with one or a few =.bib=
736 files, and you may find yourself opening the same file or files every time
737 you start Ebib. If so, you can tell Ebib to always load specific =.bib= files
738 on startup. To do this, specify the files in Ebib's customisation buffer,
739 under the option [[#preload-bib-files][Preload Bib Files]].
742 ** =@Preamble= Definition
744 Apart from database entries, BibTeX allows three more types of elements to
745 appear in a =.bib= file. These are =@comment=, =@preamble= and =@string=
746 definitions. Ebib provides facilities to handle the latter two. =@comment=
747 definitions cannot be added to a =.bib= file through Ebib, and if Ebib finds
748 one in a =.bib= file, it is simply ignored.
750 =@preamble= and =@string= definitions can be handled, however. Ebib allows you
751 to add one =@preamble= definition to the database.  In principle, BibTeX
752 allows more than one such definition, but really one suffices, because you
753 can use the concatenation character =#= to include multiple TeX or LaTeX
754 commands. So, rather than having two =@preamble= definitions such as:
756 <example>
757 @preamble{ "\newcommand{\noopsort}[1]{} " }
758 @preamble{ "\newcommand{\singleletter}[1]{#1} " }
759 </example>
761 <literal style="texinfo">@noindent</literal>you can write this in your =.bib=
762 file:
764 <example>
765 @preamble{ "\newcommand{\noopsort}[1]{} "
766          # "\newcommand{\singleletter}[1]{#1} " }
767 </example>
769 Creating or editing a =@preamble= definition in Ebib is done by hitting =r= in
770 the index buffer. Ebib uses the multiline edit buffer for editing the text
771 of the =@preamble= definition, which means that as discussed above, =C-x b=
772 stores the =@preamble= text and returns focus to the index buffer, while =C-x
773 k= returns focus to the index buffer while abandoning any changes you may
774 have made. (For details on using the multiline edit buffer, see
775 [[#multiline-edit-buffer][The Multiline Edit Buffer]].)
777 In order to create a =@preamble= as shown above in Ebib, you only have to
778 type the text between the braces.  Ebib takes care of including the braces
779 of the =@preamble= command, but otherwise it saves the text exactly as you
780 enter it. So in order to get the preamble above, you'd have to type the
781 following in Ebib:
783 <example>
784 "\newcommand{\noopsort}[1]{} "
785 # "\newcommand{\singleletter}[1]{#1} "
786 </example>
788 Note that when Ebib loads a =.bib= file that contains more than one =@preamble=
789 definition, it concatenates all the strings in them in the manner just
790 described and saves them in one =@preamble= definition.
793 ** =@String= Definitions
795 If you press =t= in the index buffer, Ebib hides the entry buffer in the
796 lower window and replaces it with the *strings buffer*. In this buffer, you
797 can add, delete and edit =@string= definitions.
799 Adding a =@string= definition is done with the command =a=. This will first ask
800 you for an abbreviation and then for the value to be associated with that
801 abbreviation. Once you've entered these, Ebib will sort the new
802 abbreviation into the buffer.
804 Moving between the =@string= definitions can be done in the usual way: the
805 cursor keys =up= and =down=, =C-p= and =C-n= and =k= and =j= move up and down. =Space=
806 and =PgDn= move ten strings down, while =b= and =PgUp= move in the other
807 direction. The keys =g=, =G=, =Home= and =End= also function as expected.
809 To delete a =@string= definition, use =d=. To edit the value of a definition,
810 use =e=. There is also a command =c=, which copies the value of the current
811 =@string= definition to the kill ring. Unlike in the entry buffer, there are
812 no corresponing commands =y= and =x=. (In fact, =x= does exist, but has another
813 function.) Yanking from the kill ring can be done with =C-y/M-y= in the
814 minibuffer when you edit a =@string='s value. Cutting a =@string='s value
815 is pointless, because a =@string= definition must have a value.
817 Having defined =@string= definitions, there must of course be a way to use
818 them. Just giving a field a string abbreviation as value will not do,
819 because Ebib puts braces around the value that you enter when it writes the
820 =.bib= file, so that BibTeX will not recognise the abbreviation, and will not
821 expand it. BibTeX will only recognise an abbreviation if it appears in the
822 =.bib= file outside of any braces.
824 To accomplish this, you must mark a field's value as *raw*. A raw field is a
825 field whose value is not surrounded by braces when the database is saved,
826 so that BibTeX recognises it as an abbreviation. To mark a field raw, press
827 =r=. An asterisk will appear before the field, indicating that it is
828 raw. Pressing =r= again will change the field back to normal. If you press =r=
829 on a field that does not have a value yet, Ebib will ask you for one.
831 Note that this also makes it possible to enter field values that are
832 composed of concatenations of strings and abbreviations. The BibTeX
833 documentation for example explains that if you have defined:
835 <example>
836 @string{WGA = "World Gnus Almanac"}
837 </example>
839 <literal style="texinfo">@noindent</literal>you can create a BibTeX field
840 like this:
842 <example>
843 title = 1966 # WGA
844 </example>
846 <literal style="texinfo">@noindent</literal>which will produce ``1966 World
847 Gnus Almanac''. Or you can do:
849 <example>
850 month = "1~" # jan
851 </example>
853 <literal style="texinfo">@noindent</literal>which will produce someting
854 like ``1 January'', assuming your bibliography style has defined the
855 abbreviation =jan=. All this is possible with Ebib, simply by entering the
856 exact text including quotes or braces around the strings, and marking the
857 relevant field as raw.
859 An easy way to enter a =@string= abbreviation as a field value is to use the
860 key =s= instead of =e=. If you type =s=, Ebib asks you for a =@string= abbreviation
861 to put in the current field, and automatically marks the field as raw. With
862 this command, Ebib only accepts =@string= definitions that are in the
863 database, so that by using =s= you can make sure you don't make any
864 typos. Note that you can use tab completion to complete a partial string.
867 ** Sorting the =.bib= file
868 #sorting-bib-file
870 By default, the entries in the database are saved to the =.bib= file in
871 alphabetical order according to entry key. If you only deal with the =.bib=
872 file through Ebib, you may not care in which order the entries are
873 saved. However, it may sometimes be desirable to be able to specify the
874 sort order of entries in more detail. (Apparently, this can be useful with
875 ConTeXt, for example.)
877 You can specify a sort order in Ebib's customisation buffer. To sort the
878 entries, you must set at least one sort level (that is, a field to sort the
879 entries on). You can also specify more than one sort level: if two entries
880 have identical values for the first sort level, they will be sorted on the
881 second sort level. E.g., if the first sort level is =author= and the second
882 is =year=, then the entries are sorted by author, and those entries that have
883 identical values for the =author= field are sorted by year.
885 A sort level is not restricted to a single field. You can specify more
886 fields for a single sort level. Within a single sort level, a second sort
887 field is used if the first sort field does not have a value. For example,
888 books that have an editor instead of an author will have an empty =author=
889 field. If you sort the database on the =author= field, such entries will all
890 appear at the beginning of the =.bib= file, which is most likely not what you
891 want.
893 To remedy this, you can specify both the =author= and the =editor= fields for
894 the first sort level. Ebib will then sort an entry on its =author= field if
895 it has a value, and will otherwise use the value of the =editor= field.
897 The difference between two sort fields within one sort level and two sort
898 levels is that a second sort *field* is an alternative for the first field
899 when it has no value, while a second sort *level* is an additional sort
900 criterion when two or more entries cannot be sorted on the first level,
901 because they have identical values.
903 By default, the option =Sort Order= has no value, which means that the
904 entries in the =.bib= file are sorted according to entry key. Those that wish
905 to customise the sort order will usually want to set the first sort level
906 to =author editor=, and the second to =year=. In that way, the entries in the
907 =.bib= file are sorted according to author/editor, and entries with the same
908 author/editor are sorted by year.
910 Entries that cannot be sorted on some sort level, because the sort fields
911 are empty, are sorted on entry key. (Keep in mind that if the first sort
912 level yields *no value* for a specific entry, Ebib does *not* use the second
913 sort level to sort that entry. It uses the entry key. The second sort level
914 is only used if the first yields *identical* values for two or more entries.)
916 Note that if you have set the option =Save Xrefs First= (see
917 [[#cross-referencing][Cross-referencing]]), it is pointless to set a sort order. Saving
918 cross-referencing entries first messes up any sort order, so Ebib simply
919 ignores the sort order if =Save Xrefs First= is set.
922 ** Merging and Importing
924 As described in the previous chapter, adding entries to a database can be
925 done manually with the key =a=. There are other ways of adding entries to a
926 database, however.
928 With the command =M= you can merge a second =.bib= file into your current
929 database. When you hit =M=, you are asked for a filename. Ebib then reads the
930 entries in this file and adds them to the database. Duplicate entries (that
931 is, entries with an entry key that already exists in the database) will not
932 be loaded. Ebib logs a warning about each duplicate entry to its log
933 buffer, and displays a warning after loading the =.bib= file when this
934 happens.
936 Another way to add entries to a database is to import them from an Emacs
937 buffer. If, for example, you find ready-formatted BibTeX entries in a text
938 file or e.g. on the internet, you can copy & paste them to any Emacs buffer
939 (e.g. the =*scratch*= buffer), and then execute the command =M-x
940 ebib-import=. Ebib then goes through the buffer and loads all BibTeX entries
941 it finds into the current database (i.e. the database that was active when
942 you lowered Ebib). If you call =ebib-import= while the region is active, Ebib
943 only reads the BibTeX entries in the region.
946 ** Exporting Entries
948 Sometimes it can be useful to copy entries from one database to another, or
949 to create a new =.bib= file with several entries from an existing
950 database. For this purpose, Ebib provides exporting facilities. To export
951 an entry to a =.bib= file, use the command =x=. Ebib will ask you for a
952 filename to export the entry to. (If you have already exported an entry
953 before, Ebib will present the filename you used as default, but you can of
954 course change it.)
956 For obvious reasons, Ebib appends the entry to the file that you enter if
957 it already exists, it does not overwrite the file. If this is not what you
958 want, delete the file first, as Ebib provides no way to do this.
960 If you have more than one database open in Ebib, it is also possible to
961 copy entries from one database to another. To do this, use the =x= command
962 with a numeric prefix argument. E.g., if the database you want to export an
963 entry to is the second database, type =M-2 x= to export the current entry to
964 it. The number of the database is given in the modeline of the index
965 buffer.
967 If the database you're copying an entry to already contains an entry with
968 the same entry key, Ebib won't copy the entry, and issues an appropriate
969 warning message.
971 Note that the command =x= can operate on marked entries. So to export several
972 entries in one go mark them and type =; x=. You can use a prefix argument in
973 the normal way: =M-2 ; x= exports the marked entries to database 2.
975 Apart from entries, it is also possible to export the =@preamble= and =@string=
976 definitions. The =@preamble= definition is exported with the command =X= in the
977 index buffer. =@string= definitions can be exported in the strings buffer: =x=
978 in this buffer exports the current string, while =X= exports all =@string=
979 definitions in one go. All these commands function in the same way: when
980 used without a prefix argument, they ask for a filename, and then append
981 the relevent data to that file. With a numeric prefix argument, they copy
982 the relevant data to the corresponding open database.
985 ** Timestamps
986 #timestamps
988 Ebib provides the possibility to add a timestamp to every new entry,
989 recording the time it was added to the database. The timestamp is recorded
990 in the (additional) field =timestamp=. (By default, this field is not shown,
991 but you can make it visible by pressing =H= in the index buffer.)
993 You can tell Ebib to create timestamps by setting the option =Use Timestamp=
994 in Ebib's customisation buffer. With this option set, a timestamp is
995 included in entries added to the database with =a=. Ebib will also add a
996 timestamp to entries imported from a buffer or merged from a file, and to
997 entries exported to another database or to a file. When importing or
998 exporting entries, existing timestamps will be overwritten. The logic
999 behind this is that the timestamp records the date and time when the entry
1000 was added to the database, not when it was first created.
1002 Note that if this option is unset, the timestamp of an entry is retained
1003 when it's imported or exported. Therefore, if you record timestamps and
1004 want to im-/export entries without changing their timestamps, temporarily
1005 unset this option.
1007 Ebib uses the function =format-time-string= to create the timestamp. The
1008 format string that Ebib uses can be customised in Ebib's customisation
1009 buffer. The default string is ="%a %b %e %T %Y"=, which produces a timestamp
1010 of the form ="Mon Mar 12 01:03:26 2007"=. Obviously, this string is not
1011 suited for sorting, so if you want to be able to sort on timestamps, you'll
1012 need to customise the format string. See the documentation for
1013 =format-time-string= on the options that are available.
1016 ** Multiple Identical Fields
1017 #multiple-identical-fields
1019 Under normal circumstances, a BibTeX entry only contains one occurrence of
1020 each field. If BibTeX notices that an entry contains more than one
1021 occurrence of an obligatory or optional field, it issues a warning. Ebib is
1022 somewhat less gracious, it simply takes the value of the last occurrence
1023 without giving any warning. (Note, by the way, that BibTeX will use the
1024 value of the *first* occurrence, not the last.) When additional fields appear
1025 more than once in an entry, BibTeX does not warn you, since it ignores
1026 those fields anyway. Here, too, Ebib's standard behaviour is to ignore all
1027 but the last value.
1029 However, some online reference management services ``use'' this feature of
1030 BibTeX in that they put multiple =keywords= fields in the BibTeX entries that
1031 they produce. If you were to import such an entry into Ebib, you would lose
1032 all your keywords except the last one. To remedy this, you can tell Ebib
1033 that it should allow multiple occurrences of a single field in a BibTeX
1034 entry. You can do this by setting the customisation option
1035 [[#allow-identical-fields][Allow Identical Fields]].
1037 With this option set, Ebib collapses the multiple occurrences into a single
1038 occurrence. All the values of the different occurrences are collected and
1039 stored in the single occurrence, separated by semicolons. That is, Ebib
1040 does not retain the multiple occurrences, but it does retain the values. So
1041 suppose you have an entry that contains the following =keywords= fields:
1043 <example>
1044 @book{jones1998,
1045     author = {Jones, Joan},
1046     year = {1998},
1047     ...
1048     keywords = {sleep},
1049     keywords = {winter},
1050     keywords = {hybernation}
1052 </example>
1054 If you load this entry into Ebib with the option =Allow Identical Fields=
1055 set, you will get the following:
1057 <example>
1058 @book{jones1998,
1059     author = {Jones, Joan},
1060     year = {1998},
1061     ...
1062     keywords = {sleep; winter; hybernation}
1064 </example>
1067 ** Virtual Databases
1068 #virtual-databases
1070 In the previous chapter, Ebib's basic search functionality was
1071 discussed. (See [[#searching][Searching]].) Ebib also provides a much more sophisticated
1072 search and filtering mechanism in the form of *virtual databases*.
1074 A virtual database is a database that is not associated with any =.bib=
1075 file. Rather, it is created from another database by selecting entries from
1076 it based on a specific search pattern, called a *filter*. This allows you,
1077 for example, to select all entries from a database that contain the string
1078 ``Jones'' in their =author= field. A filter can be as complex as you want:
1079 you can select all entries that do *not* contain ``Jones'' in the =author=
1080 field, or all entries that contain ``Jones'' in either the =author= or the
1081 =editor= field, or all entries that contain ``Jones'' in the =author= field,
1082 and ``symbiotic hybernation'' in the =keyword= field, etc. Basically, the
1083 filter can consist of an arbitray number of search criteria combined with
1084 the logical operators =and, or= and =not=.
1087 *** Simple Selection
1089 Creating a virtual database is simple: press =&=, and Ebib will ask you for a
1090 field to select on, and for a regular expression to select with. So if you
1091 want to select all entries that contain ``Jones'' in the =author= field, you
1092 press =&= and type =author= as the field and =Jones= as the regexp to filter on.
1094 Ebib will then create a virtual database containing the entries matching
1095 your selection criterion. A virtual database has the same name as the
1096 database it is based on, prepended with =V:=. It also has a number like any
1097 other database, and you can move back and forth to other databases with the
1098 number or cursor keys.
1100 If you don't want to filter on one specific field but rather want to select
1101 all entries that match a certain regexp in any field, you can type =any= as
1102 the field to filter on. So specifying =any= as the field and =Jones= as the
1103 regexp, the virtual database will select all entries that have a field that
1104 contains ``Jones'' in them.
1107 *** Complex Filters
1109 Once you have a virtual database, it remains associated with the database
1110 it was created from. This means that you can refine or extend the selection
1111 (i.e. the filter) that the virtual database is based on. If, in the current
1112 example, you want to include all the entries that have ``Jones'' in the
1113 =editor= field, you have to perform a logical =or= operation: you want to
1114 select an entry if it contains ``Jones'' in the =author= field (which you
1115 already did) *or* if it contains ``Jones'' in the =editor= field.
1117 A short sidenote: the first impulse in a case like this might be to use =and=
1118 instead of =or=: after all, you want to select all entries that contain
1119 ``Jones'' in the =author= field *and* all entries that contain ``Jones'' in the
1120 =editor= field. However, the filter that you build up is used to test each
1121 entry *individually* whether it meets the selection criterion. An entry meets
1122 the criterion if it contains ``Jones'' in the =author= field *or* if it
1123 contains ``Jones'' in the =editor= field. Therefore, =or= is the required
1124 operator in this case. If you would use =and=, you would only get those
1125 entries that contain ``Jones'' in both the =author= *and* =editor= fields.
1127 To perform a logical =or= operation, press the key =|=. As before, you will be
1128 asked which field you want to filter on, and which regexp you want to
1129 filter with. Ebib will then update the virtual database with all entries in
1130 the original database that match the additional criterion.
1132 It is also possible to perform a logical =and= on the virtual database. Use
1133 this if you want to select those entries that contain ``Jones'' in the
1134 =author= field and e.g. ``symbiotic hybernation'' in the =keyword= field. A
1135 logical =and= operation is done with the key =&=. (Note: this is the same key
1136 that is used to create a virtual database. In fact, you can also create a
1137 virtual database with =|=: when used in a normal database, =&= and =|= are
1138 equivalent. They are only different in virtual databases.)
1140 Both the =&= and =|= commands can be used with the negative prefix argument =M--=
1141 (or =C-u -=, which is identical). In this case, the search criterion is
1142 negated. That is, the negative prefix argument performs a logical =not=
1143 operation on the search criterion.
1145 That is, if you want to select all entries from a database that do *not*
1146 contain ``Jones'' in the =author= field, you can do this by typing =M-- &= and
1147 then filling out the relevant field and regexp. This prefix argument is
1148 available both in real and in virtual databases.
1150 There is another way of performing a logical =not= operation, which is only
1151 available in virtual databases: by pressing the key =~=, you invert the
1152 current filter. That is, if you have a virtual database with all the
1153 entries containing ``Jones'' in the =author= or in the =editor= field, and you
1154 press =~=, the selection is inverted, and now contains all entries that do
1155 *not* have ``Jones'' in the =author= or =editor= field.
1157 Although =~= and the negative prefix argument to =&= or =|= both perform logical
1158 =not= operations, they are *not* equivalent: =~= negates the entire filter built
1159 up so far, while the negative prefix argument only negates the single
1160 selection criterion you enter with it.
1162 If you want to know what the filter for the current virtual database is
1163 exactly, you can type =V=. This command displays the current filter in the
1164 minibuffer. The filter is specified as a Lisp expression, meaning that the
1165 operators appear before their operands, not in between them. That is, =x and
1166 y= is written as =(and x y)=.
1168 With a prefix argument (any prefix argument will do), the command =V= not
1169 only displays the current filter, but also reapplies it. This can be useful
1170 when you've made changes to the source database: Ebib does not
1171 automatically update a virtual database when its source database is
1172 modified.
1175 *** Properties of Virtual Databases
1177 Virtual databases differ from normal databases in several ways. First, they
1178 cannot be modified: you cannot add or delete entries, and you cannot modify
1179 the contents of fields. It is also not possible to import entries to them
1180 or merge another file with them. Furthermore, it is not possible to export
1181 entries to them or from them.
1183 A virtual database cannot be saved in the normal way with =s=, and the
1184 command =S= to save all databases ignores virtual databases. If you want to
1185 save a virtual database, you can use the command =w=. This command not only
1186 saves the virtual database, it also changes it into a normal database, and
1187 detaches it from its original source database, so that you can modify it
1188 without affecting the source database.
1190 The command =L= also doesn't work with virtual databases. The reason for this
1191 is that the virtual database is not associated with an actual =.bib= file, so
1192 there is no file to create a list of references from. However, it is
1193 possible to use the command =P= with a virtual database to create a list of
1194 entries. See [[#printing-database][Printing the Database]], for details on these two commands.
1197 ** The Multiline Edit Buffer
1198 #multiline-edit-buffer
1200 As mentioned several times before, Ebib has a special multiline edit
1201 buffer, which is used to edit field values that contain newlines (so-called
1202 *multiline fields*), and also to edit the contents of the =@preamble=
1203 command. This section discusses the details of this buffer.
1205 Ebib enters multiline edit mode in one of three cases: when you press =P= in
1206 the index buffer, to edit the =@preamble= definition, when you hit =l= in the
1207 entry buffer to edit the current field as multiline, or when you hit =e= on
1208 the =annote= field, or on a field whose value already is multiline.
1210 The multiline edit buffer uses a special major mode,
1211 =ebib-multiline-edit-mode=, which is derived from =text-mode=. The changes with
1212 respect to =text-mode= are minor (see below), which means that any
1213 customisations you may have made to =text-mode= will be available in the
1214 multiline edit buffer.
1216 The settings that are specific for =ebib-multiline-edit-mode= are the
1217 functions assigned to the key sequences =C-x b=, =C-x k= and =C-x C-s=. These key
1218 sequences do not have their usual functions, but rather are redefined to
1219 fit Ebib. Both =C-x b= and =C-x k= can be used to leave the multiline edit
1220 buffer. =C-x b= will store the text as it is to the database, while =C-x k=
1221 leaves the multiline edit buffer *without* storing the text, i.e., the
1222 original value of the field or preamble that you were editing is
1223 retained. If the text in the buffer was modified, =C-x k= asks you if you
1224 really want to abandon your changes.
1226 If you leave the multitiline edit buffer with =C-x b= when the buffer is
1227 empty (i.e., you deleted all the text, including the final newline), and
1228 you were editing a field value or the =@preamble= definition, the field value
1229 or preambleis deleted. (This is in fact the *only* way to delete the
1230 =@preamble= definition. Field values on the other hand can also be deleted by
1231 hitting =x= or =d= on them in the entry buffer.)
1233 The third command that is redefined in the multiline edit buffer is =C-x
1234 C-s=. This command can be used to save the database. Because Ebib does not
1235 do an autosave of the current database, it is advisable to save the
1236 database manually every now and then to prevent data loss in case of
1237 crashes. It would be annoying to have to leave the multiline edit buffer
1238 every time you want to do this, so =C-x C-s= has been redefined to allow you
1239 to do this from within the buffer.
1242 * The Ebib Buffers
1243 #ebib-buffers
1245 This chapter lists all the key commands that exist in Ebib, with a short
1246 description and the actual command that they call. The latter information
1247 is needed if you want to customise Ebib's key bindings. (See
1248 [[#modifying-key-bindings][Modifying Key Bindings]].)
1252 ** The Index Buffer
1254   =Up= :: go to previous entry. =(ebib-prev-entry)=
1256   =Down= :: go to next entry. =(ebib-next-entry)=
1258   =Right= :: move to the next database. =(ebib-next-database)=
1259   
1260   =Left= :: move to the previous database. =(ebib-prev-database)=
1262   =PgUp= :: scroll the index buffer down. =(ebib-index-scroll-down)=
1264   =PgDn= :: scroll the index buffer up. =(ebib-index-scroll-up)=
1265   
1266   =Home= :: go to first entry. =(ebib-goto-first-entry)=
1268   =End= :: go to last entry. =(ebib-goto-last-entry)=
1270   =Return= :: make the entry under the cursor current. Use after e.g. =C-s=.
1271 =(ebib-select-entry)=
1272   
1273   =Space= :: equivalent to =PgDn=.
1274   
1275   =1-9= :: jump to the corresponding database.
1277   =/= :: search the database. =(ebib-search)=
1278   
1279   =&= :: Create a virtual database, or perform a logical =and= on the current
1280 virtual database. With negative prefix argument: apply a logical =not= to the
1281 selectional criterion. =(ebib-virtual-db-and)=
1283   =|= :: Create a virtual database, or perform a logical =or= on the current
1284 virtual database. With negative prefix argument: apply a logical =not= to the
1285 selectional criterion. =(ebib-virtual-db-or)=
1287   =~= :: Perform a logical =not= on the current virtual
1288 database. =(ebib-virtual-db-not)=
1290   =a= :: add an entry. =(ebib-add-entry)=
1292   =b= :: equivalent to =Pgup=.
1294   =c= :: close the database. =(ebib-close-database)=
1295   
1296   =C= :: customise Ebib. =(ebib-customize)=
1298   =d= :: delete the current entry. =(ebib-delete-entry)=
1300   =; d= :: delete all marked entries.
1302   =e= :: edit the current entry. =(ebib-edit-entry)=
1303   
1304   =E= :: edit the key of the current entry. =(ebib-edit-keyname)=
1306   =f= :: extract a filename from the =file= field and send it to an
1307 appropriate viewer. With numeric prefix argument, extract the *n*-th
1308 filename.
1310   =F= :: follow =crossref= field. =(ebib-follow-crossref)=
1312   =g= :: equivalent to =Home=.
1314   =G= :: equivalent to =End=.
1316   =H= :: show/hide hidden fields. =(ebib-toggle-hidden)=
1318   =j= :: equivalent to =Down=.
1320   =J= :: jump to another database. This accepts a numeric prefix argument,
1321 but will ask you for a database number if there is
1322 none. =(ebib-switch-to-database)=
1324   =k= :: equivalent to =Up=.
1326   =l= :: show the log buffer. (=ebib-show-log=)
1328   =L= :: create a LaTeX file from the current database that produces a list
1329 of references formatted by BibTeX. =(ebib-latex-database)=
1331   =; L= :: create a LaTeX file with the marked entries only.
1333   =m= :: mark (or unmark) the current entry. =(ebib-mark-entry)=
1335   =; m= :: unmark all marked entries.
1337   =M= :: merge a =.bib= file. =(ebib-merge-bibtex-file)=
1338   
1339   =n= :: find next occurrence of the search string. =(ebib-search-next)=
1341   =C-n= :: equivalent to =Down=.
1343   =M-n= :: equivalent to =PgDn=.
1344   
1345   =o= :: open a =.bib= file. =(ebib-load-bibtex-file)=
1347   =p= :: push an entry to a LaTeX buffer =(ebib-push-entry-key)=
1349   =; p= :: push the marked entries to a LaTeX buffer.
1351   =C-p= :: equivalent to =Up=.
1353   =M-p= :: equivalent to =PgUp=.
1355   =P= :: create a LaTeX file for printing the database, listing the entire
1356 contents of each entry. =(ebib-print-database)=
1358   =; P= :: create a LaTeX file with the marked entries.
1360   =r= :: show and edit the =@preamble= definition in the
1361 database. =(ebib-edit-preamble)=
1363   =q= :: quit Ebib. This sets all variables to nil, unloads the database(s)
1364 and quits Ebib. =(ebib-quit)=
1366   =s= :: save the database. =(ebib-save-current-database)=
1368   =S= :: save all modified databases. =(ebib-save-all-databases)=
1370   =t= :: show and edit the =@string= definitions in the
1371 database. =(ebib-edit-strings)=
1373   =u= :: extract a URL from the =url= field and send it to a browser. With
1374 numeric prefix argument, extract the *n*-th url.
1376   =V= :: Display the filter of the current virtual database in the
1377 minibuffer. With prefix argument: reapply the filter. =(ebib-print-filter)=
1379   =w= :: write the database to a different file. =(ebib-write-database)=
1381   =x= :: export the current entry to a file, or, when used with numeric
1382 prefix argument, to another database. =(ebib-export-entry)=
1384   =; x= :: export the marked entries to a file, or, when used with a numeric
1385 prefix argument, to another database.
1387   =C-x b= :: equivalent to =z=.
1389   =C-x k= :: equivalent to =q=.
1391   =X= :: export the =@preamble= definition to a file or, when used with a
1392 numeric prefix argument, to another database. =(ebib-export-preamble)=
1394   =z= :: move focus away from the Ebib windows. =(ebib-leave-ebib-windows)=
1396   =Z= :: put Ebib in the background. =(ebib-lower)=
1398 One function is not bound to any key: =ebib-print-filename=.
1400 ** The Entry Buffer
1402   =Up= :: go to the previous field. =(ebib-prev-field)=
1404   =Down= :: go to the next field. =(ebib-next-field)=
1406   =PgUp= :: go to the previous set of fields. =(ebib-goto-prev-set)=
1408   =PgDn= :: go to the next set of fields. =(ebib-goto-next-set)=
1409   
1410   =Home= :: go to the first field. =(ebib-goto-first-field)=
1411   
1412   =End= :: go to the last field. =(ebib-goto-last-field)=
1414   =Space= :: equivalent to =PgDn=.
1416   =b= :: equivalent to =PgUp=.
1418   =c= :: copy the contents of the current field to the kill
1419 ring. =(ebib-copy-field-contents)=
1421   =d= :: delete the value of the current field. The deleted contents will *not*
1422 be put in the kill ring, and is therefore irretrievably
1423 lost. =(ebib-delete-field-contents)=
1424   
1425   =e= :: edit the current field. =(ebib-edit-fields)=
1427   =f= :: extract a filename from the current field and send it to an
1428 appropriate viewer. With numeric prefix argument, extract the *n*-th
1429 filename.
1431   =g= :: equivalent to =Home=.
1432   
1433   =G= :: equivalent to =End=.
1435   =j= :: go to the next field. =(ebib-next-field)=
1437   =k= :: go to the previous field. =(ebib-prev-field)=
1439   =l= :: edit the current field as multiline. =(ebib-edit-multiline-field)=
1441   =C-n= :: equivalent to =Down=.
1443   =M-n= :: equivalent to =PgDn=.
1444   
1445   =C-p= :: equivalent to =Up=.
1447   =M-p= :: equivalent to =PgUp=.
1449   =q= :: quit editing the current entry and return focus to the index
1450 buffer. =(ebib-quit-entry-buffer)=
1452   =r= :: toggle a field's ``raw'' status. =(ebib-toggle-raw)=
1453   
1454   =s= :: insert an abbreviation from the =@string= definitions in the
1455 database. =(ebib-insert-abbreviation)=
1457   =u= :: extract a URL from the current field and send it to a browser. With
1458 numeric prefix argument, extract the *n*-th url.
1460   =x= :: cut the contents of the current field. Like =c=, =x= puts the contents
1461 of the current field in the kill ring. =(ebib-cut-field-contents)=
1463   =y= :: yank the last element in the kill ring to the current
1464 field. Repeated use of =y= functions like =C-y/M-y=. Note that no text will be
1465 yanked if the field already has a value. =(ebib-yank-field-contents)=
1468 ** The Strings Buffer
1470   =Up= :: go to the previous string. =(ebib-prev-string)=
1472   =Down= :: go to the next string. =(ebib-next-string)=
1474   =PgUp= :: go ten strings up. =(ebib-strings-page-up)=
1476   =PgDn= :: go ten strings down. =(ebib-strings-page-down)=
1478   =Home= :: go to the first string. =(ebib-goto-first-string)=
1479   
1480   =End= :: go to the last string. =(ebib-goto-last-string)=
1482   =Space= :: equivalent to =PgDn=.
1484   =a= :: add a new =@string= definition. =(ebib-add-string)=
1486   =b= :: equivalent to =PgUp=.
1488   =c= :: copy the text of the current string to the kill
1489 ring. =(ebib-copy-string-contents)=
1490   
1491   =d= :: delete the current =@string= definition from the database. You will be
1492 asked for confirmation. =(ebib-delete-string)=
1493   
1494   =e= :: edit the value of the current string. =(ebib-edit-string)=
1496   =g= :: equivalent to =Home=.
1497   
1498   =G= :: equivalent to =End=.
1500   =j= :: equivalent to =Down=.
1502   =k= :: equivalent to =Up=.
1504   =l= :: edit the value of the current string as
1505 multiline. =(ebib-edit-multiline-string)=
1507   =C-n= :: equivalent to =Down=.
1509   =M-n= :: equivalent to =PgDn=.
1511   =C-p= :: equivalent to =Up=.
1513   =M-p=  :: equivalent to =PgUp=.
1515   =q= :: quit the strings buffer and return focus to the index
1516 buffer. =(ebib-quit-strings-buffer)=
1518   =x= :: export the current =@string= definition to a file or, when used with a
1519 prefix argument, to another database. =(ebib-export-string)=
1520   
1521   =X= :: export all the =@string= definitions to a file or, when used with a
1522 prefix argument, to another database. =(ebib-export-all-strings)=
1525 * Customisation
1526 #customisation
1528 Ebib can be customised through Emacs' standard customisation interface. The
1529 only thing that cannot be customised in this way are the key bindings. If
1530 you wish to customise those, you have to use the file =~/.ebibrc=.
1533 ** The Customisation Buffer
1534 #customisation-buffer
1536 Ebib's customisation group is a subgroup of the =Tex= group. It can be
1537 invoked by typing =M-x customize-group RET ebib RET=, or by pressing =C= in
1538 the index buffer. This chapter gives a short description of all the options
1539 available in the customisation buffer.
1542 *** Default Type
1544 The default type is the default entry type given to a new entry. Every
1545 entry in the Ebib database must have a type, because the type defines which
1546 fields are available. When a new entry is created, Ebib gives it a default
1547 type, which can be customised through this option. The standard value is
1548 =article=.
1551 *** Preload Bib Files
1552 #preload-bib-files
1554 This option allows you to specify which file(s) Ebib is to load when it
1555 starts up. Specify one file per line, press the =INS= button to add more
1556 files. You can complete a partial filename with =M-TAB=.
1559 *** Additional Fields
1560 #additional-fields
1562 The additional fields are those fields that are available for all entry
1563 types, and which BibTeX generally ignores. This option allows you to
1564 specify which additional fields you wish to use in your database. Specify
1565 one field per line, press the =INS= button to add more fields.
1567 By default, the following additional fields are defined: =crossref, url,
1568 annote, abstract, keywords, file= and =timestamp=.
1571 *** Layout
1572 #layout
1574 The default value of this option is =full=, which means that Ebib takes over
1575 the entire frame when it runs. Alternatively, you can select to specify a
1576 width (in characters) yourself, in which case Ebib takes up the right part
1577 of the frame, leaving the left part free. See [[#screen-layout][Screen Layout]] for details.
1581 *** Index Window Size
1583 This option lets you specify the size of the index window at the top of the
1584 Ebib screen. The default value is 10.
1587 *** Index Display Fields
1588 #index-display-fields
1590 This option allows you to specify fields that should be displayed next to
1591 the entry key in the index buffer. By default, the index buffer only shows
1592 the key of each entry, but if this is too little information, you can use
1593 this option to display e.g. the title of each entry as well.
1596 *** Insertion Strings
1597 #insertion-strings
1599 With the command =ebib-insert-bibtex-key= or with the command key =p= in the
1600 index buffer, you can insert a BibTeX key into a LaTeX buffer. This option
1601 allows you to customise the string that Ebib inserts in the buffer.
1603 In fact, it is possible to define multiple strings. Each string must be
1604 numbered: this number provides a way to identify the string that you want
1605 to use. You can select the desired string by calling =ebib-insert-bibtex-key=
1606 or by hitting =p= with a numeric prefix argument corresponding to the string.
1608 Each string *must* contain a =%s= directive, which is replaced with the BibTeX
1609 key. For example, it is possible to define the following:
1611 <example>
1612 0:  {%s}
1613 1:  \cite{%s}
1614 2:  \nocite{%s}
1615 </example>
1617 With this, typing =M-2 M-x ebib-insert-bibtex-key=, followed by a BibTeX key
1618 inserts the command <verb>\nocite{<key>}</verb> into the current
1619 buffer. Typing =M-2 p= in the index buffer does the same for the LaTeX buffer
1620 you choose. (Note that the prefix argument also works when you have bound
1621 =ebib-insert-bibtex-key= to a key sequence. That is, if you have bound it to
1622 say =C-c b=, typing =M-2 C-c b= inserts the second string.)
1624 Even if you have specified multiple strings, you can still use
1625 =ebib-insert-bibtex-key= or hit =p= without prefix argument. In that case, Ebib
1626 just inserts string number 1. Note that if you define only one custom
1627 string, it still needs to be numbered. Give it number 1, so that you can
1628 enter it without prefix argument.
1630 The default value of this option is =((0 . "%s") (1 . "\cite{%s}"))=. With
1631 this setting, both =ebib-insert-bibtex-key= and =p= insert the key with the
1632 LaTeX command <verb>\cite</verb> by default, and they can furthemore be
1633 used with a prefix argument =0= (i.e. =M-0 ebib-insert-bibtex-key= or =M-0 p=) to
1634 insert just the bare key, without a <verb>\cite</verb> command.
1637 *** Sort Order
1639 The use of this option is explained above, see [[#sorting-bib-file][Sorting the .bib file]]. To
1640 create a sort order, click the =INS= button to create a sort level, and then
1641 click the =INS= button under that sort level to enter a sort field. If you
1642 want to add more than one sort field to the sort level, simply hit =INS=
1643 again.
1646 *** Save Xrefs First
1647 #save-xrefs-first
1649 For cross-referencing to work, the cross-referencing entries must appear in
1650 the =.bib= file *before* the cross-referenced entries. In order to tell Ebib to
1651 save all entries with a =crossref= field first, you must set the option =Save
1652 Xrefs First= in Ebib's customisation buffer. With this option set, BibTeX's
1653 crossreferencing options work as intended.
1655 By default, this option is unset, because it (marginally) slows down saving
1656 the =.bib= file somewhat.
1659 *** Crossref Face
1660 #crossref-face
1662 Field values inherited from a cross-referenced entry are marked with this
1663 face. By default, the face has red as foreground colour.
1666 *** Marked Face
1667 #marked-face
1669 When entries are marked (with =m=), they are highlighted in this face. By
1670 default, GNU Emacs uses the text property =highlight=. XEmacs only allows
1671 this on terminals, therefore it displays marked entries with a red
1672 background and a white foreground colour. This option allows you to change
1673 these defaults.
1676 *** Use Timestamp
1678 If this option is set, Ebib will add a =timestamp= field to every new entry,
1679 recording the date and time it was added to the database. See [[#timestamps][Timestamps]].
1682 *** Timestamp Format
1684 This option specifies the format string that is used to create the
1685 timestamp. The format string is used by =format-time-string= to create a time
1686 representation. The default value is ="%a %b %e %T %Y"=, which produces a
1687 timestamp of the form ="Mon Mar 12 01:03:26 2007"=. See the documentation for
1688 =format-time-string= for the forms that the format string can take.
1691 *** Standard Url Field
1692 #standard-url-field
1694 This is the field that Ebib searches for URLs if you press =u= in the index
1695 buffer. Its default value is =url=.
1698 *** Url Regexp
1699 #url-regexp
1701 This is the regular expression that Ebib uses to search for URLs in a
1702 field. The default value is:
1704 <example>
1705 \\url{\(.*\)}\|https?://[^ '<>\"\n\t\f]+
1706 </example>
1708 With this regular expression, Ebib considers everything that is in a LaTeX
1709 <verb>\url{...}</verb> command as a URL, and furthermore every string of
1710 text that starts with =http://= or =https://= and does not contain whitespace
1711 or one of the characters =' " <= or =>=.
1714 *** Browser Command
1715 #browser-command
1717 If this option is unset (which is the default), Ebib uses the Emacs
1718 function =browse-url= to start a browser. If this function does not exist,
1719 you can set this option. For example, if you use the Firefox browser, set
1720 this option to =firefox=.
1722 For this to work, the browser that you use must be able to handle a URL on
1723 the command line.
1726 *** Standard File Field
1727 #standard-file-field
1729 This is the field that Ebib searches for filenames if you press =f= in the
1730 index buffer. Its default value is =file=.
1733 *** File Associations
1734 #file-associations
1736 The programs used to view files. By default, programs for =.pdf= and =.ps=
1737 files are specified, which should be available on most linux systems. If
1738 you prefer other programs or are running on Windows, you'll can specify
1739 them here. Note that Ebib searches the PATH for the programs, but you can
1740 also specify full path names. Of course, it is also possible to add new
1741 associations.
1743 Note that GNU/Emacs 23 (as yet unreleased) comes with =doc-view-mode=, which
1744 provides a way to view =.pdf= and =.ps= files inside Emacs. (The files are
1745 converted to =.png= format first.) If you prefer to use this mode, simply
1746 leave the program field blank for the relevant file type.
1749 *** File Regexp
1750 #file-regexp
1752 In order to find files in a field, Ebib uses a regular expression. The
1753 default value is:
1755 <example>
1756   [^?|\:*<>\" \n\t\f]+
1757 </example>
1759 This essentially means that every string of characters not containing any
1760 of the characters
1762 <example>? | \ : * < > "</example>
1764 or space, newline, tab of formfeed. URLs can easily by recognised by the
1765 prefix =http:=, but recognising files is not so straightforward. It is
1766 therefore not advisable to put anything but filenames in the =file= field.
1769 *** File Search Dirs
1770 #file-search-dirs
1772 This is the list of directories that Ebib searches for files. Note that
1773 searching is not recursive: only the files listed here are searched, not
1774 their subdirectories.
1777 *** Print Preamble
1779 This option specifies the preamble that is to be added to the LaTeX file
1780 Ebib creates for printing the database (i.e., the =P= command). By default,
1781 the preamble is empty. You can set your own <verb>\usepackage</verb>
1782 commands, or anything else you may need.
1785 *** Print Multiline
1787 When this options is set, Ebib includes multiline field values when it
1788 creates a LaTeX file with =P= (=ebib-print-database=). When unset, multiline
1789 values are excluded, which saves space. By default, this option is unset.
1792 *** Latex Preamble
1794 This option specifies the preamble to be added to the LaTeX file for
1795 creating a list of references from the database (i.e., the =L= command). By
1796 default, the line <verb>\bibliographystyle{plain}</verb> is put in the
1797 preamble, but you may want to specify your own BibTeX packages and options.
1800 *** Print Tempfile
1802 This option specifies the name and location of the temporary file Ebib
1803 creates with the commands =ebib-print-database= and
1804 =ebib-latex-database=. By default, this option has no value,
1805 which means that Ebib will ask for a filename each time either of these
1806 commands is called.
1809 *** Allow Identical Fields
1810 #allow-identical-fields
1812 If this option is set, Ebib stores the values of multiple occurrences of a
1813 single field within an entry in a single occurrence of that field,
1814 separated by semicolons. By default, this option is unset, because it slows
1815 down the loading of =.bib= files. See [[#multiple-identical-fields][Multiple Identical Fields]].
1818 *** Entry Types
1819 #entry-types
1821 This option allows you to customise the entry types that Ebib uses. Each
1822 entry type has a name, a set of obligatory fields and a set of optional
1823 fields. You can add, alter or delete single fields in an entry type, or
1824 whole entry types.
1826 If you want to add an entry type, hit the =INS= key on the top level and give
1827 the new entry a name, then add obligatory and/or optional fields. It is not
1828 necessary that an entry type has both obligatory and optional fields, you
1829 can define an entry that has only obligatory or only optional fields.
1832 ** Modifying Key Bindings
1833 #modifying-key-bindings
1835 If you are unhappy about Ebib's standard key bindings, you can change them
1836 to anything you like. To do this, you have to create a file =~/.ebibrc= and
1837 write your preferred key bindings in it. A key binding definition is built
1838 up as follows:
1840 <example>
1841 (ebib-key <buffer> <key> <command>)
1842 </example>
1844 =<buffer>= is either =index=, =entry= or =strings=, for the corresponding
1845 buffer. =<key>= is a standard Emacs key description, and =<command>= is the
1846 Ebib command to be associated with the key. The commands that can be used
1847 here are listed in [[#ebib-buffers][The Ebib Buffers]]. Note that it is possible to bind more
1848 than one key to a single function: just add as many =ebib-key= statements as
1849 necessary.
1851 As an example, the following binds =C-s= to =ebib-search= in the index buffer,
1852 so that the database can be searched with =C-s= as well as with =/=:
1854 <example>
1855 (ebib-key index "\C-s" ebib-search)
1856 </example>
1858 If you want to unbind a key, you can simply leave out =<command>=. So if you
1859 want to bind the command =ebib-delete-entry= to =D= rather than =d=, you need to
1860 put the following in =.ebibrc=:
1862 <example>
1863 (ebib-key index "D" ebib-delete-entry)
1864 (ebib-key index "d")
1865 </example>
1867 The first line binds =D= to the command =ebib-delete-entry=. The second line
1868 unbinds =d=.
1870 If a command can be called with a prefix key (as for example
1871 =ebib-delete-entry= can), =ebib-key= will automatically rebind the prefixed
1872 version as well. So in the example above, the first line not only binds =D=,
1873 it also binds =; D=. Similarly, the second line not only unbinds =d=, but also
1874 =; d=.
1876 It is also possible to redefine the prefix key itself. To do this, you must
1877 specify =mark-prefix= for =<buffer>=. The value of =<command>= is irrelevant
1878 here, so it can be left out:
1880 <example>
1881 (ebib-key mark-prefix ":")
1882 </example>
1884 This sets up =:= as the new prefix key. Doing this automatically unbinds the
1885 existing prefix key.
1887 </div>