-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdatabase.tex
1057 lines (943 loc) · 50.1 KB
/
database.tex
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
%\chapter{The Database File}
\chapter{数据库文件}
\label{ch:database}
This chapter is intended as a basic introduction to database files.
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 本章介绍数据库文件。仅讨论常用的文献条目类型。给出一些bib文件示例及其产生的效果。要记住文献输出的格式取决于所选择的参考文献样式。而不同的样式会有不同的差异。后续章节主要介绍这种输出的格式,本章主要介绍文献信息的输入。
\end{CJK}}
It deals only with commonly used types of source, leaving the more
obscure corners to the manual. It starts from the ground up, for those
who have no \bibtex\ or \biblatex\ experience. Those who are familiar
with \bibtex\ already can probably skim the first part, but should
read the later parts fairly carefully because \biblatex\, with
\package{Biber} is slightly different and considerably more powerful
than \bibtex.
The chapter gives examples of some |.bib| files and output they will
produce. Do bear in mind that the precise form of the output is
\emph{dependent on the style chosen}: the examples are intended to
help illustrate the general principles, but different styles may
select from and format the data in different ways. The rest of the
book is all about how to control such output. This chapter is about
the input, and the examples are only there to give colour.
%\section{From ground up}
\section{从零开始}
\index{.bib file@\texttt{.bib} file|see{database}}%
\index{database!general description}
The \package{Biber} program, which prepares data for use by \biblatex,
can read a number of different formats; but only one is (at the
moment) really fully supported, and that is the format you should
use.
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize biber支持多种输入,但只有一种格式是完全支持的。就是为 \bibtex 开发的bibtex格式。它简单,易写,可以很容易用专门软件生成。bibtex格式文件通常有后缀名.bib,它是可以包含任意unicode字符的文本文件。
\end{CJK}}
It is a format originally developed for \bibtex. It is simple. It
can be written by hand, or produced with the assistance of specialised
software.
The \bibtex\ format database file conventionally has the suffix
\verb|.bib|. It is a `plain text' file which (with \package{Biber})
can use any unicode characters.
It consists of a number of `entries', each of which relates to a
particular bibliographical source.
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 它由一定数量的“条目”构成,每一条目对应一篇文献源。每个条目都有自己的条目类型,比如 book(专著), article (期刊析出的文章)等,每个条目都有一定的域构成,这些域保存有参考文献的各项详细信息。一个条目的结构如图\ref{basic:source:eg}所示。
\end{CJK}}
Each entry consists of an
\emph{entrytype specifier} which explains what sort of source it is:
like book, or article; a \emph{key} which uniquely identifies the
source and which you will use for citations; and a set of
\emph{fields} which contain bibliographical data about the work. The
basic structure of such a record is shown in figure
\ref{basic:source:eg}.
\begin{figure*}
\strut\vspace{2ex}
\begin{minipage}[t]{1.5in}
\sffamily
\noindent
\tikz{\node(typekey){type};}
\vspace{10ex}
\noindent
\tikz{\node(fieldkey){fields};}
\end{minipage}
\begin{minipage}[t]{3in}
\ttfamily
\tikz{
\node(entrytype)
[text height=10pt, text depth=2pt, fill=red!30]{@book};
\node(brace)[text height=10pt, text depth=2pt, xshift=5ex]{\{};
\node(entrykey)
[text height=10pt, text depth=2pt, fill=green!30,xshift=13ex]{nussbaum95};
\node(keycomma)
[circle, draw, xshift=23ex, yshift=-5pt, line width=1pt]{,};}
\quad\tikz{\node(authornode)[text height=10pt, text depth=2pt, fill=blue!25]{author = \{Nussbaum, Martha C.\}} ;
\node(authorcomma)[circle, draw, xshift=22ex, yshift=-5pt, line width=1pt]{,} ;}\\
\quad\tikz{\node(titlenode)[text height=10pt, text depth=2pt, fill=blue!25]{title = \{Poetic Justice\}} ;
\node(titlecomma)[circle, draw, xshift=18ex, yshift=-5pt, line width=1pt]{,} ;}\\
\quad\tikz{\node(publishernode)[text height=10pt, text depth=2pt, fill=blue!25]{publisher = \{Beacon Press\}} ;
\node(publishercomma)[circle, draw, xshift=20ex, yshift=-5pt, line width=1pt]{,} ;}\\
\quad\tikz{\node(locationnode)[text height=10pt, text depth=2pt, fill=blue!25]{location = \{Boston\}} ;
\node(locationcomma)[circle, draw, xshift=15ex, yshift=-5pt, line width=1pt]{,} ;}\\
\quad\tikz{\node(datenode)[text height=10pt, text depth=2pt, fill=blue!25]{date = \{1995\}} ;
\node(datecomma)[circle, draw, xshift=11.5ex, yshift=-5pt, line width=1pt]{,} ;}\\
\tikz{\node(finalbrace)[text height=10pt, text depth=2pt]{\}};}
\end{minipage}
\begin{minipage}[t]{1in}
\raggedright
\sffamily
\noindent
\tikz{\node(keykey){key};}
\vspace{10ex}
\noindent
fields separated by commas
\end{minipage}
\begin{tikzpicture}[overlay]
\path[-stealth] (typekey.south) edge [out=-90, in=180] (entrytype.west) ;
\path[-stealth] (fieldkey.east) edge [out=0, in=180] (authornode.west) ;
\path[-stealth] (fieldkey.east) edge [out=0, in=180] (titlenode.west) ;
\path[-stealth] (fieldkey.east) edge [out=0, in=180] (publishernode.west) ;
\path[-stealth] (fieldkey.east) edge [out=0, in=180] (locationnode.west);
\path[-stealth] (fieldkey.east) edge [out=0, in=180] (datenode.west) ;
\path[-stealth] (keykey.west) edge [out=180, in=45] (entrykey.north east) ;
\end{tikzpicture}
\caption{A basic source record\label{basic:source:eg}}
\end{figure*}
\index{database!entry type}
The \emph{entrytype} specifier (\verb|@book|) in figure
\ref{basic:source:eg}) says what type of source this is.
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 图中的标识 (\verb|@book|) 就是文献的类型。biblatex及其样式可能支持很多类型,但本章只关注4种类型:
book,article,inbook,Incollection。
\end{CJK}}
A large number of different types are supported, which we will look at in due
course; indeed, in the end, the question is really what types are
supported by the particular style you are using, since styles can
define any type they like. But in this chapter we are going to look at
just four types:
\begin{description}
\item[Book] is used for an entry that consists of a complete physical
book.
\item[Article] is used for journal articles.
\item[Inbook] is used for a self-contained chapter in a
book.\intref{See p~\pageref{inbook:vs:incollection} for the
difference between \texttt{inbook} and \texttt{incollection}.}
\item[Incollection] is used for a self-contained paper in a collection
of papers.
\end{description}
The entry type specifier is not case sensitive: \verb|@book|,
\verb|@Book| and \verb|@BOOK| all mean the same thing.
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 条目类型之后第一个内容是参考文献的引用关键字(\verb|key|)。其内的字符要避免出现\{ \}等特殊符号。可以采用一些容易记忆,使用的关键字,比如\texttt{nussbaum:1995}这样的。
\end{CJK}}
\index{database!general description}
A source record, if you squint at it, takes the basic form
\begin{center}\verb|@entrytype{...}|\end{center}The very first thing
within the braces is the \verb|key|. This does not have to take any
particular form, but it does need to be \emph{unique} to the
particular source, and it should be something memorable enough and
short enough to be practical for you, since you will be using it in
documents you write.
Although a \verb|key| can include quite a range of characters, there
are some that you should avoid;\footnote{{\ttfamily
\textquotedbl\ @ \textquotesingle\
\textbackslash\ \# \{ \}
\textasciitilde\ \%\ \textunderscore\
\&\ \$\ , \textasciicircum}} nor may a
key include spaces. It's a good idea to be more-or-less consistent
in the form your keys take, and to use common sense. For instance,
\texttt{nussbaum:1995} or \texttt{nussbaum:poetic} might be quite
good keys, but \texttt{nb} could easily clash with others keys,
\texttt{nussbaum:1995:poetic-justice} is arguably too long, and
\texttt{nbpoj95} may be hard to remember or work with. Use your
common sense.
Immediately after the \verb|key|, place a comma.
The rest of the source record consists of a set of fields and values entered
(usually)\footnote{Occasionally neither braces nor quote marks are
needed.} in either the form
\begin{center}\texttt{field = \{value\},}\end{center}
or, if you prefer, in the form
\begin{center}\texttt{field = "value",}\end{center}
Fields must be separated by commas. It is permissible (though not
required) to have a comma after the last one. I always make sure a
comma is added to every field: it makes editing easier, because if you
add another field you won't forget the comma.
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 引用关键字后面是一个逗号,然后是以项=值形式表示的域信息。各个域之间必须要用逗号分隔。域顺序无关紧要,也可以在=号周边等位置增添一些空格使内容对齐,是信息看起来更美观。
\end{CJK}}
The order in which you place the fields (apart from the |key|, which
must come first) doesn't matter. You can use whitespace freely between
fields and labels to keep things neat: as far as \package{Biber} is
concerned
\begin{Verbatim}
author = {Allen, Sidney},
title = {Vox Latina},
\end{Verbatim}
is just the same as
\begin{Verbatim}
author={Allen, Sidney},title={Vox Latina}
\end{Verbatim}
but for human consumption sensible spacing helps to keep things tidy.
\index{unicode!database, in}
Within a field you can use any unicode characters, and you can include
\LaTeX\ code too, if you need to (though it's sometimes a bad idea,
especially in name fields, for reasons we will come to).
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 域内可以包含任意unicode字符,也可以包含\LaTeX\ 代码,但这不是一个很好的方式,特别是在像姓名(name)类的域中。域信息的输入应尽可能的全面,比如姓名尽可能的写全,如果采用缩写,当采用要使用全名的样式时,就会缺失信息。
\end{CJK}}
Similarly,
just as when you are writing \LaTeX, you can break lines and end up
with just a single space, which also helps you to arrange things
neatly.
As figure \ref{basic:source:eg} shows one
can see that they are mostly self-explanatory. It's important to
appreciate that they are intended as data sources: the raw material
from which \biblatex\ will construct citations, not the citations
themselves. So generally you should enter as much information as you
have, because while \biblatex\ can ignore (or alter) information it
has, it cannot invent information it doesn't have. For example, if
entering a name you should, if you can, give the full name. Perhaps
your currently-preferred citation system uses initials only. That
doesn't matter, because \biblatex\ can extract the initials if it
knows the full name; but it can never guess the full name from
initials, and if you ever decided to use a system which needed the
full name, you would be lost. Similarly, you shouldn't attempt any
sort of formatting in these fields: they are just data, and if you
want names in small capitals or titles in italics you deal with that
by giving instructions when the |.bib| file is \emph{used}, not within
it.
%\section{Field types}
\section{域类型}
\index{database!fields}
When you read the \biblatex\ manual,\intref{\emph{Manual} \S~2.2.1}
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 域主要有5种类型:
姓名域,列表域,文本域,日期域和其它域。
\end{CJK}}
you will see that it distinguishes between five main types of field:
name fields, list fields, verbatim fields, date fields and other
fields, with various others for good measure. This is not actually a
very helpful distinction from the user's point of view, and I'd
suggest that you think of fields in this way:
\begin{itemize}
\item \emph{Names} These \emph{are} special, and worth thinking about
separately. Typical name fields are \texttt{author} and
\texttt{editor} fields.
\item \emph{Dates} Again, the \emph{are} special, and worth
considering specially. Typical name fields are \texttt{date} and
\texttt{urldate}.
\item \emph{Other bibliographical fields}, like \texttt{title},
\texttt{journaltitle}, \texttt{url} or \texttt{isbn}. These are all
fields that will contain material which might (depending on your
style) find its way into your printed bibliography.
\item \emph{Meta-data} fields, like \texttt{keywords} and
\texttt{options}, in which you provide information about your source
which may be used to help format it, but is not expected to find its
way directly into print.
\end{itemize}
\subsection{Names}
\indexstart{database!names}\index{names!database, in|see{database}}
Names turn out to be rather complex things.
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 姓名域。
\end{CJK}}
Suppose I have the
advantage of being called Quentin William Ffortescue von
Rumplestiltskin, Jr. I probably care about all the parts of this name;
but bibliographical software is particularly interested in the last
name which will be used for sorting (Rumplestiltskin) and the first
names which will, if necessary, be used for sorting (Quentin William
Ffortescue), and from which the initials (Q.\,W.\,F.) will be
constructed; but it may also need to know how to print my surname
including its `von' part, and to include the `Jr.' after my name.
All this can be done. It can even (usually) be inferred. It
\emph{usually} doesn't matter whether a name is entered as
\verb|John Smith| or \verb|Smith, John|. If in doubt, the following
rules will keep you straight. (Not all of them is strictly necessary;
but they are quite simple.)
\begin{enumerate}
\item Always enter initials with full stops. If it sees
\verb|A. Author|, or \verb|Author, A.|,
\biblatex\footnote{\package{Biber}, actually.} knows that \verb|A|
is an initial. If it sees \verb|A Smith| it might think that `A' is
a (very short) name. Since this \emph{can} matter, usually when you
least expect it, always include the dot. This doesn't mean that
\biblatex\ will necessarily \emph{print} any dot when it outputs
the bibliography. That is controlled by the bibliography style, so
you can safely include the dots in your \verb|.bib| file and lose
them later.
\item Always put any \emph{von} (or equivalent, such as \emph{van} or
\emph{de la}) \emph{before} the last name, as shown above.
\item For names \emph{without Jr.\ or numbers} use \emph{either}
`ordinary' name order \emph{or} \angled{last name}, \angled{first
name or initials}. So \verb|von Author, A.| or
\verb|A. von Author|. I highly recommend consistency in this. And in
fact I strongly recommend that you use the Last, First format, which
avoids mistakes with \ldots
\item If there is a `junior part' (like Jr.\ or III), you \emph{must}
use the `backwards' form:\begin{center}von Rumplestiltskin, Jr.,
Quentin William Ffortescue\end{center}
\item If what looks like two words should actually be treated as one,
then enclose them in braces. For instance, if a last name is
double-barrelled but not hyphenated, it needs to go in braces. The
hyphenated \verb|Homburg-Williams| will be fine, but we don't want
Mr.~J.\ Homburg Williams to find himself as J.\ H.~Williams, so make
it \verb|{Homburg Williams}, J.|\index{name, double-barrelled}
\item Similarly some names are not made to be broken at all, notably
institutions, which sometimes claim authorship or something close to
it. If the University of Oxford `writes' a report, \biblatex\ will
be inclined to think of it as `of Oxford, U'. Avoid this by
enclosing the whole name in (extra) braces:\intref{See
p~\pageref{sorting:sortname} for advice on how to make sure such
names are properly sorted.}\index{institutions!as authors}\index{author!institutional}
\begin{center}
\verb|author = {{University of Oxford}}|
\end{center}
\item For accented characters, either use unicode or enclose the
accented letters in braces: \verb|{Victor, Paul {\'E}mile}|. Of
these techniques, the use of unicode accented characters---which
\package{Biber} can handle, unlike \bibtex---is much to be
preferred. If you do have to use \TeX\ accents, enclose the
character in question (but only that character) in braces.\index{accented letters}
\end{enumerate}
Often academic works have multiple authors or editors. In that case,
enter all the names separated by `and' (\emph{not} commas).
\begin{center}
\ttfamily
Ardman, A. \textbf{and} Baptiste, B. \textbf{and} Carruthers, C.
\end{center}
You can also put \verb|and others| yourself. But be careful. How many
authors' names get printed is heavily style-dependent.\intref{See
p~\pageref{recipes:maxnames} for more information on how many names
will be printed.} Some styles only want one or two authors before
printing `et al'; others may want four or five, or always print every
name. It's easy for \biblatex\ to truncate names if it has more than
it needs, but impossible for it to guess who wrote a paper if it
hasn't been told, so as always, enter all the information you have
available.
\indexstop{database!names, in}
\subsection{Dates}
\index{database!dates, in}\index{date!database, in|see{database}}
Enter dates in the form |YYYY-MM-DD|.
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 日期域。
\end{CJK}}
So the 28th day in
of February 2012 is |2012-02-28|. In general, most \biblatex\ styles
will work with less-than-complete dates, and of course in many cases
you won't know the full date (for instance, the date when a book was
published): so |2012| is a valid date, as is |2012-02| (February
2012), as is |2012-02-28|. (Of course, that's not how dates will be
\emph{printed}, unless you want them to be: it's just how they are
entered.)
Occasionally you need to enter a range of dates. In that case, use the
a forward slash to separate the range: February to March 2012 is
|2012-02/2012-03|, and so on.
\subsection{Data fields}
Data fields other than name fields do not normally present such
difficulties, but there are a few points to bear in mind.
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 数据域。
\end{CJK}}
Some such fields (for instance the |publisher| and |location| fields)
are in fact \emph{lists}: in such cases, if you need more than one
entity mentioned, use \emph{and} between them, as with names.
Data fields may be important for sorting. For example, although in
most cases the primary sorting is done using the |author| or |editor|
field, the |title| field may sometimes come into play. This can pose
additional challenges, because it is possible, especially if the field
includes some \LaTeX\ command, to bamboozle the sorting algorithm. In
general, enclose \LaTeX\ commands (other than accented letters) in
\emph{two} sets of braces, and use unicode to deal with accented
letters wherever possible. So, for instance, we would
enter:\intref{See p~\pageref{sorting:sorttitle} for more information
about how to control the way titles are sorted.} As with names,
accents and diacritics are probably best handled with unicode.
\index{accented letters}
\begin{center}
|title = {The {{\LaTeX}} Companion}|
or
|title = {{\`A} l'ombre des jeune filles en fleurs}|
or (better)
|title = {Du côté de chez Swann}|
\end{center}
\index{title, capitalization}\index{capitalization!database, in|see{database}}\index{database!capitalization}
Data fields may be modified. For instance, some style files capitalize
only the first word of a title, so that an entry of
\begin{center}
|The German Law of Obligations|
\end{center}
would become
\begin{center}
The german law of obligations
\end{center}
Where you know that a particular letter must never be changed, you should `protect' it with braces:
\begin{center}
\texttt{The \{German\}\footnote{You will sometimes see this done as \texttt{\{G\}erman}, but the method given in the text is better, because it ensures proper kerning.} Law of Obligations}
\end{center}
Otherwise it's best to enter titles, at least if you write in English,
with `significant words capitalised', since \biblatex\ can easily
remove all but the first capital, but cannot be relied on to carry out
more sophisticated changes.\footnote{In other words, if asked to
capitalise the first letters of \texttt{The German law of
obligations} it would likely end up with \emph{The German Law Of
Obligations}, which is not correct.} As noted above, some styles
put titles into `sentence case'---with only the first word
capitalised. If you don't want that, the right thing to do is not to
attempt to outfox the style by manually protecting every capital with
braces, because that makes your database file useless if you ever do
want such changes. The right thing to do is to choose a different
style, or modify it, to preserve your capitalization.
\subsection{Metadata}
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 元数据。
\end{CJK}}
There is a wide variety of metadata that you may, for various reasons,
include in a file, including options to guide \biblatex\ in formatting
citations, and keywords and options to help structure biographies. In
general there is no particular difficulty with this sort of
information. It is just plain text, still included in braces, and
(sometimes) a comma-separated list.
Of these various fields, three stand out for special mention at this
point.
\index{database!languages}\index{language!specification in database|see{database}}
\paragraph{Specifying hyphenation patterns}Different languages are
hyphenated in different ways.\intref{Chapter~\ref{ch:languages}}
If you are writing a document in English, but cite a book whose title
is in French, \LaTeX\ will have trouble hyphenating it correctly. You
can specify the language in the |langid| field. Then, \emph{provided
you set the package option} |autolang=hyphen|, the entry will be
hyphenated using the appropriate language.
\paragraph{Keywords} The |keywords| field enables you to provide one
or more keywords (separated by commas). These can be useful if you
want to separate out different kinds of source. For instance, if you
wanted to produce different bibliographies by topic\intref{Chapter~\ref{ch:subdivisions}} for an annotated
bibliography, you could assign sources to particular topics using
keywords.
Other meta-data fields include |options|, |sorttitle|, |labeltitle|,
|indextitle| and |indexsorttitle|. These are all used for specialised
purposes to enable you to over-ride defaults in the way that
\biblatex\ would construct citations, sort the bibliography, or index
an entry. Some of these are discussed as appropriate later in this
book,\intref{Chapter~\ref{ch:sorting}} where their use is explained.
\paragraph{Sub-types} Some bibliography styles want to handle, say,
an article in a newspaper differently from an article in a journal. For this
purpose there is an \verb|entrysubtype| field. This can also be useful when
preparing subdivided bibliographies, where it can be used to select which
works get printed in which section.
%\section{Common entry types}
\section{常见条目类型}
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 常见的条目类型。
\end{CJK}}
This section is going to take a look at four of the commonly used
types of entry: books, articles, and the |incollection| and
|inbook| types. This is not intended to be a complete formal
description of every possibility. For that you can consult the
documentation.\intref{\emph{Manual}~\S~2.1.} It is supposed to give
practical guidance, especially for neophytes. Most of what is said
should seem like common sense for anyone who has ever written an
academic bibliography.
\subsection{Books}
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 专著(book)。
\end{CJK}}
\index{database!book type}\index{book!database entry|see{database}}
The bare minimum for any book is some sort of title. \emph{The Bible}
is a book, timeless as it is and un-named as its Author customarily
remains. Most books, however, have more information, and most
bibliographical styles require more information to be provided, if it
is available. Typically aim to record the following:
\paragraph{The author(s) name(s)} in the |author| field. If there is
an |editor| but no |author| leave the field blank.
\paragraph{The editor(s) name(s)} in the |editor| field. If there is
no editor, leave the field blank. If there is both an author and an
editor, include the editor's name as well as the author's.
\paragraph{The title} in the |title| field. Mostly this is easy, but
some works exist to annoy us. Dr Edwin Poppie-Cocke has just completed
`Grammatical Solecisms: Dangling Participles and Misplaced Modifiers`,
which is volume 234 of his treatise on `Elementary Stylistics'. What,
exactly, is its title? For our purposes,\footnote{This is a
simplification: there is also a \texttt{titleaddon} field that can
be used to print something after the title in a different font. And
\texttt{maintitle} can also have its own \texttt{mainsubtitle} and
\texttt{maintitleaddon} too! Happily, these are rarely needed.} we
divide it into three:
\begin{itemize}
\item The |maintitle|, which is the title of the multi-volume
treatise.
\item The |title|, which is the particular title of the book.
\item The |subtitle|.
\end{itemize}
We therefore enter:
\begin{Verbatim}
@book{poppycocke:2013,
author = {Poppie-Cocke, Edwin},
maintitle = {Elementary Stylistics},
title = {Grammatical Solecisims},
subtitle = {Dangling Participles and Misplaced Modifiers},
volume = 234,
}
\end{Verbatim}
It is better to divide title and sub-title in this way because,
although it would work if we didn't, some citation styles use the
title when referring back to the work on second and subsequent
citations, and the title alone, without subtitle, is usually
sufficient for this purpose, and less of a mouthful.
Where you have a multiple volume work, you have two choices. (1) You
can have a single entry in your database for the work in question with
all its volumes. This would normally be appropriate where you are
dealing with one work, published at one time, which happened to be
subdivided. In that case, enter the number of volumes in the |volumes|
field -- and remember to identify the particular volume you are
referring to when you cite the work.\footnote{There is also a
\texttt{mvbook} entry-type, which is specifically designed for
multiple-volume works. It's probably better, though not compulsory,
to use it for such works: see the \biblatex\ \emph{Manual}
\S~2.1.1.} (2) You may have separate entries for each volume, where
each volume is effectively a separate work. That is normally
appropriate where the volumes are published at different times. In
that case, put the volume in the |volume| field. Some works have
`parts' instead of, or as well as, volumes: in that case put the part
in the |part| field.
Some self-contained works are published as part of a series. If you
want to record that information, put the series in the |series| field.
\paragraph{The edition} in the |edition| field. This is usually
omitted for the first edition if only one edition was published. If
this is a number, just enter the cardinal number: |{2}|, not |second|
or |2nd| --- the right suffix will be added by \biblatex. If it's
something like `revised' or `corrected', type that.
\paragraph{Publication information}
In the |date| field. The year will usually suffice. The older \bibtex\
style was to enter the date in the |year| field. That will work fine,
but it's probably better to use |date|,\footnote{Unless you need your
\texttt{.bib} file to be usable in \bibtex\, in which case stick
with year.} which is `correct'. In some cases you will want to
record two dates: the date of original publication, and the date of
the particular edition you are referring to. In that case, put the
date of the particular edition in the |date| field, and the date of
original publication in the |origdate| field.
The place of publication should be specified in the |location|
field. You can also use a field called |address|, which is provided
for backward compatibility purposes (it was the field used in the
`original' \bibtex.)
The publisher's name goes in the |publisher| field. This is a `list
field', so that you can have more than one publisher, in which case
you enter them as
\begin{center}
\ttfamily
publisher = \{Publisher A \textbf{and} Publisher B \textbf{and} Publisher C\},
\end{center}
In some disciplines it is not customary to print the publisher's name,
or the place of publication, and you may think that's pretty
sensible since in most cases they are of no interest. Even so, unless
you are very certain that you will never want this information, it's
better to fill it in. It's always fairly straightforward to tell
\biblatex\ not to use information that it has available --- but
impossible to tell it to create information you haven't provided. So,
if you think of the future, it's best to include both.
\newthought{Those fields cover the basic bibliographical data
applicable to most books} but there are other pieces of information
that you may sometimes need or want to record.
\paragraph{Short titles and shorthands} If a title is being printed in
a bibliography, it makes sense to print it in its entirety, even if it
is very long. But some citation schemes (such as those that refer to
works by author and title) make repeated use of titles, and if the
title is very long such repeated references can become tiresome. It
may make sense, in such cases, to abbreviate the title of the work on
second and subsequent citation, so that---say---P.\ Kempees, \emph{A
Systematic Guide to the Case-Law of the European Court of Human
Rights 1960--1994} can become `Kempees, \emph{Systematic Guide}'. In
such cases, you can specify a |shorttitle|.
\indexstart{shorthand}\label{shorthands}
The \emph{shorthand} is a related, but subtly different idea. In some
works (for instance, commentaries or monographs devoted to the study
of a small number of books) or there may be such frequent
reference to a particular source that it makes sense to have an
abbreviation for it. You can define a special citation form, called a
`shorthand', which will be used to cite the work in question. The
package will also keep track of shorthands and you can print a list of
them, similarly to a bibliography, using the command
|\printshorthands| where you want the list to be produced.\intref{See
the \emph{Manual} \S~3.6.3.} A shorthand is included in the
|shorthand| field.
Shorthands may be summarized in a list of shorthands. They need not,
therefore, be self-explanatory; the reader will encounter them
frequently, and (if they are not standard in the field) can be
expected to look them up. They should be fairly rare --- reserved for
special cases. Short titles on the other hand will not appear in any
separate list, and you should be careful to make sure that they will
be immediately identifiable to any reader from the bibliography, and
reserve them for cases where the title is long. In a specialist work
on Wittgenstein it may be sensible to define \emph{PI} as an
abbreviation for \emph{Philosophical Investigations}, but it wouldn't
make sense to define that as a short title, or indeed to define any
short title for general use. And in the example given above,
`Systematic Guide' makes a good short title, but `SGCL60--94' would be
quite confusing. It is usually better not to define any short title or
shorthand until you are sure that you need them.
\indexstop{shorthand}
\paragraph{Translators, adapters, revisers.} It is usual to have an
author, and common to have an editor as well. It's not uncommon to
have other people who should be credited: translators, commentators
and the like. There are dedicated fields for |translator|, |annotator|
or |commentator|, into which you can put the name(s). If you have some
oddity, you can make use of upt to two fields called |editora| and
|editorb|. These are `generic' fields, into which you can put
names. If you do that, you also need to fill in the |editoratype| (or
|editorbtype| ...) fields, with the `role' of the person. \biblatex\
recognises as possible roles: `editor', `compiler', `founder',
`reviser' and `collaborator', and the enigmatic figures of `redactor'
and `continuator' too. You can add others as well, though it's not a
totally straightforward task.\intref{See \emph{Manual} \S\S~2.3.6, 3.8
and 4.9.1.}
The result, as the following example (whose output is shown in figure
\ref{redactors}) shows, can in theory include a very large number of
different roles, where that is needed.
\begin{Verbatim}
@book{team,
author = {Author, Arnold},
editor = {Editor, Edwin},
translator = {Translator, Theodore},
commentator = {Commentator, Cuthbert},
editora = {Redaktor, Richard},
editoratype = {redactor},
editorb = {Collaborator, Christopher},
editorbtype = {collaborator},
title = {Team Players},
date = {2013},
publisher = {Pubco},
address = {Oxbridge},
}
\end{Verbatim}
\begin{figure}
\fbox{\includegraphics{./examples/database-eg1.pdf}}
\caption{Bibliographical entry showing author, editor, commentator, translator, redactor and collaborator\label{redactors}}
\end{figure}
\index{URL!database, in|see{database}}\index{database!URL}\index{database!electronic publication}
\paragraph{Electronic publication} Works which were, in the past,
exclusively printed are now often published electronically, either as
well as or instead of paper publication. The \biblatex\ package tries
to reflect that.
One possibility is that the work is available on the internet, at a
\URL. In that case, you can specify a \URL\ in the |url| field. Many
bibliographic schemes require that the \emph{date} on which that \URL\
was last checked is also given, and that date should therefore be
included in the |urldate| field.
\index{arXiv}\index{JSTOR@\textsc{jstor}}
A second possibility is that the work is available in a specialised
electronic repository, such as arXiv or \textsc{jstor}. If that is the case,
you can make use of the |eprint|, |eprinttype| and |eprintclass|
fields to provide a reference for the work. \intref{See
\emph{Manual}~\S~3.11.7.} Not every bibliographic style will use
these details (and they can always be `turned off').\footnote{by
setting the option \texttt{eprint = false} when loading \biblatex.}
Finally, you can if you wish, provide a Digital Object Identifier
\smallcaps{doi}, which may provide a more permanent record of an
electronic source than a \URL, since \smallcaps{doi}s do not
change.\sidenote{\url{http:\\www.doi.org}. Again this feature can be
turned off by setting \texttt{doi = false}.}
\index{ISBN!database, in|see{database}}\index{database!ISBN}
\paragraph{ISBNs} If you think it is ever likely to be used, you can
included a book's \smallcaps{isbn} (International Standard Book
Number) in the |isbn| field. As with \smallcaps{doi}s, not every style
will print \smallcaps{isbn}s (and they can always be turned
off).\footnote{by setting the option \texttt{isbn = false} when loading
\biblatex.}
\paragraph{Other information} The \biblatex\ package allows quite a
wide range of other information to be included in a |.bib| file,
though not all of it will be used in all styles. For instance, it is
possible to include information about the original language of a book,
its original title, the title of a reprint and so forth. Since most of
this information is of interest only in narrow fields of unusual
cases, the reader is referred to the manual for details. Three fairly
common fields are, however, worth noting:
\begin{itemize}
\item |pubstate| is used to provide information about the publication
state of a work that has not yet been `properly' published. Standard
styles should recognise (in decreasing ratio of hope to expectation)
|inpreparation|, |submitted|, |forthcoming|, |inpress| and
|prepublished| as valid options here, and print appropriate
indications.
\item |note| and |addendum| may be used to provide necessary
bibliographical information, in a free form, which would otherwise
not have a `home', such as `reprinted with corrections from the 1724
edition'. The difference is that |note| will usually get printed
somewhere in the middle of an entry, while |addendum| gets printed
at the end (though the precise position depends on the particular
style). So
\begin{Verbatim}
@book{generic,
author = {Author, Albert},
...
note = {With a note},
addendum = {And an addendum},
}
\end{Verbatim}
produces something like figure \ref{addendum}.
\begin{figure}\fbox{\includegraphics{./examples/database-eg2.pdf}}
\caption{Note and addendum\label{addendum}}
\end{figure}
\item |annotation| may be used to provide a lengthy annotation, for
instance for use in annotated bibliographies.
\end{itemize}
\indexstop{database!book type}
\subsection{Articles}
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 期刊析出的文章(Article)。
\end{CJK}}
\indexstart{database!article type}\index{article!database entry|see{database}}
The article is the next basic form. Indeed, for most academic work it
is probably the most common. It is entered into the database using the
|article| entry type.
In general an article (as opposed to its reference) has only two
significant parts: the author(s) and title. Those are formatted just
as for books.\footnote{Except that \texttt{maintitle} is not used. The
\texttt{subtitle} field could, however, be used.}
\begin{Verbatim}
@article{mueck,
author = {Mueck, A. O. and
Seeger, H. and
Wallwiener, D.},
title = {Comparison of the Proliferative Effects
of Estradiol and Conjugated Equine
Estrogens on Human Breast Cancer Cells
and Impact of Continuous Combined
Progestogen Addition},
}
\end{Verbatim}
That, as figure \ref{mueck} shows, gets us only part of the way: we
have the \emph{article}'s title and authors, but we still need to
provide the details of the journal in which it is published.
\begin{figure}
\fbox{\includegraphics{./examples/database-eg3.pdf}}
\caption{Article with author and title, but reference missing.\label{mueck}}
\end{figure}
The publication details are entered using fields for:
\begin{itemize}
\item |journaltitle| for the name of the journal.\footnote{For
backwards compatibility reasons, \texttt{journal} will work too,
but prefer \texttt{journaltitle} unless you need \bibtex\
compatibility.} (There is also a |journalsubtitle| field, though
it is very seldom required.)
\item |series| for the journal's series (if any).
\item |volume| for the journal volume (if any).
\item |number| for the journal number (if any).
\item |issue| for the journal's issue (if any) (such as `Spring' --
there are also |issuetitle| and |issuesubtitle| fields, which can be
used where a particular issue has a special title which ought to be
cited). Use |number| strictly for numerical subdivisions and |issue|
for anything else. No matter that the journal you are dealing with
call this its `Christmas number': you will call it the |issue = {Christmas}|.
And no matter the journal says this is volume 5, \emph{issue}
2: you will call it |number = 2|.
\item |pages| for the pages occupied by the article in question.
\item |date| for the date of the publication.
\item |year| available only for backward compatibility with
\bibtex. Unless you need that, use the |date| field.
\item |month| for the journal's month, if that matters for
citation. This should be either an integer (1 = January, and so
forth) \emph{or} a three letter code which should be entered
\emph{without} braces: |jan| not |{jan}|. It is only there for
backward compatibility with \bibtex. Unless you need that, you can just include the month as part of the |date|.
\end{itemize}
So we can complete our partial citation:
\begin{Verbatim}
@article{mueck,
...
journaltitle = {Climacteric},
volume = {6},
pages = {221--227},
date = {2003},
}
\end{Verbatim}
And producing the result along the lines shown in figure \ref{mueck2}.
\begin{figure}
\fbox{\includegraphics{./examples/database-eg4.pdf}}
\caption{Article\label{mueck2}}
\end{figure}
\paragraph{Other information} Information such as \smallcaps{doi},
\smallcaps{issn} (the equivalent of \smallcaps{isbn} for journals) and
\smallcaps{annotations} is the same as for articles.
\indexstop{database!article type}
\subsection{Collections and Parts of Books}
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 文集(Collection)和专著的析出部分(Inbook)
\end{CJK}}
\indexstart{database!incollection type}\index{database!inbook entry|see{database}}
\index{collection!article in|see{database, incollection}}
Papers are often published in books --- collected papers,
\emph{festschriften}, and collections devoted to a particular topic.
For such works, \biblatex\ provides two entry types: |inbook| and
|incollection|.\label{inbook:vs:incollection} The boundaries between
them are slightly hazy. In theory a |book| is a work which has, as a
work, one or more `authors' who take collective responsibility for it,
and |inbook| is the entry-type corresponding to a discrete and
self-contained part of that, whereas a |collection| is an assembly of
disparate contributions which will have an editor or editors, but no
author(s) as such, and |incollection| corresponds to a discrete part
of that. In practice --- as it lies on the shelf --- a |collection| is
a book. So the key difference is whether the `unifying feature' of the
work is its author (|inbook|) or its editors (|incollection|). But
almost everything said about the |book| type above can be assumed to
apply to the |collection| type, and everything said here about
|inbook| can be assumed to apply to |incollection| as well.
In practical terms, for both |inbook| and |incollection| types you
have two choices:
\begin{itemize}
\item You can include all the information in a single entry. In that
case |author| and |title| are assumed to refer to the author of the
discrete unit that is being cited, while |bookauthor|, |editor|, and
|booktitle| refer to the larger work. You add either |pages| or
|chapter| to indicate the part of the book occupied by the discrete
unit.
\item You can separately specify the information for the larger work
(as |book| or |collection|, using all the fields given above). You
then specify the |author| and |title| of the sub-unit, together with
|pages| or |chapter|, and use the |crossref| field to link the
individual entry to the larger work.\index{crossref}\index{database!crossref}
\end{itemize}
So, for instance, using the first method we might have:
\begin{Verbatim}
@inbook{sedley:skulls,
title = {Skulls and Crossbones},
author = {Sedley, Stephen},
bookauthor = {Sedley, Stephen},
booktitle = {Ashes and Sparks},
booksubtitle = {Essays on Law and Justice},
date = {2011},
publisher = {Cambridge UP},
location = {Cambridge},
pages = {131--138},
}
\end{Verbatim}
Alternatively, you could set things up as follows:
\begin{Verbatim}
@book{sedley:ashes,
title = {Ashes and Sparks},
subtitle = {Essays on Law and Justice},
author = {Sedley, Stephen},
date = {2011},
publisher = {Cambridge UP},
location = {Cambridge},
}
@inbook{sedley:skulls,
title = {Skulls and Crossbones},
author = {Sedley, Stephen},
pages = {131--138},
crossref = {sedley:ashes},
}
\end{Verbatim}
A citation of |\cite{sedley:skulls}| will produce exactly the same
output in either case. My fairly strong advice is to prefer the second
method, because it is more flexible -- it enables citation of the
whole book separately, and it enables you easily to add additional
chapters or papers as units of their own without difficulty. It also
means that, once a certain threshold is reached, the entire book will
be added to the bibliography, which is often a convenience to
readers. (By default, the `parent' work is added to the bibliography
if two `children' are cited. You can change this number by giving a
value to |mincrossrefs| in the options to \biblatex. So to set it to
include the parent only when four `children' are cited, you would
include |mincrossrefs = 4| when loading \biblatex.)
\indexstop{database!incollection type}
%\section{A summary by type of literature}
\section{参考文献条目类型总结}
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 条目类型小结
\end{CJK}}
The preceding section of the chapter has surveyed the |book|,
|article|, |inbook| and |incollection| types, and indirectly
|collection| too, in some detail (though without exploring every tiny
corner, for which the manual is invaluable). There are many other
types -- some supported by the standard styles, and some used by
specialist styles (for instance, styles for legal citation or which
include support for citing sound recordings). Rather than work
relentlessly through them, table \ref{entry:summary} suggests what
type you might use to cite a number of different types of
literature. Where the entry type is marked by an asterisk, that means
that it is not supported in the standard styles, and you should
probably be looking for a specialised style that does support it.
\begin{table*}
\begin{tabularx}{\linewidth}{llX}
\toprule
\textsf{literature} & \textsf{suggested entry type} & \\
\midrule
article (journal) & \texttt{article} \\
article (in collection) & \texttt{incollection} or \texttt{inbook} \\
article (in newspaper) & \texttt{article} & (some styles offer special formatting) \\
article (unpublished) & \texttt{article} & use pubstate \\
book & book \\
letter (unpublished) & \texttt{misc} \\
letter (published) & \texttt{article} \\
manual & \texttt{report} \\
online item & \texttt{online} \\
thesis & \texttt{thesis} & set the \texttt{type} for the type of thesis \\
\bottomrule
\end{tabularx}
\caption{Sources and entry types\label{entry:summary}}
\end{table*}
%\section{Replacing text}
\section{文本替换}
\marginpar{\begin{CJK}{UTF8}{gbsn}\footnotesize 有时需要替换文本。比如对于同一个期刊或出版商,有时需要用全称,有时需要缩写。那么需要具有替换域信息的能力。
有两种方法可以实现:
1. 在bib文件中实现,定义string,然后用string名作为域的内容,主要string名不要带花括号。
2. 利用biber实现,biber的动态数据修改可以实现,利用直接的文本查找或者正则表达式,然后实现替换。
\end{CJK}}
\indexstart{database!abbreviations}\index{abbreviations!in database|see{database}}
One curse of bibliography generation is the abbreviation. Suppose you
have a journal called the `New York University Legal Studies
Quarterly'. Sometimes you will be told not to abbreviate it at
all. Sometimes you will be told to abbreviate it to `NY University
Legal Studies Q'; sometimes to `NYU Legal Studies Q'. And so
forth. (Slightly similar problems can apply with publishers: is it
`Oxford Univ.\ Press' or `OUP' or `Oxford University Press' or `Oxford
UP'?)
If you work in a field where this is not a problem---where standard
abbreviations are absolutely set in stone---then you are in
clover. In other fields, some element of flexibility is needed. There
are two ways you can achieve this, and one way that you can make your
life as difficult as possible.
If you want to make your life difficult, be sure to enter articles in
a radically inconsistent way, using different forms of the journal
name or publisher.
The two ways you can make your life easy are as follows.
\index{database!strings@database!@string}
First, you can use \emph{strings} in the |.bib| file. To do this,
define a string at the top of the file as follows
\begin{Verbatim}
@string{NYULSQ = "NY University Legal Studies Q"}
\end{Verbatim}
and then, in the |journaltitle| field, simply put |NYULSQ| (without braces)
\begin{Verbatim}
@article{...