Manual change: autogeneration of keys
[ebib.git] / manual / ebib.text
blob9195e3e1acdc4208fffc2e2ad03cb1652beb54b7
1 % Ebib
2 % Joost Kremers
3 % @@date
5 <div id="main">
7 Ebib is a program with which you can manage BibTeX database files without having
8 to edit the raw `.bib` files. It runs in GNU/Emacs, version 21.1 or higher
9 (lower versions are not supported) and XEmacs (at least from version 21.4; lower
10 version have not been tested, but may work.)
11   
12 It should be noted that Ebib is *not* a minor or major mode for editing BibTeX
13 files. It is a program in itself, which just happens to make use of Emacs as a
14 working environment, in the same way that for example Gnus is.
16 The advantage of having a BibTeX database manager inside Emacs is that X is no
17 longer required, as Emacs can run on the console, and also that some integration
18 with Emacs' TeX and LaTeX modes becomes possible. For example, you can push a
19 BibTeX key from Ebib to a LaTeX buffer, or, vice versa, when you're in a LaTeX
20 buffer, you can consult your BibTeX database and insert a key from it into the
21 document. Another advantage of Ebib is that it is completely controlled by key
22 commands: no stressful mouse movements are required, as with most other (usually
23 X-based) BibTeX database managers.
26 # Installation #
28 To install Ebib, so that it will be loaded automatically when Emacs is started,
29 simply copy the file `ebib.el` to somewhere in your load path and add the
30 following line to Emacs' init file (`~/.emacs` for GNU/Emacs, `~/.xemacs/init.el`
31 for XEmacs):
33     (autoload 'ebib "ebib" "Ebib, a BibTeX database manager." t)
35 On a default installation, the load path probably only contains system
36 directories. If you want to put `ebib.el` somewhere in your home directory, you
37 can create a directory and add it to your load path:
39     (setq load-path (cons "~/.emacs.d" load-path))
41 Note: if you do not know what your load path is set to, go to the `*scratch*`
42 buffer, type `load-path` on an empty line, put the cursor right after it and type
43 `C-j`. The value of `load-path` will then appear in the buffer.
45 When Ebib is loaded, you can run it with `M-x ebib`. This command is also used to
46 return to Ebib when you have put the program in the background. You can bind
47 this command to a key sequence by putting something like the following in Emacs'
48 init file:
50     (global-set-key "\C-ce" 'ebib)
52 You can of course choose any key combination you like. (In Emacs, key
53 combinations of `C-c` `<letter>` are reserved for the user, so that no package
54 may set them.)
56 It is recommended to byte-compile the source, Ebib runs quite a lot faster when
57 it is byte-compiled. You can do this either within Emacs with `M-x
58 byte-compile-file`, or from your shell by going into the directory where you put
59 `ebib.el` and typing:
61     emacs -batch -f batch-byte-compile ebib.el
63 (Substitute `emacs` with `xemacs` if you use XEmacs.) This will create a file
64 `ebib.elc`, which Emacs will load instead of `ebib.el`. Byte-compiling Ebib may
65 produce a warning about functions that are "not known to be defined". This can
66 be safely ignored. GNU Emacs and XEmacs have some small differences, and the
67 functions reported in this warning are those used by the other version. Ebib
68 makes sure that the correct functions are called.
72 # Basic Usage #
74 A BibTeX database is somewhat of a free-form database. A BibTeX entry consists
75 of a set of field-value pairs. Furthermore, each entry is known by a unique key.
76 The way that Ebib navigates this database is by having two windows, one that
77 contains a list of all the entry keys in the database, and one that contains the
78 fields and values of the currently highlighted entry.
80 When Ebib is started, the current windows in Emacs are hidden and the Emacs
81 frame is divided into two windows. The top one contains a buffer that is called
82 the *index buffer*, while the lower window contains the *entry buffer*. When a
83 database is loaded, the index buffer holds a list of all the keys in the
84 database. You can move through these keys with the cursor keys. In the entry
85 buffer, the fields of the currently highlighted entry are shown, with their
86 values.
88 In this chapter, all basic functions of Ebib are described, so that you can get
89 startet with it. At times, reference will be made to later chapters, where more
90 specific functions are described.
92 Ebib has a menu through which most functions can be accessed. Especially some of
93 the lesser used functions can only be accessed through the menu (unless you
94 assign key shortcuts to them, of course.)
97 ## Getting Started ##
99 Ebib is started with the command `M-x ebib`. Entering this command hides all the
100 windows in the current Emacs frame and replaces them with two windows: the top
101 one contains the index buffer, the bottom one, taking up the larger part of the
102 screen, contains the entry buffer. The index buffer is named `none`, to indicate
103 that no database has been loaded. If you open a database, or start a new one,
104 the index buffer will carry its name.
106 You can quit Ebib by typing `q`. You will be asked for confirmation, and you will
107 receive a warning if you happen to have an unsaved database. The command `z` can
108 also be used to leave Ebib. However, unlike `q`, which completely quits Ebib, `z`
109 only lowers it, so that it remains active in the background. The `.bib` files that
110 you have opened remain loaded, and you can return to them by typing `M-x ebib`
111 again.
114 ### Opening a `.bib` File ###
116 Loading a `.bib` file into Ebib is done with the command `o`. Ebib reads the file
117 that you specify, and reports how many entries it found, how many `@string`
118 definitions it found, and whether a `@preamble` was found. Note that when Ebib
119 reads a `.bib` file, it only reads entry types (e.g. `book, article, phdthesis`
120 etc.) that it knows about. Fields (e.g. `author, title, year` etc.) that Ebib does
121 not know about, are loaded (and saved) but not displayed, so they cannot be
122 edited. Therefore, you should make sure that all the entry types and fields that
123 your databases use are defined. A sensible set has been predefined, so that
124 anyone who's using standard BibTeX entry types should have no problem loading an
125 existing `.bib` file into Ebib. If, however, you have custom entry types, or
126 custom fields in your `.bib` files, you should define them. This can be done by
127 selecting "Options | Modify Entry Types" from the Ebib menu. (See also the
128 chapter on customising Ebib, esp. [Entry types](#entry-types).)
130 Every time Ebib reads a `.bib` file, it produces a few log messages. These are
131 written into a special buffer `*Ebib-log*`. If Ebib encounters entry types in the
132 `.bib` file that it doesn't know, it will log a warning. If Ebib finds something
133 that it believes to be incorrect, an error will be logged. If any warnings or
134 errors occur while loading the `.bib` file, Ebib tells you so after loading the
135 file. To view the log file, press `l` in the index buffer.
137 Note that even if it detects warnings or errors, Ebib will try to continue
138 parsing the rest of the `.bib` file. That means that normally, only the entry in
139 which an error occurs is not read. Entries occurring after the problematic one
140 are read.
143 ### Navigating a `.bib` File ###
145 Once you've opened a `.bib` file, the keys of all the entries in the file are
146 shown in alphabetical order in the index buffer in the top Ebib window. (In
147 fact, it is possible to show more than just the entry key in this buffer. See
148 [Index Display Fields](#index-display-fields) on how to accomplish this.) The
149 first entry is highlighted, meaning it is the current entry. The fields it holds
150 and their values are shown in the entry buffer in the bottom Ebib window. The
151 first field is the type field, which tells you what kind of entry you're dealing
152 with (i.e. `book`, `article`, etc.).
154 Below the type field, Ebib displays (up to) three sets of fields. The first set
155 are the so-called obligatory fields, the fields that BibTeX requires to be
156 filled. The second group are the optional fields, which do not have to be filled
157 but which BibTeX will normally add to the bibliography if they do have a value.
158 The third group are the so-called additional fields. These fields are usually
159 ignored by BibTeX (note that BibTeX normally ignores *all* fields it does not
160 know), although there are bibliography styles that treat some of these fields as
161 optional rather than as additional; (i.e., the `harvard` styles do typeset the `url`
162 field, if present.)
164 The first two groups of fields are different for each entry type, while the
165 third group are common to all entry types. You can use the additional fields,
166 for example, to add personal comments to the works in your database. Ebib by
167 default defines the following additional fields: `crossref`, `url`, `annote`,
168 `abstract`, `keywords`, `file` and `timestamp`. If these are not sufficient for
169 you, you need to customise Ebib and add your own fields. (See
170 [Additional Fields](#additional-fields), if you need to find out how to do
171 that.)
173 To move around in the index buffer, you can use the `up` and `down` cursor keys, `C-p`
174 and `C-n`, or for those more used to mutt's key bindings, `k` and `j`. Furthermore,
175 `Space` and `PgDn` move a screenful of entries down, while `b` and `PgUp` move in the
176 other direction. Lastly, `g` and `Home` move to the first entry, while `G` and `End`
177 move to the last one.
179 Ebib is not restricted to opening just one `.bib` file at a time. You can open
180 more files by just typing `o` again and entering the filename. Ebib numbers the
181 databases: the number of each database is shown in the mode line of the index
182 buffer, directly before the database name. The keys 1--9 provide a quick way of
183 jumping from one database to another. Note that the numbering is dynamic: if you
184 have three databases opened and then close the second, database 3 becomes
185 database 2.
187 With the `left` and `right` cursor keys, you can move to the previous or next
188 database. These keys wrap, so if you hit the `left` cursor key while the first
189 database is active, you move to the last database. If you are done with a
190 database and want to close it, type `c`. This closes the current database. It does
191 not leave Ebib, and all other databases you have open will remain so.
194 ### Starting a New `.bib` File ###
196 If you want to start a new `.bib` file from scratch, you cannot just go and enter
197 entries. You first have to give the database a name. So, to start a new
198 database, type `o` first, and give the new file a name. Once you have done this,
199 you can start adding entries to the database.
202 ## Editing the Database ##
204 Of course, being able to open and view `.bib` files is only half the fun. One
205 needs to be able to edit the files as well. Ebib's essential editing
206 facilities are discussed here.
209 ### Adding and Deleting Entries ###
211 To add an entry to a database, you type `a`. When you do this, Ebib first asks you
212 for an entry key, as every entry must be identified by a unique key. Just type a
213 name for the new entry (say `jones1998`). Since the entry key must be unique, Ebib
214 will complain if you enter a key that already exists.
216 You can also have Ebib automatically generate entry keys: if you set the
217 customisation option [Autogenerate Keys](#autogenerate-keys), Ebib does not ask
218 you for a key when you add a new entry. Instead, it creates a temporary key (of
219 the form `<new-entry>`). When you have finished entering the field values for
220 the new entry, Ebib automatically replaces the temporary key with a key that is
221 based on the contents of the `author` (or `editor`), `year` and `title` fields.
223 Note that if you should later decide that you want to change the key of an
224 entry, you can do so with the command `E`. So if you have an entry with the key
225 `jones1998` and you want to add another entry by Jones from 1998, you can call the
226 new one `jones1998b` and rename the existing one to `jones1998a`. Similarly, it
227 is possible to let Ebib recreate an autogenerated key by pressing `K`.
229 Deleting an entry is done with `d`. Be careful with this: you will be asked for
230 confirmation, but once you've confirmed, the entry is gone, and it is not
231 possible to bring it back. There is no undo in Ebib. (If you haven't saved the
232 database yet, it is still possible to retrieve the deleted entry from the `.bib`
233 file, and otherwise it may still be in the backup file that Ebib creates. See
234 [Saving a Database](#saving-database).)
237 ### Editing Fields Values ###
239 Editing the field values for an entry is done in the lower of the two Ebib
240 buffers, the so-called entry buffer. You can move focus to the entry buffer by
241 typing the command `e` in the index buffer.
243 You can move between fields with the same keys that you use to move between
244 entries in the index buffer: the cursor keys `up` and `down`, `C-p` and `C-n`, or `j` and
245 `k`. `Space` and `PgDn` move to the next set of fields, while `PgUp` and `b` move to the
246 previous set of fields. `g` and `G`, and `Home` and `End` also work as expected.
248 Editing a field value can be done with `e`. (In fact, in the entry buffer, `RET`
249 is equivalent to `e`.) For most fields, Ebib simply asks you for a string value in
250 the minibuffer. (Here, `RET` confirms the edit, while `C-g` cancels it.) Although
251 BibTeX requires that field values be surrounded by braces {} (or double quotes
252 "", but Ebib does not use those, even though it can of course handle them when
253 they are used in an existing `.bib` file) you do not need to type these. Ebib adds
254 them when it saves the `.bib` file.
256 Some fields, however, are handled in a special way. The first of these is the
257 `type` field: if you edit this field, you must enter one of the predefined entry
258 types. Ebib won't allow you to enter anything else. You can use tab-completion
259 in this case. Similarly, if you edit the `crossref` field, Ebib requires that you
260 fill in a key from the database. Here, too, you can use tab-completion.
262 Note that if you're adding a new entry, Ebib automatically puts you in the entry
263 buffer after you've typed the entry key: you don't have to type `e` to move to the
264 entry buffer. When creating a new entry, it is best to set the `type` field first,
265 because the `type` field determines which other fields are available for an entry.
267 Note also that after editing a field, Ebib (usually) puts you on the next field.
268 This is convenient if you're creating a new entry and need to fill out several
269 fields in a row.
271 If you're done editing the fields of the entry, type `q` to move focus back to the
272 index buffer. (Note: keys may have different functions in the index buffer and
273 the entry buffer. `q` is a typical example: in the entry buffer, it quits editing
274 the entry and moves focus back to the index buffer. In the index buffer,
275 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` field.
282 Most field values normally consist of a single line of text. However, because
283 the `annote` field is meant for creating annotated bibliographies, it would not
284 be very useful if you could only write one line of text in this field.
285 Therefore, when you edit the `annote` field, Ebib puts you in the so-called
286 *multiline edit buffer*. This is essentially a text mode buffer that allows you
287 to enter as much text as you like. To store the text and leave the multiline
288 edit buffer, type `C-c | q`.
290 If you want to leave the multiline edit buffer without saving the text you have
291 just typed, type `C-c | c`. This command cancels the edit and leaves the multiline
292 edit buffer. The text that is stored in the field you were editing is not
293 altered.
295 Multiline values are not restricted to the `annote` field. Any field can in fact
296 hold a multiline value. (Except of course the `type` and `crossref` fields.) To give
297 a field a multiline value, use `l` instead of `e`. You will again be put in the
298 multiline edit buffer, where you can edit the value. Note that you can use `l`
299 even if a field already has a single line value. Ebib will just make that the
300 first line in the multiline edit buffer.
302 When a field has a multiline value, only the first line is shown in the entry
303 buffer, for space reasons. To indicate that the value is multiline, a plus sign
304 `+` is placed in front of the value.
306 By the way, the `e` key is smart about the way an entry must be edited. If you
307 press `e` on a field that already has a multiline value, regardless of the fact
308 whether it is the `annote` field or not, Ebib puts you in the multiline edit
309 buffer. Therefore, you need `l` only if you want to give a field a multiline value
310 when it doesn't have one yet.
312 For more details on working with the multiline edit buffer, see
313 [The Multiline Edit Buffer](#multiline-edit-buffer).
316 ### Copy, Cut, Paste (Yank), and Delete ###
318 A few more commands are available when you're in the entry buffer editing field
319 values. The commands `c`, `x` and `y` implement a copy and paste system: `c` copies the
320 contents of the current field to the kill ring, `x` kills the contents of the
321 current field to the kill ring, and `y` yanks (pastes) the most recently killed
322 text in the kill ring. You can type `y` repeatedly to get the same effect you get
323 in Emacs when you type `M-y` after an initial `C-y`: every additional use of `y` moves
324 back in the kill ring.
326 Lastly, there is the command `d`, which deletes the contents of the current field
327 without storing the text in the kill ring. (It asks for confirmation, though,
328 just to make sure.)
330 Note that `y` only works when the current field does not have a value yet. This is
331 to prevent you from accidentally overwriting a field value. If you do want to
332 yank text into a field that already has a value, simply hit `d` first to delete
333 the text.
336 ## Saving a Database ##
338 When you have undertaken any kind of editing action on a database, it is marked
339 as modified, which is indicated in the mode line for the index buffer. A
340 modified database can be saved by typing `s`. This saves the database to the file
341 it was loaded from without asking for confirmation. (It is similar to `C-x C-s` in
342 Emacs.) If you're saving a file for the first time after loading it, Ebib
343 creates a backup file under the same name appended with a tilde:
344 `<filename>.bib~`.
346 If you have multiple databases open, have made changes in more than one of them,
347 and want to save all of them without going through each yourself, you can save
348 all databases at once through the menu.
350 The menu also provides a way to save the database to another name. This command
351 is similar to `C-x C-w` in Emacs, so that after using it, the new `.bib` file
352 becomes associated with the database.
355 ## Searching ##
357 Ebib provides several search methods. First, if you are in the index buffer, the
358 normal Emacs incremental searches, `C-s` and `C-r`, function as expected. You
359 can use them to search entry keys. Note that once you've found the key you're
360 searching, you must hit `RET` to quit the search and again `RET` to make the
361 entry you found active. Ebib does not update the entry buffer during incremental
362 search, as this would be rather pointless: you're only interested in the entry
363 you're searching for, not in the entries you pass along the way.
365 Of course, it is also possible to search the database itself. If you type `/`,
366 Ebib asks you for a search term. This can be a regular expression, to allow for
367 flexibility in searching. After hitting `RET`, Ebib will start searching the
368 database (starting from the current entry, *not* from the first entry!) and will
369 display the entry with the first occurrence of the search string that it finds.
370 All the occurrences of the search string in that entry are highlighted.
372 Ebib searches all the fields of each entry. It is not possible with `/` to specify
373 the fields to search. Note that if the search term is found in a field with a
374 multiline value, Ebib will highlight the `+` sign that it displays in front of the
375 field value. Keep an eye out for this when doing a search, because Ebib only
376 shows the first line of multiline values, and if the search term appears in
377 another line, the highlighted `+` is the only indication that the search term was
378 found. (Well, that and the fact that Ebib does *not* say `Search string not found`,
379 of course...)
381 A search term may of course appear more than once in the database. To search for
382 the next occurrence, type `n`. This will continue searching for the search string
383 in the rest of the database. Again, the first entry found to contain the search
384 string is displayed. Note that `n` does not wrap: if the end of the database is
385 reached, Ebib stops searching. To continue searching from the top, hit `g` and
386 then `n`.
388 The functions described here form Ebib's basic search functionality. Ebib also
389 has a much more powerful search mechanism in the form of *virtual databases*.
390 These are described later. (See [Virtual Databases](#virtual-databases).)
393 ## LaTeX Integration ##
395 Having a BibTeX database manager running inside Emacs has an additional
396 advantage: it makes it trivially easy to insert BibTeX keys in your LaTeX
397 documents.
399 Ebib provides two functions for this. First, if you're in a LaTeX buffer, you
400 can call the function `ebib-insert-bibtex-key`. When you invoke this command,
401 Emacs prompts you for a key from the database(s) associated with the current
402 buffer, a citation command (that has to be typed *without* the backslash) and
403 any optional argument(s) the command allows. You can type the key using
404 TAB-completion, and after hitting `RET`, Emacs puts a BibTeX citation at the
405 cursor position in the current buffer with the key you selected.
407 You can also do it the other way around: if you're in the index buffer in Ebib,
408 you can *push* an entry to a LaTeX buffer. To do this, use the command `p`. Ebib
409 will ask you for a buffer to push the entry to, a citation command and also any
410 optional arguments, and then insert a citation at the current cursor position in
411 the buffer you've supplied.
413 The citation command that `ebib-insert-bibtex-key` and the command key `p` ask for
414 can be any command that you need. But it is also possible to predefine a list of
415 citation commands which you can then enter at this prompt using tab completion.
416 For details on setting this up, see [Insertion Commands](#insertion-commands).
418 There is another function that is available outside Ebib: `ebib-entry-summary`.
419 This command reads the key under the cursor in the current buffer and displays
420 the field values associated with that key in a `*Help*` buffer. This allows you to
421 quickly check a reference in a text.
423 Probably the easiest way to use both `ebib-insert-bibtex-key` and
424 `ebib-entry-summary` is to bind them to a key sequence. For example, you could put
425 the following in your `~/.emacs`:
427     (add-hook 'LaTeX-mode-hook #'(lambda ()
428                                    (local-set-key "\C-cb" 'ebib-insert-bibtex-key)))
430 This binds `C-c b` to the command `ebib-insert-bibtex-key` in AUCTeX's LaTeX mode.
431 (Note that commands of the form `C-c <letter>` are reserved for the user, and
432 should therefore not be set by any package. For this reasons, Ebib does not set
433 this command automatically.)
436 ## Consulting Databases from within a LaTeX File ##
438 The commands `ebib-insert-bibtex-key` and `ebib-entry-summary` must consult the
439 database or databases loaded in Ebib, and Ebib tries to be smart about which
440 database(s) to consult. Usually, a LaTeX file has a `\bibliography` command
441 somewhere toward the end, which names the `.bib` file or files that contain the
442 bibliography entries. If you consult a BibTeX database from within a LaTeX file,
443 Ebib first looks for a `\bibliography` command, reads the `.bib` files from it, and
444 then sees if those files happen to be open. If they are, Ebib uses them to let
445 you pick an entry key (in the case of `ebib-insert-entry-key`) or to search for
446 the entry (in the case of `ebib-entry-summary`).
448 Of course, it may be the case that the LaTeX file is actually part of a bigger
449 project, and that only the master file contains a `\bibliography` command. To
450 accommodate for this, Ebib checks whether the (buffer-local) variable `TeX-master`
451 is set to a filename. If it is, it reads that file and tries to find the
452 `\bibliography` command there. (Note: `TeX-master` is an AUCTeX variable, which is
453 used to keep track of multi-file projects. If you don't use AUCTeX, this
454 functionality doesn't work, and Ebib will only check the current file for a
455 `\bibliography` command.)
457 Note that if one of the `.bib` files in the `\bibliography` command isn't loaded,
458 Ebib issues a warning message about this, and continues to check for the next
459 `.bib` file. These warning messages appear in the minibuffer, but are probably
460 directly overwritten again by further messages or prompts Ebib produces, so
461 check the `*Messages*` buffer if Ebib doesn't seem to be able to find an entry
462 that you're sure is in one of your databases.
464 Another thing to keep in mind is that Ebib only looks for a `\bibliography`
465 command once: the first time either `ebib-insert-bibtex-entry` or
466 `ebib-entry-summary` is called. It stores the result of this search and uses it
467 the next time either of these commands is used. Therefore, if you make a change
468 to the `\bibliography` command, you must reload the file (use `M-x revert-buffer`)
469 to make sure Ebib rereads the `\bibliography` command.
471 If no `\bibliography` command is found at all, either in the LaTeX file itself, or
472 in the master file, Ebib simply consults the current database, i.e. the database
473 that was active when Ebib was lowered with `z`.
476 ## Cross-referencing ##
478 BibTeX has a cross-referencing facility. Suppose you have an entry `jones1998`,
479 which appeared in a book that is also in your database, say under `miller1998`.
480 You can tell BibTeX that `jones1998` is contained in `miller1998` by putting
481 `miller1998` in the `crossref` field. When BibTeX finds such a cross-reference, all
482 the fields of `jones1998` that don't have a value inherit their values from
483 `miller1998`. At the very least, this saves you some typing, but more importantly,
484 if two or more entries cross-reference the same entry, BibTeX automatically
485 includes the cross-referenced entry in the bibliography (and puts a reduced
486 reference in the cross-referencing entries).
488 When you fill in the `crossref` field in Ebib, Ebib displays the values of the
489 cross-referenced entry in the entry buffer. To indicate that they are just
490 inherited values, they are marked with `ebib-crossref-face`, which by default is
491 red. (You can customise it, of course. See the customisation option
492 [Crossref Face](#crossref-face).) These values are just displayed for convenience: otherwise, Ebib
493 treats these fields as if they are empty. That is, they cannot be edited (to
494 edit them, you need to edit the cross-referenced entry), and it's not possible
495 to copy these values to the kill ring.
497 If you're viewing an entry that has a cross-reference and you want to go to the
498 cross-referenced entry you can type `F`. This command reads the value of the
499 `crossref` field and then displays that entry. If you want to do the reverse,
500 i.e., see if the current entry is cross-referenced by any other entries, you can
501 use the key `N`. What this command actually does is to make the key of the current
502 entry the current search string and to search for its first occurrence *after* the
503 current entry. Like the normal search command `/`, `N` does not wrap and only
504 searches forward. So if you want to search for the next cross-referencing entry
505 you need to press `n` (i.e., lowercase `n`), and to continue searching from the
506 first entry, press `g` followed by `n`.
508 Note that if you want to use BibTeX's cross-referencing options, you need to set
509 the option [Save Xrefs first](#save-xrefs-first). This tells Ebib to save all entries with a `crossref`
510 field first in the `.bib` file. Without this, BibTeX's cross-referencing will not
511 work reliably.
514 ## Selecting Entries ##
516 Commands in the index buffer generally operate on one single entry, or on all
517 entries. For some, however, it may sometimes be useful to perform them on more
518 than one entry, but not necessarily all of them. This can be achieved by selecting
519 entries. You can select the entries you want to perform a command on with the key
520 `m`. This selects (or unselects) the current entry. Selected entries are displayed in
521 inverse video (in GNU Emacs) or white on red (in XEmacs; note that the face
522 properties of selected entries can be customised through the customisation option
523 [Selected Face](#selected-face).)
525 Of the commands discussed so far, two can be used on selected entries: `d` and `p`.
526 Note, however, that it is not enough to select the entries you want and then type
527 any of these commands. If you do so, they will behave as if no entries were
528 selected. To get these commands to work on the selected entries, you have to type a
529 semicolon before them. That is, `; d` deletes all selected entries, `; p` pushes all
530 selected entries to a LaTeX buffer. The command `m` itself can also be used with the
531 `;` prefix. If there are any selected entries, `; m` unselects them all. Otherwise, `; m`
532 selects all entries.
534 When using `; p` to push all selected entries to a LaTeX buffer, they are put in a
535 single citation command, separated by commas. Ebib does not create a citation
536 command for each entry separately.
539 ## Printing the Database ##
541 Sometimes it may be useful to have a `.pdf` file or print-out of your database.
542 Although Ebib does not actually do the printing itself, it can create a LaTeX
543 file for you that you can compile and print. In fact, there are two ways of
544 doing this.
546 The print options are available in the Ebib menu when the index buffer is
547 active. You can print the entries as index cards or as a bibliography.
549 If you print your entries as a bibliography, Ebib creates a simple LaTeX
550 document that essentially contains a <verb>\nocite{*}</verb> command followed by
551 a <verb>\bibliography</verb> command referring to the `.bib` file belonging to the
552 current database. You can then run the usual sequence of LaTeX, BibTeX, LaTeX,
553 LaTeX on this file, creating a document containing a list of all the references
554 in your database.
556 If you choose to print as index cards, Ebib also creates a LaTeX file. However,
557 instead of simply providing a <verb>\nocite{*}</verb> command, this file
558 contains a `tabular` environment for each entry in the database listing all the
559 fields of that entry and their values.
561 The entries are separated by a `\bigskip`, but if you set the option `Print Newpage`
562 in the customisation buffer (or in the Print menu), the entries are separated by
563 a `\newpage`, so that every entry is on a separate page. The latter option is
564 useful when printing actual index cards (though you'd probably have to change
565 the page size with the `geometry` package as well).
567 By default, the index cards only show single-line field values. That is,
568 multiline values are normally excluded. If you want to include multiline values
569 in the print-out, you have to set the option `Print Multiline` in the Options menu
570 or in Ebib's customisation buffer. (See [The Customisation Buffer](#customisation-buffer).) With this
571 option set, Ebib includes all multiline values in the LaTeX file that it
572 creates. Note however that Ebib does not change anything about the formatting of
573 the text in a multiline value. So if you plan to make (heavy) use of this
574 option, make sure that the way you type your text conforms to LaTeX's
575 conventions (e.g. empty lines to mark paragraphs, etc.) and doesn't contain any
576 characters such as `&` that are illegal in LaTeX. (Or, alternatively, use LaTeX
577 code in your multiline fields.)
579 As mentioned, when you "print" the database, Ebib really just creates a LaTeX
580 file. More precisely, it creates a temporary buffer and writes the LaTeX code
581 into it, and then saves the contents of that buffer to a file. After it has done
582 that, Ebib lowers itself and instruct Emacs to open the file in a buffer, which
583 will then be properly set up as a LaTeX buffer. From there you can run LaTeX and
584 view the result.
586 Before doing all this, Ebib asks you which file to write to. Be careful with
587 this: since this is supposed to be a temporary file, Ebib simply assumes that if
588 you provide a filename of an existing file, it can overwrite that file without
589 warning!
591 A better way to tell Ebib which file to use is to set the option `Print Tempfile`
592 in Ebib's customisation buffer to some temporary file. When this option is set,
593 Ebib will always use this file to write to, and will not ask you for a filename
594 anymore.
596 Note that both print options operate on all entries of the database. If there
597 are selected entries in the database, however, only those are printed.
599 There are two more customisation options for printing the database. These are
600 `Print Preamble` and `LaTeX Preamble`. With these options, you can specify what
601 Ebib should put in the preamble of the LaTeX files it creates. Use this if you
602 want to use specific packages (e.g. `\usepackage{a4}` or `\usepackage{times})`.
603 This is especially useful for printing a bibliography, since by default, Ebib
604 uses BibTeX's standard bibliography style. With the option `LaTeX Preamble` you
605 can set your preferred bibliography style. Details are discussed in the chapter
606 on customisation, see [The Customisation Buffer](#customisation-buffer).
610 ## Calling a Browser ##
612 With more and more scientific literature becoming available on-line, it becomes
613 common to store URLs in a BibTeX database. Sometimes you may want to load such a
614 URL in your browser. Ebib provides a convenient way for doing so.
616 If you type `u` in the index buffer, Ebib takes the first URL stored in the `url`
617 field of the current entry and passes it to your browser. Furthermore, in the
618 entry buffer, you can use `u` on *any* field. If you happen to have more than one
619 URL stored in the relevant field, and you want to pass the second (or third,
620 etc.) to the browser, you can use a prefix argument. So typing `M-2 u` sends the
621 second URL to your browser, `M-3 u` the third, and so on.
623 It is not even necessary that the relevant field contains *only* URLs. It may
624 contain other text mixed with the URLs: Ebib simply searches the URLs in the
625 field and ignores the rest of the text. Ebib considers every string of
626 characters that starts with `http://` or `https://` and that does not contain
627 whitespace or any of the characters `" ' <` or `>` as a URL. Furthermore, Ebib
628 regards everything that is enclosed in a LaTeX `\url{...}` command as a URL.
629 This behaviour is controlled by a regular expression that can be customised.
630 (See [Url Regexp](#url-regexp).)
632 There exists an Emacs function `browse-url`, which provides a nifty interface to
633 calling an external browser. In principle, Ebib uses this function. However, if
634 this function is not present on your installation, you can set the option
635 [Browser Command](#browser-command) to call the browser.
637 As just explained, if you press `u` in the index buffer, Ebib searches the `url`
638 field of the current entry for URLs. If you have the habit of putting your URLs
639 in another field, however, you may change the customisation option
640 [Standard Url Field](#standard-url-field) and tell Ebib to use another field for searching the URLs.
641 (Keep in mind, though, that in the entry buffer, you can load a URL from any
642 field.)
645 ## Viewing Files ##
647 If you have electronic versions of the papers in your database stored on your
648 computer, you can use Ebib to call external viewers for these files. The
649 interface for this is similar to that for calling a browser: if you press `f` in
650 the index buffer, Ebib searches the `file` field for a filename and when it finds
651 one, calls an appropriate viewer.
653 Just as with `u`, you can use `f` in the entry buffer as well, in which case it can
654 be used on any field, not just the `file` field. It is also possible to have more
655 than one filename in a field: you can select the one you want to view with the
656 prefix argument.
658 Just as in the case of URLs, you can customise several things about the file
659 view functionality. The option [Standard File Field](#standard-file-field) allows you to customise the
660 field that `f` extracts filenames from when pressed in the index buffer.
661 Extracting filenames is done with a regular expression, which can be customised
662 through the option [File Regexp](#file-regexp).
664 The option [File Search Dirs](#file-search-dirs) allows you to tell Ebib which directories it needs
665 to search for files. The default value is `~`, which means Ebib just looks in your
666 home dir. Since this is probably not where you keep your files, you may want to
667 customise this. Note that you can specify more than one directory.
669 Note that Ebib does not search directories recursively. It is possible, however,
670 to put subdirectories in the filenames. That is, if you put something like
671 `a/abney1987.pdf` in the `file` field, Ebib searches for the relevant file in a
672 subdirectory `a/` of the directories listed in the option `File Search Dirs`. (Note
673 that if you want to do this under Windows, you may want to remove the backslash
674 from the file regexp.)
676 Ebib can call different external programs depending on the file type of the
677 relevant file, but you have to specify which programs to call. The option
678 [File Associations](#file-associations) allows you to do this. By default, `.pdf` and `.ps` files are
679 handled, by `xpdf` and `gv`, respectively. You can specify further file types by
680 their extensions (do not include the dot). The program is searched for in `PATH`,
681 but you can of course specify the full path to the program.
684 # Advanced Features # 
686 The features discussed in the previous chapter should be sufficient to get
687 started using Ebib. However, Ebib has several more advanced features, which are
688 described in this chapter.
691 ## Screen Layout ##
693 By default, Ebib takes over the entire Emacs frame it is started in. If you have
694 a wide enough screen, however, it may be more convenient to have Ebib take up
695 only part of the frame, so that you can have the LaTeX text you're working on
696 and Ebib visible at the same time. The option [Layout](#layout) allows you to
697 do this, by giving you the ability to choose between a full-frame or a
698 split-frame layout.
700 In the split-frame layout, the Ebib windows are displayed on the right of the
701 current frame, with the left part free for your document. In this layout, some
702 aspects of Ebib behave somewhat differently. Most importantly, the multiline
703 edit buffer is not displayed in the lower Ebib window, but in the non-Ebib
704 window on the left. (Obviously, after leaving the multiline edit buffer, the
705 original buffer is restored to that window.)
707 Furthermore, pressing `z` in the index buffer leaves Ebib, but keeps the buffers
708 visible. You can get back to Ebib with the command `M-x ebib` (or any key bound to
709 it, of course), or simply by manually switching to the index buffer. If you want
710 to remove the Ebib buffers from the frame but keep Ebib in the background, you
711 can use `Z` (i.e. uppercase `Z`) in the index buffer. (Note that `Z` is also available
712 in the full-frame layout, but there it is identical to `z`.)
714 Lastly, the command `ebib-entry-summary` checks whether the Ebib buffers are
715 visible in the frame. If they are, it does not output the entry info in a `*Help*`
716 buffer, but rather displays the entry in Ebib itself.
719 ## Preloading `.bib` Files ##
721 Chances are that you will be doing most of your work with one or a few `.bib`
722 files, and you may find yourself opening the same file or files every time you
723 start Ebib. If so, you can tell Ebib to always load specific `.bib` files on
724 startup. To do this, specify the files in Ebib's customisation buffer, under the
725 option [Preload Bib Files](#preload-bib-files).
728 ## `@Preamble` Definition ##
730 Apart from database entries, BibTeX allows three more types of elements to
731 appear in a `.bib` file. These are `@comment`, `@preamble` and `@string` definitions.
732 Ebib provides facilities to handle the latter two. `@comment` definitions cannot
733 be added to a `.bib` file through Ebib, and if Ebib finds one in a `.bib` file, it
734 is simply ignored (and dropped from the file when you save it).
736 `@preamble` and `@string` definitions can be handled, however. Ebib allows you to
737 add one `@preamble` definition to the database. In principle, BibTeX allows more
738 than one such definition, but really one suffices, because you can use the
739 concatenation character `#` to include multiple TeX or LaTeX commands. So, rather
740 than having two `@preamble` definitions such as:
742     @preamble{ "\newcommand{\noopsort}[1]{} " }
743     @preamble{ "\newcommand{\singleletter}[1]{#1} " }
745 you can write this in your `.bib` file:
747     @preamble{ "\newcommand{\noopsort}[1]{} "
748              # "\newcommand{\singleletter}[1]{#1} " }
750 Creating or editing a `@preamble` definition in Ebib is done by hitting `P`
751 (uppercase `P`) in the index buffer. Ebib uses the multiline edit buffer for
752 editing the text of the `@preamble` definition, which means that as discussed
753 above, `C-c | q` stores the `@preamble` text and returns focus to the index buffer,
754 while `C-c | c` returns focus to the index buffer while abandoning any changes you
755 may have made. (For details on using the multiline edit buffer, see
756 [The Multiline Edit Buffer](#multiline-edit-buffer).)
758 In order to create a `@preamble` as shown above in Ebib, you only have to type the
759 text between the braces. Ebib takes care of including the braces of the
760 `@preamble` command, but otherwise it saves the text exactly as you enter it. So
761 in order to get the preamble above, you'd have to type the following in Ebib:
763     "\newcommand{\noopsort}[1]{} "
764     # "\newcommand{\singleletter}[1]{#1} "
766 Note that when Ebib loads a `.bib` file that contains more than one `@preamble`
767 definition, it concatenates all the strings in them in the manner just described
768 and saves them in one `@preamble` definition.
771 ## `@String` Definitions ##
773 If you press `S` (that's a uppercase `S`) in the index buffer, Ebib hides the entry
774 buffer in the lower window and replaces it with the *strings buffer*. In this
775 buffer, you can add, delete and edit `@string` definitions.
777 Adding a `@string` definition is done with the command `a`. This will first ask you
778 for an abbreviation and then for the value to be associated with that
779 abbreviation. Once you've entered these, Ebib will sort the new abbreviation
780 into the buffer.
782 Moving between the `@string` definitions can be done in the usual way: the cursor
783 keys `up` and `down`, `C-p` and `C-n` and `k` and `j` move up and down. `Space` and `PgDn` move
784 ten strings down, while `b` and `PgUp` move in the other direction. The keys `g`, `G`,
785 `Home` and `End` also function as expected.
787 To delete a `@string` definition, use `d`. To edit the value of a definition, use `e`.
788 There is also a command `c`, which copies the value of the current `@string`
789 definition to the kill ring. Unlike in the entry buffer, there are no
790 corresponing commands `y` and `x`. (In fact, `x` does exist, but has another
791 function.) Yanking from the kill ring can be done with `C-y/M-y` in the minibuffer
792 when you edit a `@string`'s value. Cutting a `@string`'s value is pointless,
793 because a `@string` definition must have a value.
795 Having defined `@string` definitions, there must of course be a way to use them.
796 Just giving a field a string abbreviation as value will not do, because Ebib
797 puts braces around the value that you enter when it writes the `.bib` file, so
798 that BibTeX will not recognise the abbreviation, and will not expand it. BibTeX
799 will only recognise an abbreviation if it appears in the `.bib` file outside of
800 any braces.
802 To accomplish this, you must mark a field's value as *raw*. A raw field is a field
803 whose value is not surrounded by braces when the database is saved, so that
804 BibTeX recognises it as an abbreviation. To mark a field raw, press `r`. An
805 asterisk will appear before the field, indicating that it is raw. Pressing `r`
806 again will change the field back to normal. If you press `r` on a field that does
807 not have a value yet, Ebib will ask you for one.
809 Note that this also makes it possible to enter field values that are composed of
810 concatenations of strings and abbreviations. The BibTeX documentation for
811 example explains that if you have defined:
813     @string{WGA = "World Gnus Almanac"}
815 you can create a BibTeX field like this:
817     title = 1966 # WGA
819 which will produce "1966 World Gnus Almanac". Or you can do:
821     month = "1~" # jan
823 which will produce someting like "1 January", assuming your bibliography style
824 has defined the abbreviation `jan`. All this is possible with Ebib, simply by
825 entering the exact text including quotes or braces around the strings, and
826 marking the relevant field as raw.
828 An easy way to enter a `@string` abbreviation as a field value is to use the key `s`
829 instead of `e`. If you type `s`, Ebib asks you for a `@string` abbreviation to put in
830 the current field, and automatically marks the field as raw. With this command,
831 Ebib only accepts `@string` definitions that are in the database, so that by using
832 `s` you can make sure you don't make any typos. Note that you can use tab
833 completion to complete a partial string.
836 ## Sorting the `.bib` File ##
838 By default, the entries in the database are saved to the `.bib` file in
839 alphabetical order according to entry key. If you only deal with the `.bib` file
840 through Ebib, you may not care in which order the entries are saved. However, it
841 may sometimes be desirable to be able to specify the sort order of entries in
842 more detail. (Apparently, this can be useful with ConTeXt, for example.)
844 You can specify a sort order in Ebib's customisation buffer. To sort the
845 entries, you must set at least one sort level (that is, a field to sort the
846 entries on). You can also specify more than one sort level: if two entries have
847 identical values for the first sort level, they will be sorted on the second
848 sort level. E.g., if the first sort level is `author` and the second is `year`, then
849 the entries are sorted by author, and those entries that have identical values
850 for the `author` field are sorted by year.
852 A sort level is not restricted to a single field. You can specify more fields
853 for a single sort level. Within a single sort level, a second sort field is used
854 if the first sort field does not have a value. For example, books that have an
855 editor instead of an author will have an empty `author` field. If you sort the
856 database on the `author` field, such entries will all appear at the beginning of
857 the `.bib` file, which is most likely not what you want.
859 To remedy this, you can specify both the `author` and the `editor` fields for the
860 first sort level. Ebib will then sort an entry on its `author` field if it has a
861 value, and will otherwise use the value of the `editor` field.
863 The difference between two sort fields within one sort level and two sort levels
864 is that a second sort *field* is an alternative for the first field when it has no
865 value, while a second sort *level* is an additional sort criterion when two or
866 more entries cannot be sorted on the first level, because they have identical
867 values.
869 By default, the option `Sort Order` has no value, which means that the entries in
870 the `.bib` file are sorted according to entry key. Those that wish to customise
871 the sort order will usually want to set the first sort level to `author editor`,
872 and the second to `year`. In that way, the entries in the `.bib` file are sorted
873 according to author/editor, and entries with the same author/editor are sorted
874 by year.
876 Entries that cannot be sorted on some sort level, because the sort fields are
877 empty, are sorted on entry key. (Keep in mind that if the first sort level
878 yields *no value* for a specific entry, Ebib does *not* use the second sort level to
879 sort that entry. It uses the entry key. The second sort level is only used if
880 the first yields *identical* values for two or more entries.)
882 Note that if you have set the option `Save Xrefs First` (see
883 [Cross-referencing](#cross-referencing)), it is pointless to set a sort order.
884 Saving cross-referencing entries first messes up any sort order, so Ebib simply
885 ignores the sort order if `Save Xrefs First` is set.
888 ## Merging and Importing ##
890 As described in the previous chapter, adding entries to a database can be done
891 manually with the key `a`. There are other ways of adding entries to a database,
892 however.
894 In the index buffer, the Ebib menu has an option to merge a second .bib file
895 into the current database. Ebib reads the entries in this file and adds them to
896 the database. Duplicate entries (that is, entries with an entry key that already
897 exists in the database) will not be loaded. Ebib logs a warning about each
898 duplicate entry to its log buffer and displays a warning after loading the `.bib`
899 file when this happens.
901 Another way to add entries to a database is to import them from an Emacs buffer.
902 If, for example, you find ready-formatted BibTeX entries in a text file or e.g.
903 on the internet, you can copy & paste them to any Emacs buffer (e.g. the
904 `*scratch*` buffer), and then execute the command `M-x ebib-import`. Ebib then goes
905 through the buffer and loads all BibTeX entries it finds into the current
906 database (i.e. the database that was active when you lowered Ebib). If you call
907 `ebib-import` while the region is active, Ebib only reads the BibTeX entries in
908 the region.
911 ## Exporting Entries ##
913 Sometimes it can be useful to copy entries from one database to another, or to
914 create a new `.bib` file with several entries from an existing database. For this
915 purpose, Ebib provides exporting facilities. To export an entry to a `.bib` file,
916 use the command `x`. Ebib will ask you for a filename to export the entry to. (If
917 you have already exported an entry before, Ebib will present the filename you
918 used as default, but you can of course change it.)
920 For obvious reasons, Ebib appends the entry to the file that you enter if it
921 already exists, it does not overwrite the file. If this is not what you want,
922 delete the file first, as Ebib provides no way to do this.
924 If you have more than one database open in Ebib, it is also possible to copy
925 entries from one database to another. To do this, use the `x` command with a
926 numeric prefix argument. E.g., if the database you want to export an entry to is
927 the second database, type `M-2 x` to export the current entry to it. The number of
928 the database is given in the modeline of the index buffer.
930 If the database you're copying an entry to already contains an entry with the
931 same entry key, Ebib won't copy the entry, and issues an appropriate warning
932 message.
934 Note that the command `x` can operate on selected entries. So to export several
935 entries in one go select them and type `; x`. You can use a prefix argument in the
936 normal way: `M-2 ; x` exports the selected entries to database 2.
938 Apart from entries, it is also possible to export the `@preamble` and `@string`
939 definitions. The `@preamble` definition is exported with the command `X` in the
940 index buffer. `@string` definitions can be exported in the strings buffer: `x` in
941 this buffer exports the current string, while `X` exports all `@string` definitions
942 in one go. All these commands function in the same way: when used without a
943 prefix argument, they ask for a filename, and then append the relevent data to
944 that file. With a numeric prefix argument, they copy the relevant data to the
945 corresponding open database.
948 ## Timestamps ##
950 Ebib provides the possibility to add a timestamp to every new entry, recording
951 the time it was added to the database. The timestamp is recorded in the
952 (additional) field `timestamp`. (By default, this field is not shown, but you can
953 make it visible by checking the option "Show Hidden Fields" in the Options
954 menu.)
956 You can tell Ebib to create timestamps by setting the option `Use Timestamp` in
957 Ebib's customisation buffer. With this option set, a timestamp is included in
958 entries added to the database with `a`. Ebib will also add a timestamp to entries
959 imported from a buffer or merged from a file, and to entries exported to another
960 database or to a file. When importing or exporting entries, existing timestamps
961 will be overwritten. The logic behind this is that the timestamp records the
962 date and time when the entry was added to the database, not when it was first
963 created.
965 Note that if this option is unset, the timestamp of an entry is retained when
966 it's imported or exported. Therefore, if you record timestamps and want to
967 im-/export entries without changing their timestamps, temporarily unset this
968 option.
970 Ebib uses the function `format-time-string` to create the timestamp. The format
971 string that Ebib uses can be customised in Ebib's customisation buffer. The
972 default string is `"%a %b` `%e %T %Y"`, which produces a timestamp of the form
973 `"Mon Mar 12 01:03:26 2007"`. Obviously, this string is not suited for sorting,
974 so if you want to be able to sort on timestamps, you'll need to customise the
975 format string. See the documentation for `format-time-string` on the options
976 that are available.
979 ## Multiple Identical Fields ##
981 Under normal circumstances, a BibTeX entry only contains one occurrence of each
982 field. If BibTeX notices that an entry contains more than one occurrence of an
983 obligatory or optional field, it issues a warning. Ebib is somewhat less
984 gracious, it simply takes the value of the last occurrence without giving any
985 warning. (Note, by the way, that BibTeX will use the value of the *first*
986 occurrence, not the last.) When additional fields appear more than once in an
987 entry, BibTeX does not warn you, since it ignores those fields anyway. Here,
988 too, Ebib's standard behaviour is to ignore all but the last value.
990 However, some online reference management services "use" this feature of
991 BibTeX in that they put multiple `keywords` fields in the BibTeX entries that they
992 produce. If you were to import such an entry into Ebib, you would lose all your
993 keywords except the last one. To remedy this, you can tell Ebib that it should
994 allow multiple occurrences of a single field in a BibTeX entry. You can do this
995 by setting the customisation option [Allow Identical Fields](#allow-identical-fields).
997 With this option set, Ebib collapses the multiple occurrences into a single
998 occurrence. All the values of the different occurrences are collected and stored
999 in the single occurrence, separated by semicolons. That is, Ebib does not retain
1000 the multiple occurrences, but it does retain the values. So suppose you have an
1001 entry that contains the following `keywords` fields:
1003     @book{jones1998,
1004         author = {Jones, Joan},
1005         year = {1998},
1006         ...
1007         keywords = {sleep},
1008         keywords = {winter},
1009         keywords = {hybernation}
1010     }
1011     
1012 If you load this entry into Ebib with the option `Allow Identical Fields` set, you
1013 will get the following:
1015     @book{jones1998,
1016         author = {Jones, Joan},
1017         year = {1998},
1018         ...
1019         keywords = {sleep; winter; hybernation}
1020     }
1023 ## Virtual Databases ##
1025 In the previous chapter, Ebib's basic search functionality was discussed. (See
1026 [Searching](#searching).) Ebib also provides a much more sophisticated search
1027 and filtering mechanism in the form of *virtual databases*.
1029 A virtual database is a database that is not associated with any `.bib` file.
1030 Rather, it is created from another database by selecting entries from it based
1031 on a specific search pattern, called a *filter*. This allows you, for example, to
1032 select all entries from a database that contain the string "Jones" in their
1033 `author` field. A filter can be as complex as you want: you can select all entries
1034 that do *not* contain "Jones" in the `author` field, or all entries that contain
1035 "Jones" in either the `author` or the `editor` field, or all entries that contain
1036 "Jones" in the `author` field, and "symbiotic hybernation" in the `keyword`
1037 field, etc. Basically, the filter can consist of an arbitray number of search
1038 criteria combined with the logical operators `and, or` and `not`.
1041 ### Simple Selection ###
1043 Creating a virtual database is simple: press `&`, and Ebib will ask you for a
1044 field to select on, and for a regular expression to select with. So if you want
1045 to select all entries that contain "Jones" in the `author` field, you press `&`
1046 and type `author` as the field and `Jones` as the regexp to filter on.
1048 Ebib will then create a virtual database containing the entries matching your
1049 selection criterion. A virtual database has the same name as the database it is
1050 based on, prepended with `V:`. It also has a number like any other database, and
1051 you can move back and forth to other databases with the number or cursor keys.
1053 If you don't want to filter on one specific field but rather want to select all
1054 entries that match a certain regexp in any field, you can type `any` as the field
1055 to filter on. So specifying `any` as the field and `Jones` as the regexp, the
1056 virtual database will select all entries that have a field that contains
1057 "Jones" in them.
1060 ### Complex Filters ###
1062 Once you have a virtual database, it remains associated with the database it was
1063 created from. This means that you can refine or extend the selection (i.e. the
1064 filter) that the virtual database is based on. If, in the current example, you
1065 want to include all the entries that have "Jones" in the `editor` field, you
1066 have to perform a logical `or` operation: you want to select an entry if it
1067 contains "Jones" in the `author` field (which you already did) *or* if it contains
1068 "Jones" in the `editor` field.
1070 A short sidenote: the first impulse in a case like this might be to use `and`
1071 instead of `or`: after all, you want to select all entries that contain "Jones"
1072 in the `author` field *and* all entries that contain "Jones" in the `editor` field.
1073 However, the filter that you build up is used to test each entry *individually*
1074 whether it meets the selection criterion. An entry meets the criterion if it
1075 contains "Jones" in the `author` field *or* if it contains "Jones" in the `editor`
1076 field. Therefore, `or` is the required operator in this case. If you would use
1077 `and`, you would only get those entries that contain "Jones" in both the `author`
1078 *and* `editor` fields.
1080 To perform a logical `or` operation, press the key `|`. As before, you will be asked
1081 which field you want to filter on, and which regexp you want to filter with.
1082 Ebib will then update the virtual database with all entries in the original
1083 database that match the additional criterion.
1085 It is also possible to perform a logical `and` on the virtual database. Use this
1086 if you want to select those entries that contain "Jones" in the `author` field
1087 and e.g. "symbiotic hybernation" in the `keyword` field. A logical `and` operation
1088 is done with the key `&`. (Note: this is the same key that is used to create a
1089 virtual database. In fact, you can also create a virtual database with `|`: when
1090 used in a normal database, `&` and `|` are equivalent. They are only different in
1091 virtual databases.)
1093 Both the `&` and `|` commands can be used with the negative prefix argument `M--` (or
1094 `C-u -`, which is identical). In this case, the search criterion is negated. That
1095 is, the negative prefix argument performs a logical `not` operation on the search
1096 criterion.
1098 That is, if you want to select all entries from a database that do *not* contain
1099 "Jones" in the `author` field, you can do this by typing `M-- &` and then filling
1100 out the relevant field and regexp. This prefix argument is available both in
1101 real and in virtual databases.
1103 There is another way of performing a logical `not` operation, which is only
1104 available in virtual databases: by pressing the key `~`, you invert the current
1105 filter. That is, if you have a virtual database with all the entries containing
1106 "Jones" in the `author` or in the `editor` field, and you press `~`, the selection
1107 is inverted, and now contains all entries that do *not* have "Jones" in the
1108 `author` or `editor` field.
1110 Although `~` and the negative prefix argument to `&` or `|` both perform logical `not`
1111 operations, they are *not* equivalent: `~` negates the entire filter built up so
1112 far, while the negative prefix argument only negates the single selection
1113 criterion you enter with it.
1115 If you want to know what the filter for the current virtual database is exactly,
1116 you can type `V`. This command displays the current filter in the minibuffer. The
1117 filter is specified as a Lisp expression, meaning that the operators appear
1118 before their operands, not in between them. That is, `x and y` is written as `(and
1119 x y)`.
1121 With a prefix argument (any prefix argument will do), the command `V` not only
1122 displays the current filter, but also reapplies it. This can be useful when
1123 you've made changes to the source database: Ebib does not automatically update a
1124 virtual database when its source database is modified.
1127 ### Properties of Virtual Databases ###
1129 Virtual databases differ from normal databases in several ways. First, they
1130 cannot be modified: you cannot add or delete entries, and you cannot modify the
1131 contents of fields. It is also not possible to import entries to them or merge
1132 another file with them. Furthermore, it is not possible to export entries to
1133 them or from them.
1135 A virtual database cannot be saved in the normal way with `s`, and the menu option
1136 to save all databases ignores virtual databases. If you want to save a virtual
1137 database, you can use the command `w`. This command not only saves the virtual
1138 database, it also changes it into a normal database, and detaches it from its
1139 original source database, so that you can modify it without affecting the source
1140 database.
1142 The print bibliography command also doesn't work with virtual databases. The
1143 reason for this is that the virtual database is not associated with an actual
1144 `.bib` file, so there is no file to create a list of references from. However, it
1145 is possible to print index cards frm a virtual database.
1148 ## The Multiline Edit Buffer ##
1150 As mentioned several times before, Ebib has a special multiline edit buffer,
1151 which is used to edit field values that contain newlines (so-called *multiline
1152 fields*), and also to edit the contents of the `@preamble` command. This section
1153 discusses the details of this buffer.
1155 Ebib enters multiline edit mode in one of three cases: when you edit the
1156 `@preamble` definition, when you hit `l` in the entry buffer to edit the current
1157 field as multiline, or when you hit `e` on the `annote` field, or on a field whose
1158 value already is multiline.
1160 The mode that is used in the multiline edit buffer is user-configurable. The
1161 default value is `text-mode`, but if you prefer to use some other mode, you can
1162 specify this through the customisation options. (Personally, I use
1163 `markdown-mode` in the multiline edit buffer, so that I can use
1164 [`markdown`](http://daringfireball.net/projects/markdown/) to write annotations,
1165 which provides an easy way to create headers, use bold and italic, etc., in
1166 plain text.)
1168 Three commands are relevant for interacting with Ebib when you're in the
1169 multiline edit buffer, which are bound to key sequences in the minor mode
1170 ebib-multiline-edit-mode, which is activated automatically in the multiline edit
1171 buffer.
1173 `ebib-quit-multiline-edit`, bound to `C-c | q`, leaves the multiline edit buffer and
1174 stores the text in the database. If you invoke this command when you've deleted
1175 all contents of the buffer (including the final newline!) and you were editing a
1176 field value or the `@preamble`, the field value or preamble is deleted. (This is
1177 in fact the *only* way to delete the `@preamble` definition. Field values on the
1178 other hand can also be deleted by hitting `x` or `d` on them in the entry buffer.)
1179 If you were editing a `@string` value, Ebib will just complain, because string
1180 definitions cannot be empty.
1182 `ebib-cancel-multiline-edit`, bound to `C-c | c`, also leaves the multiline edit
1183 buffer, but it does so without storing the text. The original value of the
1184 field, string or preamble will be retained. If the text was modified, Ebib will
1185 ask for a confirmation before leaving the buffer.
1187 `ebib-save-from-multiline-edit`, bound to `C-c | s`, can be used in the multiline
1188 edit buffer to save the database. This command first stores the text in the
1189 database and then saves it. Because Ebib does not do an autosave of the current
1190 database, it is advisable to save the database manually every now and then to
1191 prevent data loss in case of crashes. It would be annoying to have to leave the
1192 multiline edit buffer every time you want to do this, so this command has been
1193 provided to allow you to do this from within the buffer.
1195 It is possible to change the second key of these commands, if you find `|`
1196 inconvenient. See [Modifying Key Bindings](#modifying-key-bindings) for
1197 details.
1200 ## The Options Menu ##
1202 In the index buffer, Ebib's menu has an Options submenu. This menu gives you
1203 quick access to Ebib's customisation buffer, and it also provides checkboxes for
1204 several settings that can be toggled on and off. All of these settings have
1205 defaults that can be defined in the customisation buffer. Setting or unsetting
1206 them in the Options menu only changes them for the duration of your Emacs
1207 session, it doesn't affect the default setting.
1209 The same is true for the printing options that are in the Print menu. When set
1210 or unset in the menu, the default values specified in the customisation buffer
1211 do not change.
1214 # The Ebib Buffers #
1216 This chapter lists all the key commands that exist in Ebib, with a short
1217 description and the actual command that they call. The latter information is
1218 needed if you want to customise Ebib's key bindings. (See
1219 [Modifying Key Bindings](#modifying-key-bindings).)
1223 ## The Index Buffer ##
1225 `Up`
1226 :    go to previous entry. `(ebib-prev-entry)`
1227 `Down`
1228 :    go to next entry. `(ebib-next-entry)`
1229 `Right`
1230 :    move to the next database. `(ebib-next-database)`
1231 `Left`
1232 :    move to the previous database. `(ebib-prev-database)`
1233 `PgUp`
1234 :    scroll the index buffer down. `(ebib-index-scroll-down)`
1235 `PgDn`
1236 :   scroll the index buffer up. `(ebib-index-scroll-up)`
1237 `Home`
1238 :    go to first entry. `(ebib-goto-first-entry)`
1239 `End`
1240 :    go to last entry. `(ebib-goto-last-entry)`
1241 `Return`
1242 :    make the entry under the cursor current. Use after e.g. `C-s`.
1243      `(ebib-select-entry)`
1244 `Space`
1245 :    equivalent to `PgDn`.
1246 `1-9`
1247 :    jump to the corresponding database.
1249 :    search the database. `(ebib-search)`
1251 :    Create a virtual database, or perform a logical `and` on the current virtual
1252      database. With negative prefix argument: apply a logical `not` to the
1253      selectional criterion. `(ebib-virtual-db-and)`
1255 :    Create a virtual database, or perform a logical `or` on the current virtual
1256      database. With negative prefix argument: apply a logical `not` to the
1257      selectional criterion. `(ebib-virtual-db-or)`
1259 :    Perform a logical `not` on the current virtual database.
1260      `(ebib-virtual-db-not)`
1262 :    add an entry. `(ebib-add-entry)`
1264 :    equivalent to `Pgup`.
1266 :    close the database. `(ebib-close-database)`
1268 :    delete the current entry. `(ebib-delete-entry)`
1269 `; d`
1270 :    delete all selected entries.
1272 :    edit the current entry. `(ebib-edit-entry)`
1274 :    edit the key of the current entry. `(ebib-edit-keyname)`
1276 :    extract a filename from the `file` field and send it to an appropriate viewer.
1277      With numeric prefix argument, extract the *n*-th filename.
1279 :    follow `crossref` field. `(ebib-follow-crossref)`
1281 :    equivalent to `Home`.
1283 :    equivalent to `End`.
1285 :    show the info node on the index buffer. (`ebib-index-help`)
1287 :    equivalent to `Down`.
1289 :    jump to another database. This accepts a numeric prefix argument, but
1290      will ask you for a database number if there is none. `(ebib-switch-to-database)`
1292 :    equivalent to `Up`.
1294 :    show the log buffer. (`ebib-show-log`)
1296 :    select (or unselect) the current entry. `(ebib-select-entry)`
1297 `; m`
1298 :    unselect all selected entries.
1300 :    find next occurrence of the search string. `(ebib-search-next)`
1302 :    search for entries cross-referencing the current one. `(ebib-search-crossref)`
1303 `C-n`
1304 :    equivalent to `Down`.
1305 `M-n`
1306 :    equivalent to `PgDn`.
1308 :    open a `.bib` file. `(ebib-load-bibtex-file)`
1310 :    push an entry to a LaTeX buffer `(ebib-push-bibtex-key)`
1311 `; p`
1312 :    push the selected entries to a LaTeX buffer.
1313 `C-p`
1314 :    equivalent to `Up`.
1315 `M-p`
1316 :    equivalent to `PgUp`.
1318 :    show and edit the `@preamble` definition in the database.
1319      `(ebib-edit-preamble)`
1321 :    quit Ebib. This sets all variables to nil, unloads the database(s) and quits
1322      Ebib. `(ebib-quit)`
1324 :    save the database. `(ebib-save-current-database)`
1326 :    show and edit the `@string` definitions in the database.
1327      `(ebib-edit-strings)`
1329 :    extract a URL from the `url` field and send it to a browser. With numeric
1330      prefix argument, extract the *n*-th url.
1332 :    Display the filter of the current virtual database in the minibuffer.
1333      With prefix argument: reapply the filter. `(ebib-print-filter)`
1335 :    export the current entry to a file, or, when used with numeric prefix
1336      argument, to another database. `(ebib-export-entry)`
1337 `; x`
1338 :    export the selected entries to a file, or, when used with a numeric
1339      prefix argument, to another database.
1340 `C-x b`
1341 :    equivalent to `z`.
1342 `C-x k`
1343 :    equivalent to `q`.
1345 :    export the `@preamble` definition to a file or, when used with a numeric
1346      prefix argument, to another database. `(ebib-export-preamble)`
1348 :    move focus away from the Ebib windows. `(ebib-leave-ebib-windows)`
1350 :    put Ebib in the background. `(ebib-lower)`
1352 Functions not bound to any key:
1354  * `ebib-print-filename`
1355  * `ebib-customize`
1356  * `ebib-merge-bibtex-file`
1357  * `ebib-write-database`
1358  * `ebib-save-all-databases`
1359  * `ebib-print-entries`
1360  * `ebib-latex-entries`
1361  * `ebib-toggle-hidden`
1362  * `ebib-toggle-timestamp`
1363  * `ebib-toggle-identical-fields`
1364  * `ebib-toggle-print-multiline`
1365  * `ebib-toggle-layout`
1368 ## The Entry Buffer ##
1370 `Up`
1371 :    go to the previous field. `(ebib-prev-field)`
1372 `Down`
1373 :    go to the next field. `(ebib-next-field)`
1374 `PgUp`
1375 :    go to the previous set of fields. `(ebib-goto-prev-set)`
1376 `PgDn`
1377 :    go to the next set of fields. `(ebib-goto-next-set)`
1378 `Home`
1379 :    go to the first field. `(ebib-goto-first-field)`
1380 `End`
1381 :    go to the last field. `(ebib-goto-last-field)`
1382 `Space`
1383 :    equivalent to `PgDn`.
1385 :    equivalent to `PgUp`.
1387 :    copy the contents of the current field to the kill ring.
1388      `(ebib-copy-field-contents)`
1390 :    delete the value of the current field. The deleted contents will *not* be put
1391      in the kill ring, and is therefore irretrievably lost.
1392      `(ebib-delete-field-contents)`
1394 :    edit the current field. `(ebib-edit-fields)`
1396 :    extract a filename from the current field and send it to an appropriate
1397      viewer. With numeric prefix argument, extract the *n*-th filename.
1399 :    equivalent to `Home`.
1401 :    equivalent to `End`.
1403 :    show the info node on the entry buffer. (`ebib-entry-help`)
1405 :    go to the next field. `(ebib-next-field)`
1407 :    go to the previous field. `(ebib-prev-field)`
1409 :    edit the current field as multiline. `(ebib-edit-multiline-field)`
1410 `C-n`
1411 :    equivalent to `Down`.
1412 `M-n`
1413 :    equivalent to `PgDn`.
1414 `C-p`
1415 :    equivalent to `Up`.
1416 `M-p`
1417 :    equivalent to `PgUp`.
1419 :    quit editing the current entry and return focus to the index buffer.
1420     `(ebib-quit-entry-buffer)`
1422 :    toggle a field's "raw" status. `(ebib-toggle-raw)`
1424 :    insert an abbreviation from the `@string` definitions in the
1425      database. `(ebib-insert-abbreviation)`
1427 :    extract a URL from the current field and send it to a browser. With
1428      numeric prefix argument, extract the *n*-th url.
1430 :    cut the contents of the current field. Like `c`, `x` puts the contents of the
1431      current field in the kill ring. `(ebib-cut-field-contents)`
1433 :    yank the last element in the kill ring to the current field. Repeated use of
1434      `y` functions like `C-y/M-y`. Note that no text will be yanked if the field
1435      already has a value. `(ebib-yank-field-contents)`
1438 ## The Strings Buffer ##
1440 `Up`
1441 :    go to the previous string. `(ebib-prev-string)`
1442 `Down`
1443 :    go to the next string. `(ebib-next-string)`
1444 `PgUp`
1445 :    go ten strings up. `(ebib-strings-page-up)`
1446 `PgDn`
1447 :    go ten strings down. `(ebib-strings-page-down)`
1448 `Home`
1449 :    go to the first string. `(ebib-goto-first-string)`
1450 `End`
1451 :    go to the last string. `(ebib-goto-last-string)`
1452 `Space`
1453 :    equivalent to `PgDn`.
1455 :    add a new `@string` definition. `(ebib-add-string)`
1457 :    equivalent to `PgUp`.
1459 :    copy the text of the current string to the kill ring.
1460      `(ebib-copy-string-contents)`
1462 :    delete the current `@string` definition from the database. You will be
1463      asked for confirmation. `(ebib-delete-string)`
1465 :    edit the value of the current string. `(ebib-edit-string)`
1467 :    equivalent to `Home`.
1469 :    equivalent to `End`.
1471 :    show the info node on the strings buffer. (`ebib-strings-help`)
1473 :    equivalent to `Down`.
1475 :    equivalent to `Up`.
1477 :    edit the value of the current string as multiline.
1478      `(ebib-edit-multiline-string)`
1479 `C-n`
1480 :    equivalent to `Down`.
1481 `M-n`
1482 :    equivalent to `PgDn`.
1483 `C-p`
1484 :    equivalent to `Up`.
1485 `M-p` 
1486 :    equivalent to `PgUp`.
1488 :    quit the strings buffer and return focus to the index buffer.
1489      `(ebib-quit-strings-buffer)`
1491 :    export the current `@string` definition to a file or, when used with a
1492      prefix argument, to another database. `(ebib-export-string)`
1494 :    export all the `@string` definitions to a file or, when used with a prefix
1495      argument, to another database. `(ebib-export-all-strings)`
1498 # Customisation #
1500 Ebib can be customised through Emacs' standard customisation interface. The only
1501 thing that cannot be customised in this way are the key bindings. If you wish to
1502 customise those, you have to use the file `~/.ebibrc`.
1505 ## The Customisation Buffer ##
1507 Ebib's customisation group is a subgroup of the `Tex` group. It can be invoked
1508 by typing `M-x` `customize-group` `RET` `ebib` `RET`, or going to the Options
1509 menu and selecting "Customize Ebib". This chapter gives a short description of
1510 all the options available in the customisation buffer.
1513 ### Default Type ###
1515 **Default value**: `article`.\newline
1517 \noindent The default type is the default entry type given to a new entry. Every
1518 entry in the Ebib database must have a type, because the type defines which
1519 fields are available. When a new entry is created, Ebib gives it a default type,
1520 which can be customised through this option.
1521     
1523 ### Preload Bib Files ###
1525 **Default value**: `nil`.\newline
1527 \noindent This option allows you to specify which file(s) Ebib is to load when
1528 it starts up. Specify one file per line, press the `INS` button to add more
1529 files. You can complete a partial filename with `M-TAB`.
1532 ### Additional Fields ###
1534 **Default value**: `crossref` `url` `annote` `abstract` `keywords` `file`
1535   `timestamp`.\newline
1537 \noindent The additional fields are those fields that are available for all
1538 entry types, and which BibTeX generally ignores. This option allows you to
1539 specify which additional fields you wish to use in your database. Specify one
1540 field per line, press the `INS` button to add more fields.
1543 ### Layout ###
1545 **Default value**: `full`.\newline
1547 \noindent When set to `full`, Ebib takes over the entire frame when it runs.
1548 Alternatively, you can select `custom`, so that you can specify the width of the
1549 Ebib windows yourself. In this case, Ebib takes up the right part of the frame,
1550 leaving the left part free. See [Screen Layout](#screen-layout) for details.
1553 ### Width ###
1555 **Default value**: 80.\newline
1557 \noindent The width of the Ebib windows when `ebib-layout` is set to `custom`.
1560 ### Index Window Size ###
1562 **Default value**: 10.\newline
1564 \noindent This option lets you specify the size of the index window at the top
1565 of the Ebib screen.
1568 ### Index Display Fields ###
1570 **Default value**: `nil`.\newline
1572 \noindent This option allows you to specify fields that should be displayed next
1573 to the entry key in the index buffer. By default, the index buffer only shows
1574 the key of each entry, but if this is too little information, you can use this
1575 option to display e.g. the title of each entry as well.
1578 ### Autogenerate Keys ###
1580 **Default value**: `nil`.\newline
1582 \noindent This option specifies whether Ebib should autogenerate keys or not. If
1583 set, adding a new entry will not ask for a key. Instead, a temporary key
1584 `<new-entry>` is used. When you leave the entry buffer, this key is replaced
1585 with an autogenerated key.
1587 Ebib uses the function `bibtex-generate-autokey` to generate the key. This
1588 function has a number of customisation options, which are described in its
1589 documentation string.
1592 ### Insertion Commands ###
1594 **Default value**: `((cite 1 nil))`.\newline
1596 \noindent With the command `ebib-insert-bibtex-key` or with the command key `p`
1597 in the index buffer, you can insert a BibTeX key into a LaTeX buffer. This
1598 option allows you to define the commands that are available through tab
1599 completion when these functions ask for a citation command.
1601 The citation commands should be given without the leading backslash, as Ebib
1602 adds one. Furthermore, you need to specify how many optional arguments each
1603 command can have. When Ebib prompts you for a citation key, it will ask for as
1604 many optional arguments as you specify here. (If you don't want to be asked for
1605 those optional arguments, just fill in 0.)
1607 Lastly, there is also the possibility to specify that a command is a multicite
1608 command. When you push a number of marked entries and provide a multicite
1609 command, Ebib asks you for optional arguments for each entry key and the
1610 citation is formatted properly:
1612     \parencites[35]{jones1996}[88--120]{winston2008}[23]{key3}
1614 With a regular command, Ebib only asks you for one set of optional arguments and
1615 puts all marked entries in a single argument:
1617     \cite{jones1996,winston2008}
1619 If you push just a single entry, multicite commands don't behave differently
1620 from regular commands. Note that with `ebib-insert-bibtex-key`, it's not
1621 possible to insert more than one key, so multicite commands behave just like
1622 regular commands if you insert an entry this way.
1624 When Ebib prompts you for a citation command, the commands specified in this
1625 option can be obtained through tab completion. However, it is not necessary to
1626 fill in a command from this list here. You can also enter another command (in
1627 which case Ebib asks for exactly one optional argument) or even no command at
1628 all. In the latter case, Ebib does not ask for any optional arguments and simply
1629 puts the key in the buffer without adding anything else.
1634 ### Multiline Major Mode ###
1636 **Default value**: `text-mode`.\newline
1638 \noindent This specifies the major mode used in the multiline edit buffer. Note
1639 that the value *must* be a command for a major mode.
1642 ### Sort Order ###
1644 **Default value**: `nil`.\newline
1646 \noindent The use of this option is explained above, see
1647 [Sorting the .bib file](#sorting-bib-file). To create a sort order, click the
1648 `INS` button to create a sort level, and then click the `INS` button under that
1649 sort level to enter a sort field. If you want to add more than one sort field to
1650 the sort level, simply hit `INS` again.
1653 ### Save Xrefs First ###
1655 **Default value**: `nil`.\newline
1657 \noindent For cross-referencing to work, the cross-referencing entries must
1658 appear in the `.bib` file *before* the cross-referenced entries. In order to
1659 tell Ebib to save all entries with a `crossref` field first, you must set the
1660 option `Save Xrefs First` in Ebib's customisation buffer. With this option set,
1661 BibTeX's crossreferencing options work as intended.
1664 ### Crossref Face ###
1666 **Default value**: `((t (:foreground "red")))`.\newline
1668 \noindent Field values inherited from a cross-referenced entry are marked with
1669 this face. By default, the face has red as foreground colour.
1672 ### Selected Face ###
1674 **Default value**: `((t (:inverse-video t)))` (GNU Emacs)\newline
1675  `((t (:foreground "white" :background "red")))` (XEmacs).\newline
1677 \noindent When entries are selected (with `m`), they are highlighted in this
1678 face. By default, GNU Emacs uses the text property `highlight`. XEmacs only
1679 allows this on terminals, therefore it displays selected entries with a red
1680 background and a white foreground colour. This option allows you to change these
1681 defaults.
1684 ### Use Timestamp ###
1686 **Default value**: `nil`.\newline
1688 \noindent If this option is set, Ebib will add a `timestamp` field to every new
1689 entry, recording the date and time it was added to the database. See
1690 [Timestamps](#timestamps).
1693 ### Timestamp Format ###
1695 **Default value**: `"%a %b %e %T %Y"`.\newline
1697 \noindent This option specifies the format string that is used to create the
1698 timestamp. The format string is used by `format-time-string` to create a time
1699 representation. The default value produces a timestamp of the form `"Mon Mar 12
1700 01:03:26 2007"`. See the documentation for the Emacs function
1701 `format-time-string` for the forms that the format string can take.
1704 ### Standard Url Field ###
1706 **Default value**: `url`.\newline
1708 \noindent This is the field that Ebib searches for URLs if you press `u` in the
1709 index buffer.
1712 ### Url Regexp ###
1714 **Default value**: `\\url{\(.*\)}\|https?://[^ '<>\"\n\t\f]+`.\newline
1716 \noindent This is the regular expression that Ebib uses to search for URLs in a
1717 field. With the default value, Ebib considers everything that is in a LaTeX
1718 `\url{...}` command as a URL, and furthermore every string of text that starts
1719 with `http://` or `https://` and does not contain whitespace or one of the
1720 characters `' " <` or `>`.
1723 ### Browser Command ###
1725 **Default value**: `nil`.\newline
1727 \noindent If this option is unset, Ebib uses the Emacs function `browse-url` to
1728 start a browser. If this function does not exist, you can set this option. For
1729 example, if you use the Firefox browser, set this option to `firefox`.
1731 For this to work, the browser that you use must be able to handle a URL on the
1732 command line.
1735 ### Standard File Field ###
1737 **Default value**: `file`.\newline
1739 \noindent This is the field that Ebib searches for filenames if you press `f` in
1740 the index buffer.
1743 ### File Associations ###
1745 **Default value**: `(("pdf" . "xpdf") ("ps" . "gv"))`.\newline
1747 \noindent The programs used to view files. By default, programs for `.pdf` and
1748 `.ps` files are specified, which should be available on most linux systems. If
1749 you prefer other programs or are running on Windows, you can specify them here.
1750 Note that Ebib searches the PATH for the programs, but you can also specify full
1751 path names. Of course, it is also possible to add new associations.
1753 Note that GNU/Emacs 23 comes with `doc-view-mode`, which provides a way to view
1754 `.pdf` and `.ps` files inside Emacs. (The files are converted to `.png` format
1755 first.) If you prefer to use this mode, simply leave the program field blank for
1756 the relevant file type.
1759 ### File Regexp ###
1761 **Default value**: `[^?|\:*<>\" \n\t\f]+`.\newline
1763 \noindent Regural expression used to find files in a field. The default value
1764 essentially means that every string of characters not containing any of the
1765 characters `? | \ : * < > "` or space, newline, tab of formfeed is recognised as
1766 a file name.
1768 Note that URLs can easily by recognised by the prefix `http:`, but recognising
1769 files is not so straightforward. It is therefore not advisable to put anything
1770 but filenames in the `file` field.
1773 ### File Search Dirs ###
1775 **Default value**: `~`.\newline
1777 \noindent List of directories that Ebib searches for files. Note that searching
1778 is not recursive: only the files listed here are searched, not their
1779 subdirectories.
1782 ### Print Preamble ###
1784 **Default value**: `nil`.\newline
1786 \noindent This option specifies the preamble that is to be added to the LaTeX
1787 file Ebib creates for printing the database as index cards. You can set your own
1788 `\usepackage` commands, or anything else you may need.
1791 ### Print Newline ###
1793 **Default value**: `nil`.\newline
1795 \noindent With this option set, Ebib puts every entry on a separate page when
1796 printing index cards. When this option is unset, the entries are separated by a
1797 small amount of whitespace only.
1800 ### Print Multiline ###
1802 **Default value**: `nil`.\newline
1804 \noindent When this options is set, Ebib includes multiline field values when
1805 you print index cards. When unset, multiline values are excluded, which saves
1806 space.
1809 ### Latex Preamble ###
1811 **Default value**: `\bibliographystyle{plain}`.\newline
1813 \noindent This option specifies the preamble to be added to the LaTeX file for
1814 creating a list of references from the database. The default is to use the
1815 `plain` style, but you may want to specify your own BibTeX packages and options.
1818 ### Print Tempfile ###
1820 **Default value**: `nil`.\newline
1822 \noindent This option specifies the name and location of the temporary file Ebib
1823 creates with the commands `ebib-print-database` and `ebib-latex-database`. When
1824 unset, Ebib will ask for a filename each time either of these commands is
1825 called.
1828 ### Allow Identical Fields ###
1830 **Default value**: `nil`.\newline
1832 \noindent If this option is set, Ebib stores the values of multiple occurrences
1833 of a single field within an entry in a single occurrence of that field,
1834 separated by semicolons (see
1835 [Multiple Identical Fields](#multiple-identical-fields)).
1838 ### Entry Types ###
1840 **Default value**: see below.\newline
1842 \noindent This option allows you to customise the entry types that Ebib uses.
1843 Each entry type has a name, a set of obligatory fields and a set of optional
1844 fields. You can add, alter or delete single fields in an entry type, or whole
1845 entry types.
1847 If you want to add an entry type, hit the `INS` key on the top level and give the
1848 new entry a name, then add obligatory and/or optional fields. It is not
1849 necessary that an entry type has both obligatory and optional fields, you can
1850 define an entry that has only obligatory or only optional fields.
1852 The default entry types and fields are the following:
1854      article                                               ;; name of entry type
1855        author title journal year                           ;; obligatory fields
1856        volume number pages month note                      ;; optional fields
1857   
1858      book
1859        author title publisher year
1860        editor volume number series address edition month note
1861   
1862      booklet
1863        title
1864        author howpublished address month year note
1865   
1866      inbook
1867        author title chapter pages publisher year
1868        editor volume series address edition month note
1869   
1870      incollection
1871        author title booktitle publisher year
1872        editor volume number series type chapter pages address edition month note
1873   
1874      inproceedings
1875        author title booktitle year
1876        editor pages organization publisher address month note
1877   
1878      manual
1879        title
1880        author organization address edition month year note
1881   
1882      misc
1883        --
1884        title author howpublished month year note
1885   
1886      mastersthesis
1887        author title school year
1888        address month note
1889   
1890      phdthesis
1891        author title school year
1892        address month note
1893   
1894      proceedings
1895        title year
1896        editor publisher organization address month note
1897   
1898      techreport
1899        author title institution year
1900        type number address month note
1901   
1902      unpublished
1903        author title note
1904        month year
1905   
1907 ## Modifying Key Bindings ##
1909 If you are unhappy about Ebib's standard key bindings and would like to change
1910 them, or if you would like to bind a command that is only available through the
1911 menu to a key, you can do so by creating a file `~/.ebibrc` and writing your
1912 preferred key bindings in it. A key binding definition is built up as follows:
1914     (ebib-key <buffer> <key> <command>)
1916 `<buffer>` is either `index`, `entry` or `strings`, for the corresponding
1917 buffer. `<key>` is a standard Emacs key description, and `<command>` is the Ebib
1918 command to be associated with the key. The commands that can be used here are
1919 listed in [The Ebib Buffers](#ebib-buffers). Note that it is possible to bind
1920 more than one key to a single function: just add as many `ebib-key` statements
1921 as necessary.
1923 As an example, the following binds `C-s` to `ebib-search` in the index buffer,
1924 so that the database can be searched with `C-s` as well as with `/`:
1926     (ebib-key index "\C-s" ebib-search)
1928 If you want to unbind a key, you can simply leave out `<command>`. So if you
1929 want to bind the command `ebib-delete-entry` to `D` rather than `d`, you need to
1930 put the following in `.ebibrc`:
1932     (ebib-key index "D" ebib-delete-entry)
1933     (ebib-key index "d")
1935 The first line binds `D` to the command `ebib-delete-entry`. The second line unbinds
1936 `d`.
1938 If a command can be called with a prefix key (as for example `ebib-delete-entry`
1939 can), `ebib-key` will automatically rebind the prefixed version as well. So in the
1940 example above, the first line not only binds `D`, it also binds `; D`. Similarly,
1941 the second line not only unbinds `d`, but also `; d`.
1943 Note that if you bind the print commands to a key (`ebib-print-entries` and
1944 `ebib-latex-entries`) they are automatically set up to accept the prefix key as
1945 well.
1947 It is also possible to redefine the prefix key itself. To do this, you must
1948 specify `select-prefix` for `<buffer>`. The value of `<command>` is irrelevant here, so
1949 it can be left out:
1951     (ebib-key select-prefix ":")
1953 This sets up `:` as the new prefix key. Doing this automatically unbinds the
1954 existing prefix key.
1956 As a final option, `ebib-key` allows you to redefine the second key in the key
1957 bindings of the multiline edit buffer:
1959     (ebib-key multiline "&")
1961 This piece of code changes the commands `C-c | q`, `C-c | c` and `C-c | s` to
1962 `C-c & q`, `C-c & c` and `C-c & s`, respectively.
1964 </div>