Multiline major mode customizable.
[ebib.git] / manual / ebib-manual.muse
blob7d4a0b08790f5e5508771aa9b49524e419382545
1 #author Joost Kremers
2 #title Ebib Manual
4 <div id="menu">
6 <contents>
8 </div>
10 <div id="main">
12 Ebib is a program with which you can manage BibTeX database files without having
13 to edit the raw =.bib= files. It runs in GNU/Emacs, version 21.1 or higher (lower
14 versions are not supported) and XEmacs (at least from version 21.4; lower
15 version have not been tested, but may work.)
16   
17 It should be noted that Ebib is *not* a minor or major mode for editing BibTeX
18 files. It is a program in itself, which just happens to make use of Emacs as a
19 working environment, in the same way that for example Gnus is.
20   
21 The advantage of having a BibTeX database manager inside Emacs is that X is no
22 longer required, as Emacs can run on the console, and also that some integration
23 with Emacs' TeX and LaTeX modes becomes possible. For example, you can push a
24 BibTeX key from Ebib to a LaTeX buffer, or, vice versa, when you're in a LaTeX
25 buffer, you can consult your BibTeX database and insert a key from it into the
26 document. Another advantage of Ebib is that it is completely controlled by key
27 commands: no stressful mouse movements are required, as with most other (usually
28 X-based) BibTeX database managers.
31 * Installation
33 To install Ebib, so that it will be loaded automatically when Emacs is started,
34 simply copy the file =ebib.el= to somewhere in your load path and add the
35 following line to Emacs' init file (=~/.emacs= for GNU/Emacs, =~/.xemacs/init.el=
36 for XEmacs):
38 <example>
39 (autoload 'ebib "ebib" "Ebib, a BibTeX database manager." t)
40 </example>
42 Note: if you do not know what your load path is set to, go to the =*scratch*=
43 buffer, type =load-path= on an empty line, put the cursor right after it and type
44 =C-j=. The value of =load-path= will then appear in the buffer.
46 When Ebib is loaded, you can run it with =M-x ebib=. This command is also used to
47 return to Ebib when you have put the program in the background. You can bind
48 this command to a key sequence by putting something like the following in Emacs'
49 init file:
51 <example>
52 (global-set-key "\C-ce" 'ebib)
53 </example>
55 You can of course choose any key combination you like. (In Emacs, key
56 combinations of =C-c <letter>= are reserved for the user, so that no package may
57 set them.)
59 It is recommended to byte-compile the source, Ebib runs quite a lot faster when
60 it is byte-compiled. You can do this either within Emacs with =M-x
61 byte-compile-file=, or from your shell by going into the directory where you put
62 =ebib.el= and typing:
64 <example>
65 emacs -batch -f batch-byte-compile ebib.el
66 </example>
68 (Substitute =emacs= with =xemacs= if you use XEmacs.) This will create a file
69 =ebib.elc=, which Emacs will load instead of =ebib.el=. Byte-compiling Ebib may
70 produce a warning about functions that are ``not known to be defined''. This can
71 be safely ignored. GNU Emacs and XEmacs have some small differences, and the
72 functions reported in this warning are those used by the other version. Ebib
73 makes sure that the correct functions are called.
77 * Basic Usage
79 A BibTeX database is somewhat of a free-form database. A BibTeX entry consists
80 of a set of field-value pairs. Furthermore, each entry is known by a unique key.
81 The way that Ebib navigates this database is by having two windows, one that
82 contains a list of all the entry keys in the database, and one that contains the
83 fields and values of the currently highlighted entry.
85 When Ebib is started, the current windows in Emacs are hidden and the Emacs
86 frame is divided into two windows. The top one contains a buffer that is called
87 the *index buffer*, while the lower window contains the *entry buffer*. When a
88 database is loaded, the index buffer holds a list of all the keys in the
89 database. You can move through these keys with the cursor keys. In the entry
90 buffer, the fields of the currently highlighted entry are shown, with their
91 values.
93 In this chapter, all basic functions of Ebib are described, so that you can get
94 startet with it. At times, reference will be made to later chapters, where more
95 specific functions are described.
99 ** Getting Started
101 Ebib is started with the command =M-x ebib=. Entering this command hides all the
102 windows in the current Emacs frame and replaces them with two windows: the top
103 one contains the index buffer, the bottom one, taking up the larger part of the
104 screen, contains the entry buffer. The index buffer is named =none=, to indicate
105 that no database has been loaded. If you open a database, or start a new one,
106 the index buffer will carry its name.
108 You can quit Ebib by typing =q=. You will be asked for confirmation, and you will
109 receive a warning if you happen to have an unsaved database. The command =z= can
110 also be used to leave Ebib. However, unlike =q=, which completely quits Ebib, =z=
111 only lowers it, so that it remains active in the background. The =.bib= files that
112 you have opened remain loaded, and you can return to them by typing =M-x ebib=
113 again.
116 *** Opening a =.bib= file
118 Loading a =.bib= file into Ebib is done with the command =o=. Ebib reads the file
119 that you specify, and reports how many entries it found, how many =@string=
120 definitions it found, and whether a =@preamble= was found. Note that when Ebib
121 reads a =.bib= file, it only reads entry types (e.g. =book, article, phdthesis=
122 etc.) that it knows about. Fields (e.g. =author, title, year= etc.) that Ebib does
123 not know about, are loaded (and saved) but not displayed, so they cannot be
124 edited. Therefore, you should make sure that all the entry types and fields that
125 your databases use are defined. A sensible set has been predefined, so that
126 anyone who's using standard BibTeX entry types should have no problem loading an
127 existing =.bib= file into Ebib. If, however, you have custom entry types, or
128 custom fields in your =.bib= files, you should read the chapter on customising
129 Ebib to learn how to define them, so that Ebib knows about them. (See
130 [[#entry-types][Entry types]].)
132 Every time Ebib reads a =.bib= file, it produces a few log messages. These are
133 written into a special buffer =*Ebib-log*=. If Ebib encounters entry types in the
134 =.bib= file that it doesn't know, it will log a warning. If Ebib finds something
135 that it believes to be incorrect, an error will be logged. If any warnings or
136 errors occur while loading the =.bib= file, Ebib tells you so after loading the
137 file. To view the log file, press =l= in the index buffer.
139 Note that even if it detects warnings or errors, Ebib will try to continue
140 parsing the rest of the =.bib= file. That means that normally, only the entry in
141 which an error occurs is not read. Entries occurring after the problematic one
142 are read.
145 *** Navigating a =.bib= file
147 Once you've opened a =.bib= file, the keys of all the entries in the file are
148 shown in alphabetical order in the index buffer in the top Ebib window. (In
149 fact, it is possible to show more than just the entry key in this buffer. See
150 [[#index-display-fields][Index Display Fields]] on how to accomplish this.) The first entry is highlighted,
151 meaning it is the current entry. The fields it holds and their values are shown
152 in the entry buffer in the bottom Ebib window. The first field is the type
153 field, which tells you what kind of entry you're dealing with (i.e. =book,
154 article=, etc.).
156 Below the type field, Ebib displays (up to) three sets of fields. The first set
157 are the so-called obligatory fields, the fields that BibTeX requires to be
158 filled. The second group are the optional fields, which do not have to be filled
159 but which BibTeX will normally add to the bibliography if they do have a value.
160 The third group are the so-called additional fields. These fields are usually
161 ignored by BibTeX (note that BibTeX normally ignores *all* fields it does not
162 know), although there are bibliography styles that treat some of these fields as
163 optional rather than as additional; (i.e., the =harvard= styles do typeset the =url=
164 field, if present.)
166 The first two groups of fields are different for each entry type, while the
167 third group are common to all entry types. You can use the additional fields,
168 for example, to add personal comments to the works in your database. Ebib by
169 default defines the following additional fields: =crossref, url, annote,
170 abstract, keywords, file= and =timestamp=. If these are not sufficient for you, you
171 need to customise Ebib and add your own fields. (See [[#additional-fields][Additional Fields]], if you
172 need to find out how to do that.)
174 To move around in the index buffer, you can use the =up= and =down= cursor keys, =C-p=
175 and =C-n=, or for those more used to mutt's key bindings, =k= and =j=. Furthermore,
176 =Space= and =PgDn= move a screenful of entries down, while =b= and =PgUp= move in the
177 other direction. Lastly, =g= and =Home= move to the first entry, while =G= and =End=
178 move to the last one.
180 Ebib is not restricted to opening just one =.bib= file at a time. You can open
181 more files by just typing =o= again and entering the filename. Ebib numbers the
182 databases: the number of each database is shown in the mode line of the index
183 buffer, directly before the database name. The keys 1--9 provide a quick way of
184 jumping from one database to another. Note that the numbering is dynamic: if you
185 have three databases opened and then close the second, database 3 becomes
186 database 2.
188 With the =left= and =right= cursor keys, you can move to the previous or next
189 database. These keys wrap, so if you hit the =left= cursor key while the first
190 database is active, you move to the last database. If you are done with a
191 database and want to close it, type =c=. This closes the current database. It does
192 not leave Ebib, and all other databases you have open will remain so.
195 *** Starting a New =.bib= File
197 If you want to start a new =.bib= file from scratch, you cannot just go and enter
198 entries. You first have to give the database a name. So, to start a new
199 database, type =o= first, and give the new file a name. Once you have done this,
200 you can start adding entries to the database.
203 ** Editing the Database
205 Of course, being able to open and view =.bib= files is only half the fun. One
206 needs to be able to edit the files as well. Ebib's essential editing
207 facilities are discussed here.
210 *** Adding and Deleting Entries
212 To add an entry to a database, you type =a=. When you do this, Ebib first asks you
213 for an entry key, as every entry must be identified by a unique key. Just type a
214 name for the new entry (say =jones1998=). Since the entry key must be unique, Ebib
215 will complain if you enter a key that already exists.
217 Note that if you should later decide that you want to change the key of an
218 entry, you can do so with the command =E=. So if you have an entry with the key
219 =jones1998= and you want to add another entry by Jones from 1998, you can call the
220 new one =jones1998b= and rename the existing one to =jones1998a=.
222 Deleting an entry is done with =d=. Be careful with this: you will be asked for
223 confirmation, but once you've confirmed, the entry is gone, and it is not
224 possible to bring it back. There is no undo in Ebib. (If you haven't saved the
225 database yet, it is still possible to retrieve the deleted entry from the =.bib=
226 file, and otherwise it may still be in the backup file that Ebib creates. See
227 [[#saving-database][Saving a Database]].)
230 *** Editing Fields Values
232 Editing the field values for an entry is done in the lower of the two Ebib
233 buffers, the so-called entry buffer. You can move focus to the entry buffer by
234 typing the command =e= in the index buffer.
236 You can move between fields with the same keys that you use to move between
237 entries in the index buffer: the cursor keys =up= and =down=, =C-p= and =C-n=, or =j= and
238 =k=. =Space= and =PgDn= move to the next set of fields, while =PgUp= and =b= move to the
239 previous set of fields. =g= and =G=, and =Home= and =End= also work as expected.
241 Editing a field value can be done with =e=. For most fields, Ebib simply asks you
242 for a string value in the minibuffer. (Here, =RET= confirms the edit, while =C-g=
243 cancels it.) Although BibTeX requires that field values be surrounded by braces
244 {} (or double quotes "", but Ebib does not use those, even though it can of
245 course handle them when they are used in an existing =.bib= file) you do not need
246 to type these. Ebib adds them when it saves the =.bib= file.
248 Some fields, however, are handled in a special way. The first of these is the
249 =type= field: if you edit this field, you must enter one of the predefined entry
250 types. Ebib won't allow you to enter anything else. You can use tab-completion
251 in this case. Similarly, if you edit the =crossref= field, Ebib requires that you
252 fill in a key from the database. Here, too, you can use tab-completion.
254 Note that if you're adding a new entry, Ebib automatically puts you in the entry
255 buffer after you've typed the entry key: you don't have to type =e= to move to the
256 entry buffer. When creating a new entry, it is best to set the =type= field first,
257 because the =type= field determines which other fields are available for an entry.
259 Note also that after editing a field, Ebib (usually) puts you on the next field.
260 This is convenient if you're creating a new entry and need to fill out several
261 fields in a row.
263 If you're done editing the fields of the entry, type =q= to move focus back to the
264 index buffer. (Note: keys may have different functions in the index buffer and
265 the entry buffer. =q= is a typical example: in the entry buffer, it quits editing
266 the entry and moves focus back to the index buffer. In the index buffer,
267 however, =q= quits Ebib.)
270 *** Editing Multiline Values
272 Apart from the =type= and =crossref= field, there is another field that Ebib handles
273 in a special way when you edit its value. This is the =annote= field. Most field
274 values normally consist of a single line of text. However, because the =annote=
275 field is meant for creating annotated bibliographies, it would not be very
276 useful if you could only write one line of text in this field. Therefore, when
277 you edit the =annote= field, Ebib puts you in the so-called *multiline edit buffer*.
278 This is essentially a text mode buffer that allows you to enter as much text as
279 you like. To store the text and leave the multiline edit buffer, type =M-x
280 ebib-quit-multiline-edit=. There is no keybinding for this, you need to type the
281 full command. (Note, however, that you can use TAB completion.)
283 If you want to leave the multiline edit buffer without saving the text you have
284 just typed, you have to use the command =M-x ebib-cancel-multiline-edit=. With
285 this command, you leave the multiline edit buffer (and hide it), but the buffer
286 is not actually killed.
288 Multiline values are not restricted to the =annote= field. Any field can in fact
289 hold a multiline value. (Except of course the =type= and =crossref= fields.) To give
290 a field a multiline value, use =l= instead of =e=. You will again be put in the
291 multiline edit buffer, where you can edit the value. Note that you can use =l=
292 even if a field already has a single line value. Ebib will just make that the
293 first line in the multiline edit buffer.
295 When a field has a multiline value, only the first line is shown in the entry
296 buffer, for space reasons. To indicate that the value is multiline, a plus sign
297 =+= is placed in front of the value.
299 By the way, the =e= key is smart about the way an entry must be edited. If you
300 press =e= on a field that already has a multiline value, regardless of the fact
301 whether it is the =annote= field or not, Ebib puts you in the multiline edit
302 buffer. Therefore, you need =l= only if you want to give a field a multiline value
303 when it doesn't have one yet.
305 For more details on working with the multiline edit buffer, see
306 [[#multiline-edit-buffer][The Multiline Edit Buffer]].
309 *** Copy, cut, paste (yank), and delete
311 A few more commands are available when you're in the entry buffer editing field
312 values. The commands =c=, =x= and =y= implement a copy and paste system: =c= copies the
313 contents of the current field to the kill ring, =x= kills the contents of the
314 current field to the kill ring, and =y= yanks (pastes) the most recently killed
315 text in the kill ring. You can type =y= repeatedly to get the same effect you get
316 in Emacs when you type =M-y= after an initial =C-y=: every additional use of =y= moves
317 back in the kill ring.
319 Lastly, there is the command =d=, which deletes the contents of the current field,
320 without asking questions and without storing the text in the kill ring.
322 Note that =y= only works when the current field does not have a value yet. This is
323 to prevent you from accidentally overwriting a field value. If you do want to
324 yank text into a field that already has a value, simply hit =d= first to delete
325 the text.
328 ** Saving a Database
329 #saving-database
331 When you have undertaken any kind of editing action on a database, it is marked
332 as modified, which is indicated in the mode line for the index buffer. A
333 modified database can be saved by typing =s=. This saves the database to the file
334 it was loaded from without asking for confirmation. (It is similar to =C-x C-s= in
335 Emacs.) If you're saving a file for the first time after loading it, Ebib
336 creates a backup file under the same name appended with a tilde:
337 =<filename>.bib~=.
339 If you have multiple databases open, have made changes in more than one of them,
340 and want to save all of them without going through each yourself, you can use =S=.
341 (That's a capital =S=.) This command saves all modified databases.
343 Another way to save a database is to use the command =w=. Use this if you want to
344 write the database to another file than the one it was loaded from. Ebib will
345 ask you for a filename to save to, and will of course warn you if that file
346 happens to exist already. Note that this command is similar to =C-x C-w= in Emacs,
347 so that after using it, the new =.bib= file becomes associated with the database.
350 ** Searching
351 #searching
353 Ebib provides several search methods. First, if you are in the index buffer, the
354 normal Emacs incremental searches, =C-s= and =C-r=, function as expected. You can
355 use them to search entry keys. Note that once you've found the key you're
356 searching, you must hit =ENTER= to make it active. Ebib does not update the entry
357 buffer during incremental search, as this would be rather pointless: you're only
358 interested in the entry you're searching for, not in the entries you pass along
359 the way.
361 Of course, it is also possible to search the database itself. If you type =/=,
362 Ebib asks you for a search term. This can be a regular expression, to allow for
363 flexibility in searching. After hitting =ENTER=, Ebib will start searching the
364 database (starting from the current entry, *not* from the first entry!) and will
365 display the entry with the first occurrence of the search string that it finds.
366 All the occurrences of the search string in that entry are highlighted.
368 Ebib searches all the fields of each entry. It is not possible with =/= to specify
369 the fields to search. Note that if the search term is found in a field with a
370 multiline value, Ebib will highlight the =+= sign that it displays in front of the
371 field value. Keep an eye out for this when doing a search, because Ebib only
372 shows the first line of multiline values, and if the search term appears in
373 another line, the highlighted =+= is the only indication that the search term was
374 found. (Well, that and the fact that Ebib does *not* say =Search string not found=,
375 of course...)
377 A search term may of course appear more than once in the database. To search for
378 the next occurrence, type =n=. This will continue searching for the search string
379 in the rest of the database. Again, the first entry found to contain the search
380 string is displayed. Note that =n= does not wrap: if the end of the database is
381 reached, Ebib stops searching. To continue searching from the top, hit =g= and
382 then =n=.
384 The functions described here form Ebib's basic search functionality. Ebib also
385 has a much more powerful search mechanism in the form of *virtual databases*.
386 These are described later. (See [[#virtual-databases][Virtual Databases]].)
389 ** LaTeX Integration
391 Having a BibTeX database manager running inside Emacs has an additional
392 advantage: it makes it trivially easy to insert BibTeX keys in your LaTeX
393 documents.
395 Ebib provides two functions for this. First, if you're in a LaTeX buffer, you
396 can call the function =ebib-insert-bibtex-key=. When you invoke this command,
397 Emacs prompts you for a key from the database(s) associated with the current
398 buffer, a citation command (that has to be typed *without* the backslash) and any
399 optional argument(s) the command allows. You can type the key using
400 TAB-completion, and after hitting =RET=, Emacs puts a BibTeX citation at the
401 cursor position in the current buffer with the key you selected.
403 You can also do it the other way around: if you're in the index buffer in Ebib,
404 you can *push* an entry to a LaTeX buffer. To do this, use the key =p=. Ebib will
405 ask you for a buffer to push the entry to, a citation command and also any
406 optional arguments, and then insert a citation at the current cursor position in
407 the buffer you've supplied.
409 The citation command that =ebib-insert-bibtex-key= and the command key =p= ask for
410 can be any command that you need. But it is also possible to predefine a list of
411 citation commands which you can then enter at this prompt using tab completion.
412 For details on setting this up, see [[#insertion-commands][Insertion Commands]].
414 There is another function that is available outside Ebib: =ebib-entry-summary=.
415 This command reads the key under the cursor in the current buffer and displays
416 the field values associated with that key in a =*Help*= buffer. This allows you to
417 quickly check a reference in a text.
419 Probably the easiest way to use both =ebib-insert-bibtex-key= and
420 =ebib-entry-summary= is to bind them to a key sequence. For example, you could put
421 the following in your =~/.emacs=:
423 <example>
424 (add-hook 'LaTeX-mode-hook #'(lambda ()
425           (local-set-key "\C-cb" 'ebib-insert-bibtex-key)))
426 </example>
428 This binds =C-c b= to the command =ebib-insert-bibtex-key= in AUCTeX's LaTeX mode.
429 (Note that commands of the form =C-c <letter>= are reserved for the user, and
430 should therefore not be set by any package. For this reasons, Ebib does not set
431 this command automatically.)
434 *** Consulting databases from within a LaTeX file
436 The commands =ebib-insert-bibtex-key= and =ebib-entry-summary= must consult the
437 database or databases loaded in Ebib, and Ebib tries to be smart about which
438 database(s) to consult. Usually, a LaTeX file has a =\bibliography= command
439 somewhere toward the end, which names the =.bib= file or files that contain the
440 bibliography entries. If you consult a BibTeX database from within a LaTeX file,
441 Ebib first looks for a =\bibliography= command, reads the =.bib= files from it, and
442 then sees if those files happen to be open. If they are, Ebib uses them to let
443 you pick an entry key (in the case of =ebib-insert-entry-key=) or to search for
444 the entry (in the case of =ebib-entry-summary=).
446 Of course, it may be the case that the LaTeX file is actually part of a bigger
447 project, and that only the master file contains a =\bibliography= command. To
448 accommodate for this, Ebib checks whether the (buffer-local) variable =TeX-master=
449 is set to a filename. If it is, it reads that file and tries to find the
450 =\bibliography= command there. (Note: =TeX-master= is an AUCTeX variable, which is
451 used to keep track of multi-file projects. If you don't use AUCTeX, this
452 functionality doesn't work, and Ebib will only check the current file for a
453 =\bibliography= command.)
455 Note that if one of the =.bib= files in the =\bibliography= command isn't loaded,
456 Ebib issues a warning message about this, and continues to check for the next
457 =.bib= file. These warning messages appear in the minibuffer, but are probably
458 directly overwritten again by further messages or prompts Ebib produces, so
459 check the =*Messages*= buffer if Ebib doesn't seem to be able to find an entry
460 that you're sure is in one of your databases.
462 Another thing to keep in mind is that Ebib only looks for a =\bibliography=
463 command once: the first time either =ebib-insert-bibtex-entry= or
464 =ebib-entry-summary= is called. It stores the result of this search and uses it
465 the next time either of these commands is used. Therefore, if you make a change
466 to the =\bibliography= command, you must reload the file (use =M-x revert-buffer=)
467 to make sure Ebib rereads the =\bibliography= command.
469 If no =\bibliography= command is found at all, either in the LaTeX file itself, or
470 in the master file, Ebib simply consults the current database, i.e. the database
471 that was active when Ebib was lowered with =z=.
474 ** Cross-referencing
475 #cross-referencing
477 BibTeX has a cross-referencing facility. Suppose you have an entry =jones1998=,
478 which appeared in a book that is also in your database, say under =miller1998=.
479 You can tell BibTeX that =jones1998= is contained in =miller1998= by putting
480 =miller1998= in the =crossref= field. When BibTeX finds such a cross-reference, all
481 the fields of =jones1998= that don't have a value inherit their values from
482 =miller1998=. At the very least, this saves you some typing, but more importantly,
483 if two or more entries cross-reference the same entry, BibTeX automatically
484 includes the cross-referenced entry in the bibliography (and puts a reduced
485 reference in the cross-referencing entries).
487 When you fill in the =crossref= field in Ebib, Ebib displays the values of the
488 cross-referenced entry in the entry buffer. To indicate that they are just
489 inherited values, they are marked with =ebib-crossref-face=, which by default is
490 red. (You can customise it, of course. See the customisation option
491 [[#crossref-face][Crossref Face]].) These values are just displayed for convenience: otherwise, Ebib
492 treats these fields as if they are empty. That is, they cannot be edited (to
493 edit them, you need to edit the cross-referenced entry), and it's not possible
494 to copy these values to the kill ring.
496 If you're viewing an entry that has a cross-reference and you want to go to the
497 cross-referenced entry you can type =F=. This command reads the value of the
498 =crossref= field and then displays that entry. If you want to do the reverse,
499 i.e., see if the current entry is cross-referenced by any other entries, you can
500 use the key =N=. What this command actually does is to make the key of the current
501 entry the current search string and to search for its first occurrence *after* the
502 current entry. Like the normal search command =/=, =N= does not wrap and only
503 searches forward. So if you want to search for the next cross-referencing entry
504 you need to press =n= (i.e., lowercase =n=), and to continue searching from the
505 first entry, press =g= followed by =n=.
507 Note that if you want to use BibTeX's cross-referencing options, you need to set
508 the option [[#save-xrefs-first][Save Xrefs first]]. This tells Ebib to save all entries with a =crossref=
509 field first in the =.bib= file. Without this, BibTeX's cross-referencing will not
510 work reliably.
513 ** Printing the Database
514 #printing-database
516 Sometimes it may be useful to have a =.pdf= file or print-out of your database.
517 Although Ebib does not actually do the printing itself, it can create a LaTeX
518 file for you that you can compile and print. In fact, there are two ways of
519 doing this.
521 The first is the command =L=. This command creates a simple LaTeX document that
522 essentially contains a <verb>\nocite{*}</verb> command followed by a
523 <verb>\bibliography</verb> command referring to the =.bib= file belonging to the
524 current database. You can then run the usual sequence of LaTeX, BibTeX, LaTeX,
525 LaTeX on this file, creating a document containing a list of all the references
526 in your database.
528 The second command for printing a database is =P=. This command also creates a
529 LaTeX file. However, instead of simply providing a <verb>\nocite{*}</verb>
530 command, =P= creates a =tabular= environment for each entry in the database listing
531 all the fields of that entry and their values.
533 The difference between =L= and =P= should be obvious: with =L=, you get a list of
534 references created by BibTeX. This means that the references look the way they
535 will when actually used in a document, but it also means that the list only
536 contains the information that BibTeX deems relevant.
538 With =P= you get an overview of your database with *all* the field values of each
539 entry, including the ones that BibTeX does not use. The entries are not
540 formatted as literature references, but in a way similar to how they are shown
541 in Ebib.
543 By default, =P= only shows single-line field values. That is, multiline values are
544 normally excluded. If you want to include multiline values in the print-out, you
545 have to set the option =Print Multiline= in Ebib's customisation buffer. (See
546 [[#customisation-buffer][The Customisation Buffer]].) With this option set, Ebib will include all multiline
547 values in the LaTeX file that =P= creates. Note however that Ebib does not change
548 anything about the formatting of the text in a multiline value. So if you plan
549 to make (heavy) use of this option, make sure that the way you type your text
550 conforms to LaTeX's conventions (e.g. empty lines to mark paragraphs, etc.) and
551 doesn't contain any characters such as =&= that are illegal in LaTeX. (Or,
552 alternatively, use LaTeX code in your multiline fields.)
554 As mentioned, when you use either =L= or =P=, Ebib creates a LaTeX file. More
555 precisely, it creates a temporary buffer and writes the LaTeX code into it, and
556 then saves the contents of that buffer to a file. After it has done that, Ebib
557 lowers itself and instruct Emacs to open the file in a buffer, which will then
558 be properly set up as a LaTeX buffer. From there you can run LaTeX and view the
559 result.
561 Before doing all this, Ebib asks you which file to write to. Be careful with
562 this: since this is supposed to be a temporary file, Ebib simply assumes that if
563 you provide a filename of an existing file, it can overwrite that file without
564 warning!
566 A better way to tell Ebib which file to use is to set the option =Print Tempfile=
567 in Ebib's customisation buffer to some temporary file. When this option is set,
568 Ebib will always use this file to write to, and will not ask you for a filename
569 anymore when you type =L= or =P=.
571 There are two more customisation options for printing the database. These are
572 =Print Preamble= and =LaTeX Preamble=. With these options, you can specify what Ebib
573 should put in the preamble of the LaTeX files it creates. Use this if you want
574 to use specific packages (e.g. <verb>\usepackage{a4}</verb> or
575 <verb>\usepackage{times})</verb>. This is especially useful for =L=, since by
576 default, Ebib uses BibTeX's standard bibliography style. With the option =LaTeX
577 Preamble= you can set your preferred bibliography style. Details are discussed in
578 the chapter on customisation, see [[#customisation-buffer][The Customisation Buffer]].
582 ** Marking Entries
584 Commands in the index buffer generally operate on one single entry, or on all
585 entries. For some, however, it may sometimes be useful to perform them on more
586 than one entry, but not necessarily all of them. This can be achieved by marking
587 entries. You can mark the entries you want to perform a command on with the key
588 =m=. This marks (or unmarks) the current entry. Marked entries are displayed in
589 inverse video (in GNU Emacs) or white on red (in XEmacs; note that the face
590 properties of marked entries can be customised through the customisation option
591 [[#marked-face][Marked Face]].)
593 Of the commands discussed so far, four can be used on marked entries: =d=, =p=, =L=
594 and =P=. Note, however, that it is not enough to mark the entries you want and
595 then type any of these commands. If you do so, they will behave as if no entries
596 were marked. To get these commands to work on the marked entries, you have to
597 type a semicolon before them. That is, =; d= deletes all marked entries, and =; L=
598 and =; P= create a LaTeX file of only the marked entries. The command =m= itself can
599 also be used with the =;= prefix. If there are any marked entries, =; m= unmarks
600 them all. Otherwise, =; m= marks all entries.
602 =; p= pushes all marked entries to a LaTeX buffer. It does so by putting them all
603 in a single =\cite= command, separated by commas, not by putting them in separate
604 =\cite= commands.
607 ** Calling a Browser
609 With more and more scientific literature becoming available on-line, it becomes
610 common to store URLs in a BibTeX database. Sometimes you may want to load such a
611 URL in your browser. Ebib provides a convenient way for doing so.
613 If you type =u= in the index buffer, Ebib takes the first URL stored in the =url=
614 field of the current entry and passes it to your browser. Furthermore, in the
615 entry buffer, you can use =u= on *any* field. If you happen to have more than one
616 URL stored in the relevant field, and you want to pass the second (or third,
617 etc.) to the browser, you can use a prefix argument. So typing =M-2 u= sends the
618 second URL to your browser, =M-3 u= the third, and so on.
620 It is not even necessary that the relevant field contains *only* URLs. It may
621 contain other text mixed with the URLs: Ebib simply searches the URLs in the
622 field and ignores the rest of the text. Ebib considers every string of
623 characters that starts with =http://= or =https://= and that does not contain
624 whitespace or any of the characters =" ' <= or =>= as a URL. Furthermore, Ebib
625 regards everything that is enclosed in a LaTeX <verb>\url{...}</verb> command as
626 a URL. This behaviour is controlled by a regular expression that can be
627 customised. (See [[#url-regexp][Url Regexp]].)
629 There exists an Emacs function =browse-url=, which provides a nifty interface to
630 calling an external browser. In principle, Ebib uses this function. However, if
631 this function is not present on your installation, you can set the option
632 [[#browser-command][Browser Command]] to call the browser.
634 As just explained, if you press =u= in the index buffer, Ebib searches the =url=
635 field of the current entry for URLs. If you have the habit of putting your URLs
636 in another field, however, you may change the customisation option
637 [[#standard-url-field][Standard Url Field]] and tell Ebib to use another field for searching the URLs.
638 (Keep in mind, though, that in the entry buffer, you can load a URL from any
639 field.)
642 ** Viewing Files
644 If you have electronic versions of the papers in your database stored on your
645 computer, you can use Ebib to call external viewers for these files. The
646 interface for this is similar to that for calling a browser: if you press =f= in
647 the index buffer, Ebib searches the =file= field for a filename and when it finds
648 one, calls an appropriate viewer.
650 Just as with =u=, you can use =f= in the entry buffer as well, in which case it can
651 be used on any field, not just the =file= field. It is also possible to have more
652 than one filename in a field: you can select the one you want to view with the
653 prefix argument.
655 Just as in the case of URLs, you can customise several things about the file
656 view functionality. The option [[#standard-file-field][Standard File Field]] allows you to customise the
657 field that =f= extracts filenames from when pressed in the index buffer.
658 Extracting filenames is done with a regular expression, which can be customised
659 through the option [[#file-regexp][File Regexp]].
661 The option [[#file-search-dirs][File Search Dirs]] allows you to tell Ebib which directories it needs
662 to search for files. The default value is =~=, which means Ebib just looks in your
663 home dir. Since this is probably not where you keep your files, you may want to
664 customise this. Note that you can specify more than one directory.
666 Note that Ebib does not search directories recursively. It is possible, however,
667 to put subdirectories in the filenames. That is, if you put something like
668 =a/abney1987.pdf= in the =file= field, Ebib searches for the relevant file in a
669 subdirectory =a/= of the directories listed in the option =File Search Dirs=. (Note
670 that if you want to do this under Windows, you may want to remove the backslash
671 from the file regexp.)
673 Ebib can call different external programs depending on the file type of the
674 relevant file, but you have to specify which programs to call. The option
675 [[#file-associations][File Associations]] allows you to do this. By default, =.pdf= and =.ps= files are
676 handled, by =xpdf= and =gv=, respectively. You can specify further file types by
677 their extensions (do not include the dot). The program is searched for in =PATH=,
678 but you can of course specify the full path to the program.
681 * Advanced Features
683 The features discussed in the previous chapter should be sufficient to get
684 started using Ebib. However, Ebib has several more advanced features, which are
685 described in this chapter.
688 ** Screen Layout
689 #screen-layout
691 By default, Ebib takes over the entire Emacs frame it is started in. If you have
692 a wide enough screen, however, it may be more convenient to have Ebib take up
693 only part of the frame, so that you can have the LaTeX text you're working on
694 and Ebib visible at the same time. The option [[#layout][Layout]] allows you to do this, by
695 giving you the ability to choose between a full-frame or a split-frame layout.
697 In the split-frame layout, the Ebib windows are displayed on the right of the
698 current frame, with the left part free for your document. In this layout, some
699 aspects of Ebib behave somewhat differently. Most importantly, the multiline
700 edit buffer is not displayed in the lower Ebib window, but in the non-Ebib
701 window on the left. (Obviously, after leaving the multiline edit buffer, the
702 original buffer is restored to that window.)
704 Furthermore, pressing =z= in the index buffer leaves Ebib, but keeps the buffers
705 visible. You can get back to Ebib with the command =M-x ebib= (or any key bound to
706 it, of course), or simply by manually switching to the index buffer. If you want
707 to remove the Ebib buffers from the frame but keep Ebib in the background, you
708 can use =Z= (i.e. capital =Z=) in the index buffer. (Note that =Z= is also available
709 in the full-frame layout, but there it is identical to =z=.)
711 Lastly, the command =ebib-entry-summary= checks whether the Ebib buffers are
712 visible in the frame. If they are, it does not output the entry info in a =*Help*=
713 buffer, but rather displays the entry in Ebib itself.
716 ** Preloading =.bib= Files
718 Chances are that you will be doing most of your work with one or a few =.bib=
719 files, and you may find yourself opening the same file or files every time you
720 start Ebib. If so, you can tell Ebib to always load specific =.bib= files on
721 startup. To do this, specify the files in Ebib's customisation buffer, under the
722 option [[#preload-bib-files][Preload Bib Files]].
725 ** =@Preamble= Definition
727 Apart from database entries, BibTeX allows three more types of elements to
728 appear in a =.bib= file. These are =@comment=, =@preamble= and =@string= definitions.
729 Ebib provides facilities to handle the latter two. =@comment= definitions cannot
730 be added to a =.bib= file through Ebib, and if Ebib finds one in a =.bib= file, it
731 is simply ignored.
733 =@preamble= and =@string= definitions can be handled, however. Ebib allows you to
734 add one =@preamble= definition to the database. In principle, BibTeX allows more
735 than one such definition, but really one suffices, because you can use the
736 concatenation character =#= to include multiple TeX or LaTeX commands. So, rather
737 than having two =@preamble= definitions such as:
739 <example>
740 @preamble{ "\newcommand{\noopsort}[1]{} " }
741 @preamble{ "\newcommand{\singleletter}[1]{#1} " }
742 </example>
744 <literal style="texinfo">@noindent</literal>you can write this in your =.bib=
745 file:
747 <example>
748 @preamble{ "\newcommand{\noopsort}[1]{} "
749          # "\newcommand{\singleletter}[1]{#1} " }
750 </example>
752 Creating or editing a =@preamble= definition in Ebib is done by hitting =r= in the
753 index buffer. Ebib uses the multiline edit buffer for editing the text of the
754 =@preamble= definition, which means that as discussed above, =C-x b= stores the
755 =@preamble= text and returns focus to the index buffer, while =C-x k= returns focus
756 to the index buffer while abandoning any changes you may have made. (For details
757 on using the multiline edit buffer, see [[#multiline-edit-buffer][The Multiline Edit Buffer]].)
759 In order to create a =@preamble= as shown above in Ebib, you only have to type the
760 text between the braces. Ebib takes care of including the braces of the
761 =@preamble= command, but otherwise it saves the text exactly as you enter it. So
762 in order to get the preamble above, you'd have to type the following in Ebib:
764 <example>
765 "\newcommand{\noopsort}[1]{} "
766 # "\newcommand{\singleletter}[1]{#1} "
767 </example>
769 Note that when Ebib loads a =.bib= file that contains more than one =@preamble=
770 definition, it concatenates all the strings in them in the manner just described
771 and saves them in one =@preamble= definition.
774 ** =@String= Definitions
776 If you press =t= in the index buffer, Ebib hides the entry buffer in the lower
777 window and replaces it with the *strings buffer*. In this buffer, you can add,
778 delete and edit =@string= definitions.
780 Adding a =@string= definition is done with the command =a=. This will first ask you
781 for an abbreviation and then for the value to be associated with that
782 abbreviation. Once you've entered these, Ebib will sort the new abbreviation
783 into the buffer.
785 Moving between the =@string= definitions can be done in the usual way: the cursor
786 keys =up= and =down=, =C-p= and =C-n= and =k= and =j= move up and down. =Space= and =PgDn= move
787 ten strings down, while =b= and =PgUp= move in the other direction. The keys =g=, =G=,
788 =Home= and =End= also function as expected.
790 To delete a =@string= definition, use =d=. To edit the value of a definition, use =e=.
791 There is also a command =c=, which copies the value of the current =@string=
792 definition to the kill ring. Unlike in the entry buffer, there are no
793 corresponing commands =y= and =x=. (In fact, =x= does exist, but has another
794 function.) Yanking from the kill ring can be done with =C-y/M-y= in the minibuffer
795 when you edit a =@string='s value. Cutting a =@string='s value is pointless,
796 because a =@string= definition must have a value.
798 Having defined =@string= definitions, there must of course be a way to use them.
799 Just giving a field a string abbreviation as value will not do, because Ebib
800 puts braces around the value that you enter when it writes the =.bib= file, so
801 that BibTeX will not recognise the abbreviation, and will not expand it. BibTeX
802 will only recognise an abbreviation if it appears in the =.bib= file outside of
803 any braces.
805 To accomplish this, you must mark a field's value as *raw*. A raw field is a field
806 whose value is not surrounded by braces when the database is saved, so that
807 BibTeX recognises it as an abbreviation. To mark a field raw, press =r=. An
808 asterisk will appear before the field, indicating that it is raw. Pressing =r=
809 again will change the field back to normal. If you press =r= on a field that does
810 not have a value yet, Ebib will ask you for one.
812 Note that this also makes it possible to enter field values that are composed of
813 concatenations of strings and abbreviations. The BibTeX documentation for
814 example explains that if you have defined:
816 <example>
817 @string{WGA = "World Gnus Almanac"}
818 </example>
820 <literal style="texinfo">@noindent</literal>you can create a BibTeX field like
821 this:
823 <example>
824 title = 1966 # WGA
825 </example>
827 <literal style="texinfo">@noindent</literal>which will produce ``1966 World Gnus
828 Almanac''. Or you can do:
830 <example>
831 month = "1~" # jan
832 </example>
834 <literal style="texinfo">@noindent</literal>which will produce someting like ``1
835 January'', assuming your bibliography style has defined the abbreviation =jan=.
836 All this is possible with Ebib, simply by entering the exact text including
837 quotes or braces around the strings, and marking the relevant field as raw.
839 An easy way to enter a =@string= abbreviation as a field value is to use the key =s=
840 instead of =e=. If you type =s=, Ebib asks you for a =@string= abbreviation to put in
841 the current field, and automatically marks the field as raw. With this command,
842 Ebib only accepts =@string= definitions that are in the database, so that by using
843 =s= you can make sure you don't make any typos. Note that you can use tab
844 completion to complete a partial string.
847 ** Sorting the =.bib= file
848 #sorting-bib-file
850 By default, the entries in the database are saved to the =.bib= file in
851 alphabetical order according to entry key. If you only deal with the =.bib= file
852 through Ebib, you may not care in which order the entries are saved. However, it
853 may sometimes be desirable to be able to specify the sort order of entries in
854 more detail. (Apparently, this can be useful with ConTeXt, for example.)
856 You can specify a sort order in Ebib's customisation buffer. To sort the
857 entries, you must set at least one sort level (that is, a field to sort the
858 entries on). You can also specify more than one sort level: if two entries have
859 identical values for the first sort level, they will be sorted on the second
860 sort level. E.g., if the first sort level is =author= and the second is =year=, then
861 the entries are sorted by author, and those entries that have identical values
862 for the =author= field are sorted by year.
864 A sort level is not restricted to a single field. You can specify more fields
865 for a single sort level. Within a single sort level, a second sort field is used
866 if the first sort field does not have a value. For example, books that have an
867 editor instead of an author will have an empty =author= field. If you sort the
868 database on the =author= field, such entries will all appear at the beginning of
869 the =.bib= file, which is most likely not what you want.
871 To remedy this, you can specify both the =author= and the =editor= fields for the
872 first sort level. Ebib will then sort an entry on its =author= field if it has a
873 value, and will otherwise use the value of the =editor= field.
875 The difference between two sort fields within one sort level and two sort levels
876 is that a second sort *field* is an alternative for the first field when it has no
877 value, while a second sort *level* is an additional sort criterion when two or
878 more entries cannot be sorted on the first level, because they have identical
879 values.
881 By default, the option =Sort Order= has no value, which means that the entries in
882 the =.bib= file are sorted according to entry key. Those that wish to customise
883 the sort order will usually want to set the first sort level to =author editor=,
884 and the second to =year=. In that way, the entries in the =.bib= file are sorted
885 according to author/editor, and entries with the same author/editor are sorted
886 by year.
888 Entries that cannot be sorted on some sort level, because the sort fields are
889 empty, are sorted on entry key. (Keep in mind that if the first sort level
890 yields *no value* for a specific entry, Ebib does *not* use the second sort level to
891 sort that entry. It uses the entry key. The second sort level is only used if
892 the first yields *identical* values for two or more entries.)
894 Note that if you have set the option =Save Xrefs First= (see [[#cross-referencing][Cross-referencing]]),
895 it is pointless to set a sort order. Saving cross-referencing entries first
896 messes up any sort order, so Ebib simply ignores the sort order if =Save Xrefs
897 First= is set.
900 ** Merging and Importing
902 As described in the previous chapter, adding entries to a database can be done
903 manually with the key =a=. There are other ways of adding entries to a database,
904 however.
906 With the command =M= you can merge a second =.bib= file into your current database.
907 When you hit =M=, you are asked for a filename. Ebib then reads the entries in
908 this file and adds them to the database. Duplicate entries (that is, entries
909 with an entry key that already exists in the database) will not be loaded. Ebib
910 logs a warning about each duplicate entry to its log buffer, and displays a
911 warning after loading the =.bib= file when this happens.
913 Another way to add entries to a database is to import them from an Emacs buffer.
914 If, for example, you find ready-formatted BibTeX entries in a text file or e.g.
915 on the internet, you can copy & paste them to any Emacs buffer (e.g. the
916 =*scratch*= buffer), and then execute the command =M-x ebib-import=. Ebib then goes
917 through the buffer and loads all BibTeX entries it finds into the current
918 database (i.e. the database that was active when you lowered Ebib). If you call
919 =ebib-import= while the region is active, Ebib only reads the BibTeX entries in
920 the region.
923 ** Exporting Entries
925 Sometimes it can be useful to copy entries from one database to another, or to
926 create a new =.bib= file with several entries from an existing database. For this
927 purpose, Ebib provides exporting facilities. To export an entry to a =.bib= file,
928 use the command =x=. Ebib will ask you for a filename to export the entry to. (If
929 you have already exported an entry before, Ebib will present the filename you
930 used as default, but you can of course change it.)
932 For obvious reasons, Ebib appends the entry to the file that you enter if it
933 already exists, it does not overwrite the file. If this is not what you want,
934 delete the file first, as Ebib provides no way to do this.
936 If you have more than one database open in Ebib, it is also possible to copy
937 entries from one database to another. To do this, use the =x= command with a
938 numeric prefix argument. E.g., if the database you want to export an entry to is
939 the second database, type =M-2 x= to export the current entry to it. The number of
940 the database is given in the modeline of the index buffer.
942 If the database you're copying an entry to already contains an entry with the
943 same entry key, Ebib won't copy the entry, and issues an appropriate warning
944 message.
946 Note that the command =x= can operate on marked entries. So to export several
947 entries in one go mark them and type =; x=. You can use a prefix argument in the
948 normal way: =M-2 ; x= exports the marked entries to database 2.
950 Apart from entries, it is also possible to export the =@preamble= and =@string=
951 definitions. The =@preamble= definition is exported with the command =X= in the
952 index buffer. =@string= definitions can be exported in the strings buffer: =x= in
953 this buffer exports the current string, while =X= exports all =@string= definitions
954 in one go. All these commands function in the same way: when used without a
955 prefix argument, they ask for a filename, and then append the relevent data to
956 that file. With a numeric prefix argument, they copy the relevant data to the
957 corresponding open database.
960 ** Timestamps
961 #timestamps
963 Ebib provides the possibility to add a timestamp to every new entry, recording
964 the time it was added to the database. The timestamp is recorded in the
965 (additional) field =timestamp=. (By default, this field is not shown, but you can
966 make it visible by pressing =H= in the index buffer.)
968 You can tell Ebib to create timestamps by setting the option =Use Timestamp= in
969 Ebib's customisation buffer. With this option set, a timestamp is included in
970 entries added to the database with =a=. Ebib will also add a timestamp to entries
971 imported from a buffer or merged from a file, and to entries exported to another
972 database or to a file. When importing or exporting entries, existing timestamps
973 will be overwritten. The logic behind this is that the timestamp records the
974 date and time when the entry was added to the database, not when it was first
975 created.
977 Note that if this option is unset, the timestamp of an entry is retained when
978 it's imported or exported. Therefore, if you record timestamps and want to
979 im-/export entries without changing their timestamps, temporarily unset this
980 option.
982 Ebib uses the function =format-time-string= to create the timestamp. The format
983 string that Ebib uses can be customised in Ebib's customisation buffer. The
984 default string is ="%a %b %e %T %Y"=, which produces a timestamp of the form ="Mon
985 Mar 12 01:03:26 2007"=. Obviously, this string is not suited for sorting, so if
986 you want to be able to sort on timestamps, you'll need to customise the format
987 string. See the documentation for =format-time-string= on the options that are
988 available.
991 ** Multiple Identical Fields
992 #multiple-identical-fields
994 Under normal circumstances, a BibTeX entry only contains one occurrence of each
995 field. If BibTeX notices that an entry contains more than one occurrence of an
996 obligatory or optional field, it issues a warning. Ebib is somewhat less
997 gracious, it simply takes the value of the last occurrence without giving any
998 warning. (Note, by the way, that BibTeX will use the value of the *first*
999 occurrence, not the last.) When additional fields appear more than once in an
1000 entry, BibTeX does not warn you, since it ignores those fields anyway. Here,
1001 too, Ebib's standard behaviour is to ignore all but the last value.
1003 However, some online reference management services ``use'' this feature of
1004 BibTeX in that they put multiple =keywords= fields in the BibTeX entries that they
1005 produce. If you were to import such an entry into Ebib, you would lose all your
1006 keywords except the last one. To remedy this, you can tell Ebib that it should
1007 allow multiple occurrences of a single field in a BibTeX entry. You can do this
1008 by setting the customisation option [[#allow-identical-fields][Allow Identical Fields]].
1010 With this option set, Ebib collapses the multiple occurrences into a single
1011 occurrence. All the values of the different occurrences are collected and stored
1012 in the single occurrence, separated by semicolons. That is, Ebib does not retain
1013 the multiple occurrences, but it does retain the values. So suppose you have an
1014 entry that contains the following =keywords= fields:
1016 <example>
1017 @book{jones1998,
1018     author = {Jones, Joan},
1019     year = {1998},
1020     ...
1021     keywords = {sleep},
1022     keywords = {winter},
1023     keywords = {hybernation}
1025 </example>
1027 If you load this entry into Ebib with the option =Allow Identical Fields= set, you
1028 will get the following:
1030 <example>
1031 @book{jones1998,
1032     author = {Jones, Joan},
1033     year = {1998},
1034     ...
1035     keywords = {sleep; winter; hybernation}
1037 </example>
1040 ** Virtual Databases
1041 #virtual-databases
1043 In the previous chapter, Ebib's basic search functionality was discussed. (See
1044 [[#searching][Searching]].) Ebib also provides a much more sophisticated search and filtering
1045 mechanism in the form of *virtual databases*.
1047 A virtual database is a database that is not associated with any =.bib= file.
1048 Rather, it is created from another database by selecting entries from it based
1049 on a specific search pattern, called a *filter*. This allows you, for example, to
1050 select all entries from a database that contain the string ``Jones'' in their
1051 =author= field. A filter can be as complex as you want: you can select all entries
1052 that do *not* contain ``Jones'' in the =author= field, or all entries that contain
1053 ``Jones'' in either the =author= or the =editor= field, or all entries that contain
1054 ``Jones'' in the =author= field, and ``symbiotic hybernation'' in the =keyword=
1055 field, etc. Basically, the filter can consist of an arbitray number of search
1056 criteria combined with the logical operators =and, or= and =not=.
1059 *** Simple Selection
1061 Creating a virtual database is simple: press =&=, and Ebib will ask you for a
1062 field to select on, and for a regular expression to select with. So if you want
1063 to select all entries that contain ``Jones'' in the =author= field, you press =&=
1064 and type =author= as the field and =Jones= as the regexp to filter on.
1066 Ebib will then create a virtual database containing the entries matching your
1067 selection criterion. A virtual database has the same name as the database it is
1068 based on, prepended with =V:=. It also has a number like any other database, and
1069 you can move back and forth to other databases with the number or cursor keys.
1071 If you don't want to filter on one specific field but rather want to select all
1072 entries that match a certain regexp in any field, you can type =any= as the field
1073 to filter on. So specifying =any= as the field and =Jones= as the regexp, the
1074 virtual database will select all entries that have a field that contains
1075 ``Jones'' in them.
1078 *** Complex Filters
1080 Once you have a virtual database, it remains associated with the database it was
1081 created from. This means that you can refine or extend the selection (i.e. the
1082 filter) that the virtual database is based on. If, in the current example, you
1083 want to include all the entries that have ``Jones'' in the =editor= field, you
1084 have to perform a logical =or= operation: you want to select an entry if it
1085 contains ``Jones'' in the =author= field (which you already did) *or* if it contains
1086 ``Jones'' in the =editor= field.
1088 A short sidenote: the first impulse in a case like this might be to use =and=
1089 instead of =or=: after all, you want to select all entries that contain ``Jones''
1090 in the =author= field *and* all entries that contain ``Jones'' in the =editor= field.
1091 However, the filter that you build up is used to test each entry *individually*
1092 whether it meets the selection criterion. An entry meets the criterion if it
1093 contains ``Jones'' in the =author= field *or* if it contains ``Jones'' in the =editor=
1094 field. Therefore, =or= is the required operator in this case. If you would use
1095 =and=, you would only get those entries that contain ``Jones'' in both the =author=
1096 *and* =editor= fields.
1098 To perform a logical =or= operation, press the key =|=. As before, you will be asked
1099 which field you want to filter on, and which regexp you want to filter with.
1100 Ebib will then update the virtual database with all entries in the original
1101 database that match the additional criterion.
1103 It is also possible to perform a logical =and= on the virtual database. Use this
1104 if you want to select those entries that contain ``Jones'' in the =author= field
1105 and e.g. ``symbiotic hybernation'' in the =keyword= field. A logical =and= operation
1106 is done with the key =&=. (Note: this is the same key that is used to create a
1107 virtual database. In fact, you can also create a virtual database with =|=: when
1108 used in a normal database, =&= and =|= are equivalent. They are only different in
1109 virtual databases.)
1111 Both the =&= and =|= commands can be used with the negative prefix argument =M--= (or
1112 =C-u -=, which is identical). In this case, the search criterion is negated. That
1113 is, the negative prefix argument performs a logical =not= operation on the search
1114 criterion.
1116 That is, if you want to select all entries from a database that do *not* contain
1117 ``Jones'' in the =author= field, you can do this by typing =M-- &= and then filling
1118 out the relevant field and regexp. This prefix argument is available both in
1119 real and in virtual databases.
1121 There is another way of performing a logical =not= operation, which is only
1122 available in virtual databases: by pressing the key =~=, you invert the current
1123 filter. That is, if you have a virtual database with all the entries containing
1124 ``Jones'' in the =author= or in the =editor= field, and you press =~=, the selection
1125 is inverted, and now contains all entries that do *not* have ``Jones'' in the
1126 =author= or =editor= field.
1128 Although =~= and the negative prefix argument to =&= or =|= both perform logical =not=
1129 operations, they are *not* equivalent: =~= negates the entire filter built up so
1130 far, while the negative prefix argument only negates the single selection
1131 criterion you enter with it.
1133 If you want to know what the filter for the current virtual database is exactly,
1134 you can type =V=. This command displays the current filter in the minibuffer. The
1135 filter is specified as a Lisp expression, meaning that the operators appear
1136 before their operands, not in between them. That is, =x and y= is written as =(and
1137 x y)=.
1139 With a prefix argument (any prefix argument will do), the command =V= not only
1140 displays the current filter, but also reapplies it. This can be useful when
1141 you've made changes to the source database: Ebib does not automatically update a
1142 virtual database when its source database is modified.
1145 *** Properties of Virtual Databases
1147 Virtual databases differ from normal databases in several ways. First, they
1148 cannot be modified: you cannot add or delete entries, and you cannot modify the
1149 contents of fields. It is also not possible to import entries to them or merge
1150 another file with them. Furthermore, it is not possible to export entries to
1151 them or from them.
1153 A virtual database cannot be saved in the normal way with =s=, and the command =S=
1154 to save all databases ignores virtual databases. If you want to save a virtual
1155 database, you can use the command =w=. This command not only saves the virtual
1156 database, it also changes it into a normal database, and detaches it from its
1157 original source database, so that you can modify it without affecting the source
1158 database.
1160 The command =L= also doesn't work with virtual databases. The reason for this is
1161 that the virtual database is not associated with an actual =.bib= file, so there
1162 is no file to create a list of references from. However, it is possible to use
1163 the command =P= with a virtual database to create a list of entries. See
1164 [[#printing-database][Printing the Database]], for details on these two commands.
1167 ** The Multiline Edit Buffer
1168 #multiline-edit-buffer
1170 As mentioned several times before, Ebib has a special multiline edit buffer,
1171 which is used to edit field values that contain newlines (so-called *multiline
1172 fields*), and also to edit the contents of the =@preamble= command. This section
1173 discusses the details of this buffer.
1175 Ebib enters multiline edit mode in one of three cases: when you press =P= in the
1176 index buffer, to edit the =@preamble= definition, when you hit =l= in the entry
1177 buffer to edit the current field as multiline, or when you hit =e= on the =annote=
1178 field, or on a field whose value already is multiline.
1180 The mode that is used in the multiline edit buffer is user-condigurable. The
1181 default value is =text-mode=, but if you prefer to use some other mode, you can
1182 specify this through the customization options. (Personally, I use =markdown-mode=
1183 in the multiline edit buffer, so that I can use [[http://daringfireball.net/projects/markdown/][markdown]] to write annotations.)
1185 Three commands are relevant for interacting with Ebib when you're in the
1186 multiline edit buffer. These are =ebib-quit-multiline-edit=,
1187 =ebib-save-from-multiline-edit= and =ebib-cancel-multiline-edit=. These have to be
1188 invoked with =M-x=, they are not bound to any keys. (Binding them to keys would
1189 bind them for the major mode in general, i.e., the bindings would also be
1190 available in other, non-Ebib, buffers that use the same major mode. Which is
1191 most likely not what you want.)
1193 =ebib-quit-multiline-edit= leaves the multiline edit buffer and stores the text in
1194 the database. If you invoke this command when the buffer is empty (including the
1195 final newline!) and you were editing a field value or the =@preamble=, the field
1196 value or preamble is deleted. (This is in fact the *only* way to delete the
1197 =@preamble= definition. Field values on the other hand can also be deleted by
1198 hitting =x= or =d= on them in the entry buffer.) If you were editing a =@string=
1199 value, Ebib will just complain, because string definitions cannot be empty.
1201 =ebib-cancel-multiline-edit= also leaves the multiline edit buffer, but it does so
1202 without storing the text. The original value of the field, string or preamble
1203 will be retained. If the text was modified, Ebib will ask for a confirmation
1204 before leaving the buffer.
1206 =ebib-save-from-multiline-edit= can be used in the multiline edit buffer to save
1207 the database. This command first stores the text in the database and then saves
1208 it. Because Ebib does not do an autosave of the current database, it is
1209 advisable to save the database manually every now and then to prevent data loss
1210 in case of crashes. It would be annoying to have to leave the multiline edit
1211 buffer every time you want to do this, so this command has been provided to
1212 allow you to do this from within the buffer.
1215 * The Ebib Buffers
1216 #ebib-buffers
1218 This chapter lists all the key commands that exist in Ebib, with a short
1219 description and the actual command that they call. The latter information is
1220 needed if you want to customise Ebib's key bindings. (See
1221 [[#modifying-key-bindings][Modifying Key Bindings]].)
1225 ** The Index Buffer
1227   =Up= :: go to previous entry. =(ebib-prev-entry)=
1229   =Down= :: go to next entry. =(ebib-next-entry)=
1231   =Right= :: move to the next database. =(ebib-next-database)=
1232   
1233   =Left= :: move to the previous database. =(ebib-prev-database)=
1235   =PgUp= :: scroll the index buffer down. =(ebib-index-scroll-down)=
1237   =PgDn= :: scroll the index buffer up. =(ebib-index-scroll-up)=
1238   
1239   =Home= :: go to first entry. =(ebib-goto-first-entry)=
1241   =End= :: go to last entry. =(ebib-goto-last-entry)=
1243   =Return= :: make the entry under the cursor current. Use after e.g. =C-s=.
1244 =(ebib-select-entry)=
1245   
1246   =Space= :: equivalent to =PgDn=.
1247   
1248   =1-9= :: jump to the corresponding database.
1250   =/= :: search the database. =(ebib-search)=
1251   
1252   =&= :: Create a virtual database, or perform a logical =and= on the current
1253 virtual database. With negative prefix argument: apply a logical =not= to the
1254 selectional criterion. =(ebib-virtual-db-and)=
1256   =|= :: Create a virtual database, or perform a logical =or= on the current
1257 virtual database. With negative prefix argument: apply a logical =not= to the
1258 selectional criterion. =(ebib-virtual-db-or)=
1260   =~= :: Perform a logical =not= on the current virtual
1261 database. =(ebib-virtual-db-not)=
1263   =a= :: add an entry. =(ebib-add-entry)=
1265   =b= :: equivalent to =Pgup=.
1267   =c= :: close the database. =(ebib-close-database)=
1268   
1269   =C= :: customise Ebib. =(ebib-customize)=
1271   =d= :: delete the current entry. =(ebib-delete-entry)=
1273   =; d= :: delete all marked entries.
1275   =e= :: edit the current entry. =(ebib-edit-entry)=
1276   
1277   =E= :: edit the key of the current entry. =(ebib-edit-keyname)=
1279   =f= :: extract a filename from the =file= field and send it to an appropriate
1280 viewer. With numeric prefix argument, extract the *n*-th filename.
1282   =F= :: follow =crossref= field. =(ebib-follow-crossref)=
1284   =g= :: equivalent to =Home=.
1286   =G= :: equivalent to =End=.
1288   =H= :: show/hide hidden fields. =(ebib-toggle-hidden)=
1290   =j= :: equivalent to =Down=.
1292   =J= :: jump to another database. This accepts a numeric prefix argument, but
1293 will ask you for a database number if there is none. =(ebib-switch-to-database)=
1295   =k= :: equivalent to =Up=.
1297   =l= :: show the log buffer. (=ebib-show-log=)
1299   =L= :: create a LaTeX file from the current database that produces a list of
1300 references formatted by BibTeX. =(ebib-latex-database)=
1302   =; L= :: create a LaTeX file with the marked entries only.
1304   =m= :: mark (or unmark) the current entry. =(ebib-mark-entry)=
1306   =; m= :: unmark all marked entries.
1308   =M= :: merge a =.bib= file. =(ebib-merge-bibtex-file)=
1309   
1310   =n= :: find next occurrence of the search string. =(ebib-search-next)=
1312   =N= :: search for entries cross-referencing the current one. =(ebib-search-crossref)=
1314   =C-n= :: equivalent to =Down=.
1316   =M-n= :: equivalent to =PgDn=.
1317   
1318   =o= :: open a =.bib= file. =(ebib-load-bibtex-file)=
1320   =p= :: push an entry to a LaTeX buffer =(ebib-push-bibtex-key)=
1322   =; p= :: push the marked entries to a LaTeX buffer.
1324   =C-p= :: equivalent to =Up=.
1326   =M-p= :: equivalent to =PgUp=.
1328   =P= :: create a LaTeX file for printing the database, listing the entire
1329 contents of each entry. =(ebib-print-database)=
1331   =; P= :: create a LaTeX file with the marked entries.
1333   =r= :: show and edit the =@preamble= definition in the
1334 database. =(ebib-edit-preamble)=
1336   =q= :: quit Ebib. This sets all variables to nil, unloads the database(s) and
1337 quits Ebib. =(ebib-quit)=
1339   =s= :: save the database. =(ebib-save-current-database)=
1341   =S= :: save all modified databases. =(ebib-save-all-databases)=
1343   =t= :: show and edit the =@string= definitions in the database.
1344 =(ebib-edit-strings)=
1346   =u= :: extract a URL from the =url= field and send it to a browser. With numeric
1347 prefix argument, extract the *n*-th url.
1349   =V= :: Display the filter of the current virtual database in the minibuffer.
1350 With prefix argument: reapply the filter. =(ebib-print-filter)=
1352   =w= :: write the database to a different file. =(ebib-write-database)=
1354   =x= :: export the current entry to a file, or, when used with numeric prefix
1355 argument, to another database. =(ebib-export-entry)=
1357   =; x= :: export the marked entries to a file, or, when used with a numeric
1358 prefix argument, to another database.
1360   =C-x b= :: equivalent to =z=.
1362   =C-x k= :: equivalent to =q=.
1364   =X= :: export the =@preamble= definition to a file or, when used with a numeric
1365 prefix argument, to another database. =(ebib-export-preamble)=
1367   =z= :: move focus away from the Ebib windows. =(ebib-leave-ebib-windows)=
1369   =Z= :: put Ebib in the background. =(ebib-lower)=
1371 One function is not bound to any key: =ebib-print-filename=.
1373 ** The Entry Buffer
1375   =Up= :: go to the previous field. =(ebib-prev-field)=
1377   =Down= :: go to the next field. =(ebib-next-field)=
1379   =PgUp= :: go to the previous set of fields. =(ebib-goto-prev-set)=
1381   =PgDn= :: go to the next set of fields. =(ebib-goto-next-set)=
1382   
1383   =Home= :: go to the first field. =(ebib-goto-first-field)=
1384   
1385   =End= :: go to the last field. =(ebib-goto-last-field)=
1387   =Space= :: equivalent to =PgDn=.
1389   =b= :: equivalent to =PgUp=.
1391   =c= :: copy the contents of the current field to the kill ring.
1392 =(ebib-copy-field-contents)=
1394   =d= :: delete the value of the current field. The deleted contents will *not* be
1395 put in the kill ring, and is therefore irretrievably lost.
1396 =(ebib-delete-field-contents)=
1397   
1398   =e= :: edit the current field. =(ebib-edit-fields)=
1400   =f= :: extract a filename from the current field and send it to an appropriate
1401 viewer. With numeric prefix argument, extract the *n*-th filename.
1403   =g= :: equivalent to =Home=.
1404   
1405   =G= :: equivalent to =End=.
1407   =j= :: go to the next field. =(ebib-next-field)=
1409   =k= :: go to the previous field. =(ebib-prev-field)=
1411   =l= :: edit the current field as multiline. =(ebib-edit-multiline-field)=
1413   =C-n= :: equivalent to =Down=.
1415   =M-n= :: equivalent to =PgDn=.
1416   
1417   =C-p= :: equivalent to =Up=.
1419   =M-p= :: equivalent to =PgUp=.
1421   =q= :: quit editing the current entry and return focus to the index buffer.
1422 =(ebib-quit-entry-buffer)=
1424   =r= :: toggle a field's ``raw'' status. =(ebib-toggle-raw)=
1425   
1426   =s= :: insert an abbreviation from the =@string= definitions in the
1427 database. =(ebib-insert-abbreviation)=
1429   =u= :: extract a URL from the current field and send it to a browser. With
1430 numeric prefix argument, extract the *n*-th url.
1432   =x= :: cut the contents of the current field. Like =c=, =x= puts the contents of the
1433 current field in the kill ring. =(ebib-cut-field-contents)=
1435   =y= :: yank the last element in the kill ring to the current field. Repeated use
1436 of =y= functions like =C-y/M-y=. Note that no text will be yanked if the field
1437 already has a value. =(ebib-yank-field-contents)=
1440 ** The Strings Buffer
1442   =Up= :: go to the previous string. =(ebib-prev-string)=
1444   =Down= :: go to the next string. =(ebib-next-string)=
1446   =PgUp= :: go ten strings up. =(ebib-strings-page-up)=
1448   =PgDn= :: go ten strings down. =(ebib-strings-page-down)=
1450   =Home= :: go to the first string. =(ebib-goto-first-string)=
1451   
1452   =End= :: go to the last string. =(ebib-goto-last-string)=
1454   =Space= :: equivalent to =PgDn=.
1456   =a= :: add a new =@string= definition. =(ebib-add-string)=
1458   =b= :: equivalent to =PgUp=.
1460   =c= :: copy the text of the current string to the kill ring.
1461 =(ebib-copy-string-contents)=
1462   
1463   =d= :: delete the current =@string= definition from the database. You will be
1464 asked for confirmation. =(ebib-delete-string)=
1465   
1466   =e= :: edit the value of the current string. =(ebib-edit-string)=
1468   =g= :: equivalent to =Home=.
1469   
1470   =G= :: equivalent to =End=.
1472   =j= :: equivalent to =Down=.
1474   =k= :: equivalent to =Up=.
1476   =l= :: edit the value of the current string as multiline.
1477 =(ebib-edit-multiline-string)=
1479   =C-n= :: equivalent to =Down=.
1481   =M-n= :: equivalent to =PgDn=.
1483   =C-p= :: equivalent to =Up=.
1485   =M-p=  :: equivalent to =PgUp=.
1487   =q= :: quit the strings buffer and return focus to the index buffer.
1488 =(ebib-quit-strings-buffer)=
1490   =x= :: export the current =@string= definition to a file or, when used with a
1491 prefix argument, to another database. =(ebib-export-string)=
1492   
1493   =X= :: export all the =@string= definitions to a file or, when used with a prefix
1494 argument, to another database. =(ebib-export-all-strings)=
1497 * Customisation
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
1506 #customisation-buffer
1508 Ebib's customisation group is a subgroup of the =Tex= group. It can be invoked by
1509 typing =M-x customize-group RET ebib RET=, or by pressing =C= in the index buffer.
1510 This chapter gives a short description of all the options available in the
1511 customisation buffer.
1514 *** Default Type
1516 The default type is the default entry type given to a new entry. Every entry in
1517 the Ebib database must have a type, because the type defines which fields are
1518 available. When a new entry is created, Ebib gives it a default type, which can
1519 be customised through this option. The standard value is =article=.
1522 *** Preload Bib Files
1523 #preload-bib-files
1525 This option allows you to specify which file(s) Ebib is to load when it starts
1526 up. Specify one file per line, press the =INS= button to add more files. You can
1527 complete a partial filename with =M-TAB=.
1530 *** Additional Fields
1531 #additional-fields
1533 The additional fields are those fields that are available for all entry types,
1534 and which BibTeX generally ignores. This option allows you to specify which
1535 additional fields you wish to use in your database. Specify one field per line,
1536 press the =INS= button to add more fields.
1538 By default, the following additional fields are defined: =crossref, url, annote,
1539 abstract, keywords, file= and =timestamp=.
1542 *** Layout
1543 #layout
1545 The default value of this option is =full=, which means that Ebib takes over the
1546 entire frame when it runs. Alternatively, you can select to specify a width (in
1547 characters) yourself, in which case Ebib takes up the right part of the frame,
1548 leaving the left part free. See [[#screen-layout][Screen Layout]] for details.
1551 *** Index Window Size
1553 This option lets you specify the size of the index window at the top of the Ebib
1554 screen. The default value is 10.
1557 *** Index Display Fields
1558 #index-display-fields
1560 This option allows you to specify fields that should be displayed next to the
1561 entry key in the index buffer. By default, the index buffer only shows the key
1562 of each entry, but if this is too little information, you can use this option to
1563 display e.g. the title of each entry as well.
1566 *** Insertion Commands
1567 #insertion-commands
1569 With the command =ebib-insert-bibtex-key= or with the command key =p= in the index
1570 buffer, you can insert a BibTeX key into a LaTeX buffer. This option allows you
1571 to define the commands that are available through tab completion when these
1572 functions ask for a citation command.
1574 The citation commands must be given *without* the leading backslash, as Ebib adds
1575 one. Furthermore, you need to specify how many optional arguments each command
1576 can have. When Ebib prompts you for a citation key, it will ask for as many
1577 optional arguments as you specify here. (If you don't want to be asked for those
1578 optional arguments, just fill in 0.)
1580 When Ebib prompts you for a citation command, the commands specified in this
1581 option can be obtained through tab completion. However, it is not necessary to
1582 fill in a command from this list here. You can also enter another command (in
1583 which case Ebib asks for exactly one optional argument) or even no command at
1584 all. In the latter case, Ebib does not ask for any optional arguments and simply
1585 puts the key in the buffer without adding a backslash or curly braces.
1588 *** Multiline Edit Mode
1590 This specifies the major mode used in the multiline edit buffer. The default
1591 value is =text-mode=. Note that the value *must* be a command for a major mode.
1594 *** Sort Order
1596 The use of this option is explained above, see [[#sorting-bib-file][Sorting the .bib file]]. To create
1597 a sort order, click the =INS= button to create a sort level, and then click the
1598 =INS= button under that sort level to enter a sort field. If you want to add more
1599 than one sort field to the sort level, simply hit =INS= again.
1602 *** Save Xrefs First
1603 #save-xrefs-first
1605 For cross-referencing to work, the cross-referencing entries must appear in the
1606 =.bib= file *before* the cross-referenced entries. In order to tell Ebib to save all
1607 entries with a =crossref= field first, you must set the option =Save Xrefs First= in
1608 Ebib's customisation buffer. With this option set, BibTeX's crossreferencing
1609 options work as intended.
1611 By default, this option is unset, because it (marginally) slows down saving the
1612 =.bib= file somewhat.
1615 *** Crossref Face
1616 #crossref-face
1618 Field values inherited from a cross-referenced entry are marked with this face.
1619 By default, the face has red as foreground colour.
1622 *** Marked Face
1623 #marked-face
1625 When entries are marked (with =m=), they are highlighted in this face. By default,
1626 GNU Emacs uses the text property =highlight=. XEmacs only allows this on
1627 terminals, therefore it displays marked entries with a red background and a
1628 white foreground colour. This option allows you to change these defaults.
1631 *** Use Timestamp
1633 If this option is set, Ebib will add a =timestamp= field to every new entry,
1634 recording the date and time it was added to the database. See [[#timestamps][Timestamps]].
1637 *** Timestamp Format
1639 This option specifies the format string that is used to create the timestamp.
1640 The format string is used by =format-time-string= to create a time representation.
1641 The default value is ="%a %b %e %T %Y"=, which produces a timestamp of the form
1642 ="Mon Mar 12 01:03:26 2007"=. See the documentation for =format-time-string= for the
1643 forms that the format string can take.
1646 *** Standard Url Field
1647 #standard-url-field
1649 This is the field that Ebib searches for URLs if you press =u= in the index
1650 buffer. Its default value is =url=.
1653 *** Url Regexp
1654 #url-regexp
1656 This is the regular expression that Ebib uses to search for URLs in a field. The
1657 default value is:
1659 <example>
1660 \\url{\(.*\)}\|https?://[^ '<>\"\n\t\f]+
1661 </example>
1663 With this regular expression, Ebib considers everything that is in a LaTeX
1664 <verb>\url{...}</verb> command as a URL, and furthermore every string of text
1665 that starts with =http://= or =https://= and does not contain whitespace or one of
1666 the characters =' " <= or =>=.
1669 *** Browser Command
1670 #browser-command
1672 If this option is unset (which is the default), Ebib uses the Emacs function
1673 =browse-url= to start a browser. If this function does not exist, you can set this
1674 option. For example, if you use the Firefox browser, set this option to =firefox=.
1676 For this to work, the browser that you use must be able to handle a URL on the
1677 command line.
1680 *** Standard File Field
1681 #standard-file-field
1683 This is the field that Ebib searches for filenames if you press =f= in the index
1684 buffer. Its default value is =file=.
1687 *** File Associations
1688 #file-associations
1690 The programs used to view files. By default, programs for =.pdf= and =.ps= files are
1691 specified, which should be available on most linux systems. If you prefer other
1692 programs or are running on Windows, you'll can specify them here. Note that Ebib
1693 searches the PATH for the programs, but you can also specify full path names. Of
1694 course, it is also possible to add new associations.
1696 Note that GNU/Emacs 23 (as yet unreleased) comes with =doc-view-mode=, which
1697 provides a way to view =.pdf= and =.ps= files inside Emacs. (The files are converted
1698 to =.png= format first.) If you prefer to use this mode, simply leave the program
1699 field blank for the relevant file type.
1702 *** File Regexp
1703 #file-regexp
1705 In order to find files in a field, Ebib uses a regular expression. The default
1706 value is:
1708 <example>
1709   [^?|\:*<>\" \n\t\f]+
1710 </example>
1712 This essentially means that every string of characters not containing any of the
1713 characters
1715 <example>? | \ : * < > "</example>
1717 or space, newline, tab of formfeed. URLs can easily by recognised by the prefix
1718 =http:=, but recognising files is not so straightforward. It is therefore not
1719 advisable to put anything but filenames in the =file= field.
1722 *** File Search Dirs
1723 #file-search-dirs
1725 This is the list of directories that Ebib searches for files. Note that
1726 searching is not recursive: only the files listed here are searched, not their
1727 subdirectories.
1730 *** Print Preamble
1732 This option specifies the preamble that is to be added to the LaTeX file Ebib
1733 creates for printing the database (i.e., the =P= command). By default, the
1734 preamble is empty. You can set your own <verb>\usepackage</verb> commands, or
1735 anything else you may need.
1738 *** Print Multiline
1740 When this options is set, Ebib includes multiline field values when it creates a
1741 LaTeX file with =P= (=ebib-print-database=). When unset, multiline values are
1742 excluded, which saves space. By default, this option is unset.
1745 *** Latex Preamble
1747 This option specifies the preamble to be added to the LaTeX file for creating a
1748 list of references from the database (i.e., the =L= command). By default, the line
1749 <verb>\bibliographystyle{plain}</verb> is put in the preamble, but you may want
1750 to specify your own BibTeX packages and options.
1753 *** Print Tempfile
1755 This option specifies the name and location of the temporary file Ebib creates
1756 with the commands =ebib-print-database= and =ebib-latex-database=. By default, this
1757 option has no value, which means that Ebib will ask for a filename each time
1758 either of these commands is called.
1761 *** Allow Identical Fields
1762 #allow-identical-fields
1764 If this option is set, Ebib stores the values of multiple occurrences of a
1765 single field within an entry in a single occurrence of that field, separated by
1766 semicolons. By default, this option is unset, because it slows down the loading
1767 of =.bib= files. See [[#multiple-identical-fields][Multiple Identical Fields]].
1770 *** Entry Types
1771 #entry-types
1773 This option allows you to customise the entry types that Ebib uses. Each entry
1774 type has a name, a set of obligatory fields and a set of optional fields. You
1775 can add, alter or delete single fields in an entry type, or whole entry types.
1777 If you want to add an entry type, hit the =INS= key on the top level and give the
1778 new entry a name, then add obligatory and/or optional fields. It is not
1779 necessary that an entry type has both obligatory and optional fields, you can
1780 define an entry that has only obligatory or only optional fields.
1783 ** Modifying Key Bindings
1784 #modifying-key-bindings
1786 If you are unhappy about Ebib's standard key bindings, you can change them to
1787 anything you like. To do this, you have to create a file =~/.ebibrc= and write
1788 your preferred key bindings in it. A key binding definition is built up as
1789 follows:
1791 <example>
1792 (ebib-key <buffer> <key> <command>)
1793 </example>
1795 =<buffer>= is either =index=, =entry= or =strings=, for the corresponding buffer. =<key>=
1796 is a standard Emacs key description, and =<command>= is the Ebib command to be
1797 associated with the key. The commands that can be used here are listed in
1798 [[#ebib-buffers][The Ebib Buffers]]. Note that it is possible to bind more than one key to a single
1799 function: just add as many =ebib-key= statements as necessary.
1801 As an example, the following binds =C-s= to =ebib-search= in the index buffer, so
1802 that the database can be searched with =C-s= as well as with =/=:
1804 <example>
1805 (ebib-key index "\C-s" ebib-search)
1806 </example>
1808 If you want to unbind a key, you can simply leave out =<command>=. So if you want
1809 to bind the command =ebib-delete-entry= to =D= rather than =d=, you need to put the
1810 following in =.ebibrc=:
1812 <example>
1813 (ebib-key index "D" ebib-delete-entry)
1814 (ebib-key index "d")
1815 </example>
1817 The first line binds =D= to the command =ebib-delete-entry=. The second line unbinds
1818 =d=.
1820 If a command can be called with a prefix key (as for example =ebib-delete-entry=
1821 can), =ebib-key= will automatically rebind the prefixed version as well. So in the
1822 example above, the first line not only binds =D=, it also binds =; D=. Similarly,
1823 the second line not only unbinds =d=, but also =; d=.
1825 It is also possible to redefine the prefix key itself. To do this, you must
1826 specify =mark-prefix= for =<buffer>=. The value of =<command>= is irrelevant here, so
1827 it can be left out:
1829 <example>
1830 (ebib-key mark-prefix ":")
1831 </example>
1833 This sets up =:= as the new prefix key. Doing this automatically unbinds the
1834 existing prefix key.
1836 </div>