-
Notifications
You must be signed in to change notification settings - Fork 37
/
ebib.info
3386 lines (2783 loc) · 160 KB
/
ebib.info
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
This is ebib.info, produced by makeinfo version 7.1.1 from ebib.texi.
INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
* Ebib: (ebib). A BibTeX database manager.
END-INFO-DIR-ENTRY
File: ebib.info, Node: Top, Next: Installation, Up: (dir)
Ebib Manual
***********
Ebib is a program with which you can manage ‘biblatex’ and BibTeX
database files without having to edit the raw ‘.bib’ files. It runs in
GNU/Emacs, version 26.1 or higher.
It should be noted that Ebib is _not_ a minor or major mode for editing
‘.bib’ files. It is a program in itself, which just happens to make use
of Emacs as a working environment, in the same way that for example Gnus
is.
* Menu:
* Installation::
* Getting Started::
* Editing the Database::
* Main and Dependent Databases::
* Inserting Citations into a Text Buffer::
* Searching::
* Filters::
* Importing BibTeX entries::
* Linking to external resources::
* Notes files::
* Managing a reading list::
* Managing Keywords::
* Window Management::
* Copying Entries to the Kill Ring::
* Printing the Database::
* Customisation::
File: ebib.info, Node: Installation, Next: Getting Started, Prev: Top, Up: Top
1 Installation
**************
* Menu:
* Package manager::
* Manual installation::
* News::
* Starting Ebib::
File: ebib.info, Node: Package manager, Next: Manual installation, Up: Installation
1.1 Package manager
===================
The easiest way to install Ebib is to get it from the Melpa package
archive (http://melpa.org/). This also installs the Info file so you
can access the Ebib manual within Emacs.
File: ebib.info, Node: Manual installation, Next: News, Prev: Package manager, Up: Installation
1.2 Manual installation
=======================
It's also possible to install Ebib manually. If you prefer this method,
then you probably know what you're doing, so detailed instructions are
omitted here. Just be sure to also install the parsebib
(https://github.com/joostkremers/parsebib) package, which Ebib depends
on.
File: ebib.info, Node: News, Next: Starting Ebib, Prev: Manual installation, Up: Installation
1.3 News
========
New features and (possibly breaking) changes to existing features are
announced in the NEWS (NEWS.html) file.
File: ebib.info, Node: Starting Ebib, Prev: News, Up: Installation
1.4 Starting Ebib
=================
Once installed, Ebib can be started with ‘M-x ebib’. This command is
also used to return to Ebib when you have put the program in the
background. To bind this command globally to e.g., ‘C-c e’, put
something like the following in Emacs' init file:
(global-set-key (kbd "C-c e") 'ebib)
Ebib can also be called from an Eshell command line. When used in this
way, you can provide a filename to load. So, provided a file
‘references.bib’ exists in ‘~/Work/Papers/’, the following command:
~/Work/Papers $ ebib references.bib
starts Ebib and loads the file ‘references.bib’.
File: ebib.info, Node: Getting Started, Next: Editing the Database, Prev: Installation, Up: Top
2 Getting Started
*****************
A BibTeX database is somewhat of a free-form database. A BibTeX entry
consists of a set of field-value pairs and each entry is known by a
unique key. The way that Ebib navigates this database is by having two
windows, one that contains a list of all the entries in the database,
and one that contains the fields and values of the currently highlighted
entry.
When Ebib is started (with ‘M-x ebib’), the current windows in Emacs are
hidden and the Emacs frame is divided into two windows. The top one
contains a buffer that is called the _index buffer_, while the lower
window shows the _entry buffer_. When a database is loaded, the index
buffer holds a list of all the keys in the database plus some additional
information for each entry: the author or editor, its year of
publication, and the title.
Ebib has a menu through which all of its functionality can be accessed.
Most functions are also bound to keys, but especially some of the lesser
used ones can (by default) only be accessed through the menu.
To quit Ebib and unload all ‘.bib’ files, type ‘q’. Alternatively, type
‘z’ to put Ebib in the background but keep it active. This way, the
‘.bib’ files that you have opened remain loaded, and you can return to
them by typing ‘M-x ebib’ again.
* Menu:
* Opening a bib File::
* Preloading bib Files::
* Starting a New bib File::
* Closing a database::
* The Database View::
* Navigating the Database::
* Displaying and Sorting the Entries List::
* Biblatex vs BibTeX::
File: ebib.info, Node: Opening a bib File, Next: Preloading bib Files, Up: Getting Started
2.1 Opening a ‘.bib’ File
=========================
To open a ‘.bib’ file, type ‘o’. Ebib reads the file that you specify
and reports how many entries it found, how many ‘@String’ definitions it
found, and whether a ‘@Preamble’ was found. If Ebib encounters entry
types in the ‘.bib’ file that it does not know, a warning will be logged
to a special buffer ‘*Ebib-log*’. If Ebib finds something that it
cannot parse, it will log an error. Ebib attempts to be as liberal as
possible, so everything that looks like a BibTeX entry will be read, but
if you open a ‘.bib’ file that wasn't written by Ebib, it is always a
good idea to check the log buffer to see if everything is in order.
In order to parse ‘.bib’ files, Ebib uses the entry type definitions of
‘bibtex.el’, which is fairly complete, but if you use non-standard entry
types, you may need to customise ‘bibtex-biblatex-entry-alist’ or
‘bibtex-bibtex-entry-alist’, depending on which of the two you use. If
Ebib finds entry types in a ‘.bib’ file that are not defined, those
entries will still be loaded, but their entry type is displayed using
Emacs' ‘error’ face. The most likely case in which this may happen is
when you load a BibTeX file without letting Ebib know the file is
‘biblatex’-specific. By default, Ebib assumes that a ‘.bib’ file it
loads is a BibTeX file. If you intend to use ‘biblatex’ files, make
sure to read the section *note ‘Biblatex’ vs. Bibtex:
#biblatex-vs-bibtex.
When you open a ‘.bib’ file, the directory in which you started Ebib is
the start directory for file name completion. If you always want Ebib
to assume a specific default directory, regardless of the directory in
which Ebib is actually started, you can customise the option
‘ebib-default-directory’.
File: ebib.info, Node: Preloading bib Files, Next: Starting a New bib File, Prev: Opening a bib File, Up: Getting Started
2.2 Preloading ‘.bib’ Files
===========================
Chances are that you will be doing most of your work with one or a few
‘.bib’ files. In order to open these files automatically when Ebib is
started, set the option "Preload Bib Files" (‘ebib-preload-bib-files’).
You may specify the files to preload with their full path or with a
relative path. In the latter case, the files are searched for in the
directories listed in the option ‘ebib-bib-search-dirs’.
It is also possible to set this variable as a file-local or
directory-local variable (i.e., in a ~.dir-locals.el‘file). You can use
this method to only load the’.bib' file or files associated with a
specific project.
File: ebib.info, Node: Starting a New bib File, Next: Closing a database, Prev: Preloading bib Files, Up: Getting Started
2.3 Starting a New ‘.bib’ File
==============================
To start a new ‘.bib’ file from scratch, you first need to give the
database a name. So, to start a new database, type ‘o’ first, and give
the new file a name. Once you have done this, you can start adding
entries to the database.
File: ebib.info, Node: Closing a database, Next: The Database View, Prev: Starting a New bib File, Up: Getting Started
2.4 Closing a database
======================
If you are done with a database, type ‘c’ to close it. This unloads the
current database (you are asked for confirmation if you have unsaved
changes), but it does not leave Ebib, and the other databases you have
open will remain so.
File: ebib.info, Node: The Database View, Next: Navigating the Database, Prev: Closing a database, Up: Getting Started
2.5 The Database View
=====================
Once you've opened a ‘.bib’ file, all the entries in the file are shown
in alphabetical order (sorted by entry key, though this is customisable)
in the index buffer in the top Ebib window. The fields of the first
entry and their values are shown in the entry buffer in the bottom Ebib
window. The first field is the type field (i.e. ‘Book’, ‘Article’,
etc.)
Below the type field, Ebib displays (up to) four sets of fields. The
first set are the so-called required fields, the fields that ‘biblatex’
/ BibTeX requires to be filled. The second group are the optional
fields, which do not have to be filled but which are normally added to
the bibliography if they do have a value. These two groups are specific
to the entry type; they are defined in Emacs and can be customised in
the customisation group ‘bibtex’.
The third group comprises the so-called extra fields. These fields are
usually ignored by ‘biblatex’ / BibTeX (note that ‘biblatex’ and BibTeX
normally ignore _all_ fields they do not know about), although there are
bibliography styles that treat some of these fields as optional rather
than as extra. Extra fields are not specific to the entry type. They
are defined globally. By default, Ebib defines the following extra
fields:
• ‘abstract’
• ‘annote’ (‘annotation’ in ‘biblatex’)
• ‘crossref’
• ‘doi’ (BibTeX only)
• ‘file’
• ‘keywords’
• ‘timestamp’
• ‘url’ (BibTeX only)
The fields ‘url’ and ‘doi’ are defined only for BibTeX because
‘biblatex’ defines them as optional fields for most entry types. If
these fields are not sufficient for your use, you can customise the
option ‘ebib-extra-fields’.
Below the extra fields is one more set of fields. These are fields that
exist in the entry but are not defined as part of the entry type nor as
extra fields. See the section *note Undefined Fields:
#undefined-fields. for some more information.
File: ebib.info, Node: Navigating the Database, Next: Displaying and Sorting the Entries List, Prev: The Database View, Up: Getting Started
2.6 Navigating the Database
===========================
The basic motion keys in the index buffer are the following:
Key Action
---------------------------------------------
‘up’ ‘p’ ‘C-p’ move one entry up
‘down’ ‘n’ ‘C-n’ move one entry down
‘Space’ ‘PgDn’ move one page up
‘b’ ‘PgUp’ move one page down
‘g’ ‘Home’ move to the first entry
‘G’ ‘End’ move to the last entry
If you have more than one database opened, you can use the keys ‘1’-‘9’
to jump between databases. The number of each database is shown in the
mode line of the index buffer before the database name. (Note that the
numbering is dynamic: if you have three databases opened and then close
the second, database 3 becomes database 2.) You can also use the ‘left’
and ‘right’ cursor keys to move to the previous or next database (these
keys wrap).
You can quickly jump to any entry in a database with the key ‘j’. This
asks you for an entry key (using completion) and then jumps to the
corresponding entry. This actually works across databases: the keys
that are offered for completion are the keys from all open databases.
After selecting a key, Ebib changes to the corresponding database and
shows the entry corresponding to the key. Note, though, that you can
restrict the jump candidates to the current database by using a prefix
argument, i.e., by typing ‘C-u j’.
If you use selectrum (https://github.com/raxod502/selectrum), ivy
(https://github.com/abo-abo/swiper) or helm
(https://github.com/emacs-helm/helm) or the built-in package ido, using
‘j’ becomes even more convenient: instead of completing the entry key,
you can type any part of the author/editor names, of the title and the
year of the entry you want to jump to. You can also see the
bibliography file to which the entry belongs. This is a good way to
search for a particular entry if you're not sure of the entry key.
Ebib keeps a history of the entries that you've visited. You can move
through this history with ‘C-b’ and ‘C-f’. Furthermore, using the Emacs
command ‘point-to-register’, you can store an entry in a register and
jump back to it at a later point with ‘jump-to-register’.
File: ebib.info, Node: Displaying and Sorting the Entries List, Next: Biblatex vs BibTeX, Prev: Navigating the Database, Up: Getting Started
2.7 Displaying and Sorting the Entries List
===========================================
By default, the index buffer displays the list of entries in the
database in a table format using the entry key, and the author, year and
title fields of each entry. The entries are sorted in ascending order
on the first column, which by default is the entry key. You can sort
the entries on one of the other columns using the keys ‘<’ and ‘>’. The
former performs an ascending sort (smallest to largest, hence the
smaller-than sign), the latter a descending sort. They both ask you for
the column to sort on. Restoring the default sort can be done with ‘=’.
The fields that are displayed in the index buffer can be customised with
the user option ‘ebib-index-columns’. Each element in this option
describes a column and consists of the field to display (which is also
the column label), the width of the column and a flag indicating whether
the column can be sorted. You can add or remove fields, or reorder the
existing ones. Note that the width of the last column is ignored: the
last column always takes up all the space that is left.
You can use any ‘biblatex’ or BibTeX field to define a column in the
index buffer. There are a few column labels that do not correspond
directly to a field name, however. For example, the column label
‘"Entry Key"’, which displays the entry key, is not a field. Similarly,
there is a column label ‘"Author/Editor"’, which displays the contents
of the author field if it is not empty, and the contents of the editor
field otherwise. Furthermore, the column label ‘"Year"’ does not simply
display the contents of the year field. Rather, it first checks the
contents of the date field, which is ‘biblatex’'s replacement of the
year field, and extracts the first year in it. Only if the date field
is empty does it display the year field.
Three other column labels have special behaviour: ‘"Title"’, ‘"Doi"’,
and ‘"Url"’. These do display information from the fields they
correspond with, but in a special way: ‘"Title"’ tries to make the title
look nice by removing braces and LaTeX commands (leaving only their
obligatory arguments) and by displaying the arguments of ‘\emph’,
‘\textit’, ‘\textbf’ and ‘\textsc’ in italic, bold or caps. Accented
characters that are created using LaTeX commands such as ‘\"{a}’ are
displayed as the actual accented characters and a number of LaTeX
commands for special characters are replaced with the corresponding
Unicode character.
The column labels ‘"Doi"’ and ‘"Url"’ don't display the contents of
these fields, but instead yield a clickable string ‘"www"’; clicking on
‘"www"’ takes you to the relevant web page.
The final predefined column label is ‘"Note"’. This does not, as might
be expected, display the contents of the note field. Rather, it checks
whether the entry in question has an external annotation (see *note
Notes Files: #notes-files.). For those entries that have an annotation,
the ‘"Note"’ column displays a (clickable) ‘"N"’. (Keep in mind,
though, that if you keep your notes in a single file, adding this column
to the index display can slow down the creation of the index buffer (and
thus Ebib's start-up). If you wish to use this column, it is probably
best to keep notes in separate files.)
You can define new column labels and redefine the existing ones by
customising the option ‘ebib-field-transformation-functions’. Note that
‘"Title"’, ‘"Doi"’, ‘"Url"’, and ‘"Note"’ are actually defined through
this option. ‘"Entry Key"’, ‘"Author/Editor"’, and ‘"Year"’ are not
(they are hard-coded), but they can be overridden by adding an entry for
them in ‘ebib-field-transformation-functions’. For example, if you do
not wish for TeX markup to be hidden in titles, remove the ‘"Title"’
entry in this option.
The first column defined in ‘ebib-index-colums’ is the column on which
the entries are sorted by default, i.e., when the database is first
opened and when you press ‘=’. You can change the default sort field
and the default sort direction (which is ascending, i.e., A-Z and 0-9)
by customising the option ‘ebib-index-default-sort’.
By default, sorting is done on the string representation of the field
value, using the function ‘string-collate-lessp’. For numeric fields,
this may not be appropriate, because it means that the value ‘10’ is
sorted between ‘1’ and ‘2’. To specify a custom sort function for
particular fields, you can customise the option
‘ebib-field-sort-functions-alist’. To sort numeric fields, you can use
the predefined function ‘ebib-compare-numerical-strings’, but you can
also define a custom sort function yourself.
File: ebib.info, Node: Biblatex vs BibTeX, Prev: Displaying and Sorting the Entries List, Up: Getting Started
2.8 Biblatex vs. BibTeX
=======================
BibTeX has long been a core part of the TeX ecosystem, but it has not
received any substantial update since 1988(!) and it has next to no
support for languages other than English. Compared to BibTeX,
‘biblatex’ has an expanded set of entry types, allowing for more diverse
types of references, a larger number of fields, and a much more
sophisticated system of field value inheritances. Most importantly,
however, ‘biblatex’ (and its back-end ‘Biber’) has proper Unicode
support.
For these reasons, the use of ‘biblatex’ is highly recommended for
anyone using LaTeX. For historical reasons, however, BibTeX is still the
default dialect, so if you intend to use ‘biblatex’ files, you need to
tell Ebib that your files are ‘biblatex’ files.
* Menu:
* Setting the BibTeX Dialect::
* Alias Types and Fields::
File: ebib.info, Node: Setting the BibTeX Dialect, Next: Alias Types and Fields, Up: Biblatex vs BibTeX
2.8.1 Setting the BibTeX Dialect
--------------------------------
‘Biblatex’ files use the same ‘.bib’ suffix that BibTeX files use.
Whether Ebib interprets a file as a BibTeX or a ‘biblatex’ file is
determined by the user option ‘ebib-bibtex-dialect’. Possible values
for this option are ‘BibTeX’ and ‘biblatex’, the default being ‘BibTeX’.
(These values are taken from the variable ‘bibtex-dialect-list’.)
The dialect specified determines which entry types Ebib recognises and
which fields it expects. Reading a file with the wrong dialect setting
will most likely result in a series of "Illegal entry type" errors.
Note, however, that these entries will still be loaded and displayed,
but they will be highlighted with Emacs' ‘error’ face. Fields that are
not defined for the current dialect are displayed as undefined fields
(i.e., below all other fields in the entry buffer).
The option ‘ebib-bibtex-dialect’ sets the default dialect, which is the
dialect that Ebib gives to newly created ‘.bib’ files and which it
assumes for files that are not otherwise specified. If you wish to work
with a file that is in a different dialect than what you set as the
default, you can set the dialect for this particular file. To do this,
load the file and then set the dialect through the menu option «Ebib |
BibTeX Dialect» or with the command ‘M-x ebib-set-dialect’. You only
need to do this once for a file, because the setting is saved in the
‘.bib’ file in the local variable block. (If no local variable block
exists, one is created.) The setting is actually saved as a file-local
value for the variable ‘bibtex-dialect’, which means that if you should
open the file directly in ‘bibtex-mode’, Emacs will apply the dialect
setting as well.
The mode line of the index buffer shows the dialect that Ebib assumes
for the current database. Note that this does not necessarily mean that
the dialect is set in the ‘.bib’ file: if the file does not have a
dialect setting, the mode line shows the default setting.
File: ebib.info, Node: Alias Types and Fields, Prev: Setting the BibTeX Dialect, Up: Biblatex vs BibTeX
2.8.2 Alias Types and Fields
----------------------------
The set of entry types defined by ‘biblatex’ differs from the set used
by BibTeX. Mostly, ‘biblatex’ adds new entry types, but there are a few
BibTeX entry types that have been dropped. For legacy reasons,
‘biblatex’ still recognises these entry types, but it treats them as
aliases for some of its own types:
BibTeX Entry Biblatex entry type
type
-----------------------------------------------------------------
‘@Conference’ ‘@InProceedings’
‘@Electronic’ ‘@Online’
‘@MastersThesis’ ‘@Thesis’ with ‘type’ as 'Master's thesis'
‘@PhDThesis’ ‘@Thesis’ with ‘type’ as 'PhD thesis'
‘@TechReport’ ‘@Report’ with ‘type’ as 'technical report'
‘@www’ ‘@Online’
If an entry has such an alias as entry type, Ebib displays the entry
type that ‘biblatex’ treats it as in the entry buffer. For example, the
entry type alias ‘PhDThesis’ is shown as ‘PhDThesis [==> Thesis]’.
Similarly, a number of fields are deprecated but still accepted as
aliases:
BibTeX Field Biblatex Field
-----------------------------------
‘address’ ‘location’
‘annote’ ‘annotation’
‘archiveprefix’ ‘eprinttype’
‘journal’ ‘journaltitle’
‘key’ ‘sortkey’
‘pdf’ ‘file’
‘primaryclass’ ‘eprintclass’
‘school’ ‘institution’
These aliases are also indicated in the entry buffer: for example, if an
entry has a ‘journal’ field, its value is shown as the value of the
‘journaltitle’ field; a tag ‘[<== journal]’ is placed after the field
value, indicating that the value is actually contained in the journal
field. The ‘journal’ field itself is shown as an undefined field, i.e.,
after all other fields. Displaying the value twice this way means that
you can easily copy the value of the ‘journal’ field to the
‘journaltitle’ field, if you wish to bring your entries into line with
‘biblatex’'s conventions.
File: ebib.info, Node: Editing the Database, Next: Main and Dependent Databases, Prev: Getting Started, Up: Top
3 Editing the Database
**********************
Obviously, Ebib not only allows you to see the BibTeX entries in your
‘.bib’ files, you can also edit them. This section describes the most
important editing facilities.
* Menu:
* Adding and Deleting Entries::
* Marking Entries::
* Editing Field Values::
* @String abbreviations in field values::
* Editing Multiline Values::
* Copy Cut Kill Paste Yank and Delete::
* Undefined Fields::
* Hiding Fields from Display::
* Timestamps::
* Saving a Database::
* Cross-referencing::
* Sorting the bib File::
* @Preamble Definition::
* @String Definitions::
* @Comments::
* Creating Entry Stubs::
* Multiline Edit Buffers::
File: ebib.info, Node: Adding and Deleting Entries, Next: Marking Entries, Up: Editing the Database
3.1 Adding and Deleting Entries
===============================
To add an entry to a database, type ‘a’. This creates a new entry with
a temporary key and puts you in the entry buffer, where you can edit the
fields of the entry. When you finish editing the entry fields, the
temporary key is replaced with an automatically created key based on the
entry's content. (Ebib uses the function ‘bibtex-generate-autokey’ for
this; see that function's documentation string for customisation
options.) If you prefer to specify a key yourself, you can unset the
option ‘ebib-autogenerate-keys’.
Deleting an entry can be done in two ways. The key ‘d’ deletes an entry
from the database. This command asks for confirmation, because once an
entry has been deleted in this way, it cannot be retrieved again.
Alternatively, you can use ‘k’, which kills the current entry, i.e., the
entry is deleted from the database and added to the kill ring.
The key ‘y’ lets you yank an entry from the kill ring into the current
database. In order for this to work, the item at the top of the kill
ring must be a string that constitutes a properly formatted BibTeX
entry. If this is not the case, Ebib gives you a warning and rotates
the kill ring, so that you can press ‘y’ again to (try and) add the next
element in the kill ring to the database.
Killing an entry from a database obviously yields a properly formatted
BibTeX entry (so you can easily move entries from one database to
another by killing and then yanking them), but killing a BibTeX entry
from another buffer or copying one from an outside source (e.g., a
website) is also possible.
Note that yanking also works with ‘@Preamble’, ‘@String’ and ‘@Comment’
definitions.
File: ebib.info, Node: Marking Entries, Next: Editing Field Values, Prev: Adding and Deleting Entries, Up: Editing the Database
3.2 Marking Entries
===================
Commands in the index buffer generally operate on one single entry.
Some commands can be performed on multiple entries simultaneously. To
do this, first mark the relevant entries with the key ‘m’ and then
perform the command. Commands for which it makes sense automatically
operate on all marked entries if there are any.
With a prefix argument, i.e, with ‘C-u’ followed by ‘m’, you can unmark
all entries or, if there are no marked entries, mark all entries in the
current database.
File: ebib.info, Node: Editing Field Values, Next: @String abbreviations in field values, Prev: Marking Entries, Up: Editing the Database
3.3 Editing Field Values
========================
Editing the field values for an entry is done in the lower of the two
Ebib buffers, the entry buffer. You can move focus to the entry buffer
by typing the command ‘e’ in the index buffer.
You can move between fields with the same keys that you use to move
between entries in the index buffer:
Key Action
---------------------------------------------
‘up’ ‘p’ ‘C-p’ move one field up
‘down’ ‘n’ ‘C-n’ move one field down
‘Space’ ‘PgDn’ move to previous set
‘b’ ‘PgUp’ move to next set
‘g’ ‘Home’ move to the first field
‘G’ ‘End’ move to the last field
To finish editing fields and move focus back to the index window, use
‘q’.
Editing a field value can be done with ‘e’ or ‘RET’. For most fields,
Ebib simply asks you for a string value in the minibuffer. There is no
need to put braces ‘{}’ around field values, Ebib adds them when it
saves the ‘.bib’ file.
Fields for which it makes sense offer completion when you edit them.
For example, when you edit the ‘type’ field, completion is offered on
all predefined entry types. Similarly, if you edit the ‘crossref’
field, Ebib offers completion on the keys in the databases currently
open. The ‘keywords’ field offers completion on all configured keywords
(see the section *note Managing Keywords: #managing-keywords.) and the
‘file’ field offers file name completion (see *note Viewing and
Importing Files: #viewing-and-importing-files.).
For other fields that offer completion, the completion candidates are
the values of these fields in other entries in the databases that you've
opened. Offering these as completion candidates makes it easier to
ensure that you enter these values consistently. This of course mainly
makes sense for fields that have values that will occur more than once.
By default, apart from the fields already mentioned, completion is
offered for the ‘author’, ‘editor’, ‘journal’, ‘journaltitle’,
‘organization’ and ‘publisher’ fields.
In the ‘author’ and ‘editor’ fields, completion takes into account that
these fields may contain more than one name. Each name is a separate
completion candidate: when editing these fields, you can type the
individual names, Ebib adds the ‘"and"’ or the semicolon that separates
them.
If you want to edit a field value directly, without completion, you can
use a prefix argument: ‘C-u e’ lets you edit a field as a plain string.
If you wish to disable completion permanently for particular fields, or
if you want to enable completion for other fields, you can customise the
user option ‘ebib-edit-fields-functions’.
With fields that can contain lists of values, such as the ‘author’ and
‘editor’ fields, but also the ‘file’ field, Ebib offers multiple
completion: you can select one candidate with ‘TAB’ and then go on to
select the next one. When you've selected all candidates you want, hit
‘RET’. Ebib uses Emacs' standard ‘completing-read-multiple’ function
for this, but note that ‘crm-separator’ is set to something appropriate
for the field being edited.
File: ebib.info, Node: @String abbreviations in field values, Next: Editing Multiline Values, Prev: Editing Field Values, Up: Editing the Database
3.4 ‘@String’ abbreviations in field values
===========================================
BibTeX and ‘biblatex’ provide so-called ‘@String’ abbreviations, short
abbreviations for strings of text that occur often in your database,
e.g., publisher names, names of journals, etc.
You can define such abbreviations in Ebib in the _strings buffer_ (see
*note ‘@String’ Definitions: #string-definitions. for details). To use
a ‘@String’ abbreviation in a field value, the field's value must be
marked as _special_. Normally, when Ebib saves the database, it puts
braces around field values. If a field has a ‘@string’ abbreviation in
it, it shouldn't be surrounded with braces, because that would prevent
‘biblatex’ or BibTeX from expanding the abbreviation.
A special field is a field whose value is not surrounded by braces when
the database is saved, so that it is recognised as a field with an
abbreviation. To mark a field special, press ‘r’. An asterisk will
appear before the field, indicating its status. Pressing ‘r’ again will
change the field back to normal. If you press ‘r’ on a field that does
not have a value yet, Ebib will ask you for one.
By default, Ebib shows the _expanded_ value of a field that is marked
special. So for example, if you have a ‘@String’ abbreviation ‘cup’ for
‘"Cambridge University Press"’, putting ‘cup’ in the ‘publisher’ field
and marking it special will show the expanded value ‘Cambridge
University Press’ in the entry buffer. The field is still marked with
an asterisk and the expanded value is displayed in a different colour to
indicate that it is an expansion. You can turn this behaviour off by
unsetting the user option ‘ebib-expand-strings’.
Note that a field value can actually be composed of a concatenation of
"normal" text and abbreviations. The BibTeX documentation for example
explains that if you have defined:
@String{WGA = "World Gnus Almanac"}
you can create a BibTeX field like this:
title = 1966 # WGA
which will produce "1966 World Gnus Almanac". Or you can do:
month = "1~" # jan
which will produce someting like "1 January" (assuming your bibliography
style has defined the abbreviation ‘jan’). All this is possible with
Ebib, simply by entering the exact text including quotes or braces
around the strings, and marking the relevant field as special.
An easy way to enter a ‘@String’ abbreviation as a field value is to use
the key ‘s’ instead of ‘e’. If you type ‘s’, Ebib asks you for a
‘@String’ abbreviation to put in the current field, and automatically
marks the field as special. This method uses completion.
File: ebib.info, Node: Editing Multiline Values, Next: Copy Cut Kill Paste Yank and Delete, Prev: @String abbreviations in field values, Up: Editing the Database
3.5 Editing Multiline Values
============================
There are two other fields that Ebib handles in a special way when you
edit their value. These are the ‘annotation’ field (or ‘annote’ in
BibTeX), and the ‘abstract’ field. Most field values normally consist
of a single line of text. However, because the ‘annotation’ and
‘abstract’ fields are meant for creating annotated bibliographies, it
would not be very useful if you could only write one line of text in
them. Therefore, when you edit one of these fields, Ebib puts you in a
so-called _multiline edit buffer_. This is essentially a text mode
buffer that allows you to enter text freely.
To store the text and leave the multiline edit buffer, type ‘C-c C-c’.
If you want to leave the multiline edit buffer and discard your changes,
type ‘C-c C-k’. This command cancels the edit and leaves the multiline
edit buffer. The text that is stored in the field you were editing is
not altered.
For more details on working with multiline edit buffers, see *note
Multiline Edit Buffers: #multiline-edit-buffers.
When a field has a multiline value, at most ten lines are shown in the
entry buffer. If the text is longer, an ellipsis indicator ‘[...]’ is
added after the last line that is displayed. If you want to see the
whole contents of a multiline field, you can use ‘v’: this will display
the contents of the current field in a ‘*Help*’ buffer (which can be
dismissed again with ‘q’). It is possible to customise the way a
multiline value is displayed in the entry buffer. See the options
‘ebib-multiline-display-function’ and ‘ebib-multiline-display-max-lines’
for details.
Note that multiline values are not restricted to the ‘annotation’ and
‘abstract’ fields. Any field except the ‘type’ and ‘crossref’ fields
can in fact hold a multiline value. To give a field a multiline value,
use ‘m’ instead of ‘e’.
File: ebib.info, Node: Copy Cut Kill Paste Yank and Delete, Next: Undefined Fields, Prev: Editing Multiline Values, Up: Editing the Database
3.6 Copy, Cut (Kill), Paste (Yank), and Delete
==============================================
A few more commands are available when you're in the entry buffer
editing field values. The commands ‘c’, ‘k’ and ‘y’ implement copy,
kill and yank: ‘c’ copies the contents of the current field to the kill
ring, ‘k’ kills the contents of the current field to the kill ring, and
‘y’ yanks (pastes) the most recently killed text in the kill ring. You
can type ‘y’ repeatedly to get the same effect you get in Emacs when you
type ‘M-y’ after an initial ‘C-y’.
The contents of a field can also be deleted with the command ‘d’. This
command does not store the text in the kill ring: once deleted, the text
is gone. It therefore asks for confirmation, just to be sure.
Note that ‘y’ only works when the current field does not have a value
yet. This is to prevent you from accidentally overwriting a field
value. If you do want to yank text into a field that already has a
value, simply hit ‘d’ first to delete the text.
File: ebib.info, Node: Undefined Fields, Next: Hiding Fields from Display, Prev: Copy Cut Kill Paste Yank and Delete, Up: Editing the Database
3.7 Undefined Fields
====================
‘Biblatex’ and BibTeX ignore fields that they do not know about, which
is a property that can be exploited to add any kind of information to an
entry. Ebib accommodates this by allowing fields with any name, not
just the ones that are predefined. Such undefined fields are displayed
last in the entry buffer, following the extra fields.
It is even possible to add such fields to an entry by pressing ‘a’ in
the entry buffer. This asks for a field name and then a value. If you
make heavy use of this option, though, it may be better to define the
relevant fields through the user option ‘ebib-extra-fields’.
Note that if you delete the contents of an undefined field, the field
itself is also deleted. (In fact, the field remains in the database
until you close the database, but it will not be saved, so the next time
you load the ‘.bib’ file, the field is gone.)
File: ebib.info, Node: Hiding Fields from Display, Next: Timestamps, Prev: Undefined Fields, Up: Editing the Database
3.8 Hiding Fields from Display
==============================
‘Biblatex’ defines a large number of fields, many of which are optional
for most entry types. Displaying all these fields in the entry buffer
would not be very practical, because you are most likely interested in
only a few of them. For this reason, Ebib defines a (fairly large)
number of fields as 'hidden', meaning that they are not shown in the
entry buffer unless they have a value (i.e., if they are present in the
BibTeX entry).
If you want to insert a value into a field that is hidden by default,
you need to make the hidden fields visible first, which can be done with
the key ‘H’ (in the index buffer). Alternatively, you can use ‘a’ in
the entry buffer to add a field, provided you know its exact name.
(Keep in mind that you can use ‘a’ to add fields that are not
predefined, so Ebib won't complain if you mistype the field name.
Completion is available, though.)
Which fields are treated as hidden is controlled by the option "Hidden
Fields" (‘ebib-hidden-fields’), which can be customised. The default
value of this option contains a fairly long list of fields, most of
which are ‘biblatex’-specific, though the option can of course be used
for BibTeX files as well.
If you prefer Ebib to show _only_ the fields that have a value, (e.g.,
when you use Ebib mainly for viewing, not for editing, BibTeX entries),
you can set ‘ebib-hidden-fields’ to the value ‘t’: This essentially
makes all fields hidden, which means that all fields without a value are
suppressed and only fields with a value are shown.
File: ebib.info, Node: Timestamps, Next: Saving a Database, Prev: Hiding Fields from Display, Up: Editing the Database
3.9 Timestamps
==============
Ebib provides the possibility to add a timestamp to every new entry,
recording the time it was added to the database. The timestamp is
recorded in the (extra) field ‘timestamp’, which is hidden by default.
You can tell Ebib to create timestamps by setting the option
‘ebib-use-timestamp’. With this option set, a timestamp is included in
entries added to the database with ‘a’. Ebib also adds a timestamp to
entries imported from a buffer or merged from a file, and to entries
exported to another database or to a file. When importing or exporting
entries, existing timestamps are overwritten. The logic behind this is
that the timestamp records the date and time when the entry was added to
the database, not when it was first created.
Note that if this option is unset, the timestamp of an entry is retained
when it is imported or exported. Therefore, if you record timestamps
and want to im-/export entries without changing their timestamps,
temporarily unset this option, which can be done in the menu under
"Options".
Ebib uses the function ‘format-time-string’ to create the timestamp.
The format string that Ebib uses can be customised. The default string
is ‘"%Y-%m-%d %T (%Z)"’, which produces a timestamp of the form
‘"2007-03-12 01:03:26 (CET)"’. This string is sortable and has the
additional advantage that it can be converted to Emacs' internal time
representation with the function ‘date-to-time’. The format can be
customised; see the documentation for ‘format-time-string’ on the
options that are available.
Adding timestamps in a format that ‘date-to-time’ can parse makes it
possible to list the most recent additions to the database. Ebib
provides a function to do this: ‘ebib-list-recent’, which asks for a
number of days and lists the entries that were added since then. See
*note Special Filters: #special-filters. for details.
File: ebib.info, Node: Saving a Database, Next: Cross-referencing, Prev: Timestamps, Up: Editing the Database
3.10 Saving a Database
======================
When you have undertaken any kind of editing action on a database, it is
marked as modified, which is indicated in the mode line for the index
buffer. A modified database can be saved by typing ‘s’. This saves the
database to the file it was loaded from without asking for confirmation.
(It is similar to ‘C-x C-s’ in Emacs.) If you are saving a file for the
first time after loading it, Ebib creates a backup file. (Ebib honours
‘backup-directory-alist’ when saving backups. Note that you can also
disable backups altogether with the option ‘ebib-create-backups’.)
If you want to force-save a database that has not been modified, you can
use a prefix argument: ‘C-u s’. Ebib still checks whether the
underlying file was modified, though. If you also want to forego this
check, use a double prefix argument: ‘C-u C-u s’. This saves the file
unconditionally.
You can also save a database to another name with ‘w’. This command is
similar to ‘C-x C-w’ in Emacs: the new ‘.bib’ file becomes associated
with the database. This command can also be prefixed with ‘C-u’ in
order to overwrite any existing file without asking for confirmation.
Note that by default, Ebib uses a single TAB to indent fields inside
BibTeX entries. If you prefer to use spaces, set the option
‘ebib-save-indent-as-bibtex’. When this option is set, Ebib uses the
value of the variables ‘bibtex-entry-offset’ and
‘bibtex-field-indentation’ to compute how many spaces to use to indent
fields.
* Menu:
* Exporting Entries::
File: ebib.info, Node: Exporting Entries, Up: Saving a Database
3.10.1 Exporting Entries
------------------------
Sometimes it can be useful to copy entries from one database to another,
or to create a new ‘.bib’ file with several entries from an existing
database. For this purpose, Ebib provides exporting facilities. To
export an entry to another database that you have open in Ebib, use the
command ‘x’. This command operates on a single entry or on all marked
entries.
You can also export entries to a file. To do this, call the command ‘x’
with a prefix argument: ‘C-u x’ and type the name of the file to export
the entries to. If the file already exists, Ebib appends the entries to
it. Note that in this case, there is no check to see if the exported
entries already exist in the target file, so you may end up with
duplicate entries in this way.
Apart from entries, it is also possible to export the ‘@Preamble’ and
‘@String’ definitions. The ‘@Preamble’ definition is exported with the
command ‘X’ in the index buffer. ‘@String’ definitions can be exported
in the strings buffer: ‘x’ in this buffer exports the current string,
while ‘X’ exports all ‘@String’ definitions in one go. All these
commands function in the same way: when used without a prefix argument,
they ask for an open database to export the entry to. With a prefix
argument, they ask for a filename, and then append the relevant data to
that file.
File: ebib.info, Node: Cross-referencing, Next: Sorting the bib File, Prev: Saving a Database, Up: Editing the Database
3.11 Cross-referencing
======================
Both ‘Biblatex’ and BibTeX allow entries to refer to other entries
through the ‘crossref’ field. If an entry has a ‘crossref’ field, Ebib
displays the field values that nte entry inherits from its parent entry.
To indicate that they are just inherited values, they are marked with
‘ebib-crossref-face’, which by default inherits from
‘font-lock-comment-face’. These values are merely displayed for
convenience: they cannot be edited. (They can be copied, however).
‘Biblatex’'s inheritance rules are fairly sophisticated: they depend on
the fields and on the types of the child _and_ parent entry. Ebib fully
supports this inheritance schema. Since inheritance rules can be
customised in ‘biblatex’, they are defined in Ebib in the customisable
option ‘ebib-biblatex-inheritances’. This is set up with the default
inheritance relations defined by ‘biblatex’, but can be customised if
needed.
BibTeX's inheritance mechanism is much more simplistic. A field in a
child entry that does not have a value simply inherits the value of the
same-name field in the parent entry. Customisation is not possible
here, neither in BibTeX nor in Ebib.
If you are viewing an entry that has a ‘crossref’ field and you want to
go to the parent entry you can type ‘C’. This command reads the value
of the ‘crossref’ field and then jumps to the entry it contains. If you
want to do the reverse, i.e., see if the current entry is the parent of
any other entries, you can use the same key ‘C’: if you type ‘C’ on an
entry that does not have a ‘crossref’ field, Ebib starts searching the
database for the current entry key.
Note that after Ebib has jumped to the first child entry, you cannot
type ‘C’ again to find the next one. Since you are now on a child
entry, this key would take you back to the parent entry. In order to
find the next child entry, you have to type ‘RET’, as with a normal
search. (Also, if the cross-referenced entry appears alphabetically
before the cross-referencing entry, you need to type ‘g’ and then ‘/’.)
Note that if you want to use ‘biblatex’'s or BibTeX's cross-referencing
mechanism, the option ‘ebib-save-xrefs-first’ needs to be set (which it
is by default). This tells Ebib to save all entries with a ‘crossref’
field first in the ‘.bib’ file. Without this, cross-referencing will
not work reliably.