Debian Codegraph @

texmf-dist/doc/latex/biblatex/examples/01-introduction.tex

raw
1 %
2 % This file briefly presents the main citation commands. It also
3 % illustrates the typical structure of a document based on biblatex.
4 %
5 \documentclass[a4paper]{article}
6 \usepackage[T1]{fontenc}
7 \usepackage[utf8]{inputenc}
8 %
9 % We load the babel package and specify the main language of the
10 % document. If babel is detected, biblatex will automatically adjust
11 % to the default language of the document.
12 \usepackage[american]{babel}
13 %
14 % We load the csquotes package, which is required for
15 % language-specific quotation marks. See the csquotes manual for
16 % further information about this package.
17 \usepackage{csquotes}
18 %
19 % We are using the 'authoryear' style in this example.
20 % The default is the 'numerical' style.
21 \usepackage[style=authoryear,backend=biber]{biblatex}
22 %
23 % We use the database biblatex-examples.bib.
24 \addbibresource{biblatex-examples.bib}
25 %
26 % Some generic settings.
27 \newcommand{\cmd}[1]{\texttt{\textbackslash #1}}
28 \setlength{\parindent}{0pt}
29 \begin{document}
30
31 \section*{Standard citation commands}
32
33 \subsection*{The \cmd{cite} command}
34
35 % The \cite command prints a bare citation without parentheses.
36
37 \cite{companion}
38
39 \cite[59]{companion}
40
41 \cite[see][]{companion}
42
43 \cite[see][59--63]{companion}
44
45 \subsection*{The \cmd{parencite} command}
46
47 % The \parencite command, which is intended for in-text citations,
48 % encloses the citation in parentheses. Note that the 'numeric' and
49 % 'alphabetic' styles use square brackets instead.
50
51 This is just filler text \parencite{companion}.
52
53 This is just filler text \parencite[59]{companion}.
54
55 This is just filler text \parencite[see][]{companion}.
56
57 This is just filler text \parencite[see][59--63]{companion}.
58
59 \subsection*{The \cmd{footcite} command}
60
61 % The \footcite command is similar to \parencite, except that the
62 % citation is given in a footnote.
63
64 This is just filler text.\footcite{companion}
65
66 This is just filler text.\footcite[59]{companion}
67
68 This is just filler text.\footcite[See][]{companion}
69
70 This is just filler text.\footcite[See][59--63]{companion}
71
72 \subsection*{The \cmd{textcite} command}
73
74 % The \textcite command is intended for citations integrated in the
75 % flow of text, replacing the subject of the sentence.
76
77 \textcite{companion} show that this is just filler text.
78
79 \textcite[59]{companion} show that this is just filler text.
80
81 % With \textcite, the first optional argument is of limited use
82 % only, since you could simply place the prenote in front of the
83 % citation. It is still supported for the sake of consistency.
84
85 \textcite[see][]{companion} show that this is just filler text.
86
87 \textcite[see][59--63]{companion} show that this is just filler text.
88
89 \section*{Style-independent commands}
90
91 \subsection*{The \cmd{autocite} command}
92
93 % The point of the \autocite command is that it automatically adapts
94 % to the predominant citation format (inline or footnote) normally
95 % used with the selected citation style. It should be used at the
96 % end of the sentence and usually works like \parencite or
97 % \footcite, depending on the citation style and the setting of the
98 % 'autocite' package option. With the author-year style used in this
99 % example, it works like \parencite:
100
101 This is just filler text \autocite{companion}.
102
103 \section*{Text commands}
104
105 % There are a few predefined commands for bibliographic data which
106 % is frequently used in the flow of text. Note that biblatex also
107 % grants access to all lists and fields at a lower level, see below.
108
109 \citeauthor{companion} show that this is just filler text.
110
111 % Note that \citetitle will use the 'shorttitle' field, if
112 % available.
113
114 See the \citetitle{companion} for more filler text.
115
116 % \citetitle*, on the other hand, always prints the 'title'
117 % field.
118
119 See also: \citetitle*{companion}. It has more filler text.
120
121 \citetitle*{companion} by \citeauthor{companion} was
122 published in \citeyear{companion}.
123
124 \section*{Special commands}
125
126 % The \nocite command adds an entry to the bibliography without
127 % printing any citation. If the argument is an asterisk (i.e.,
128 % '\nocite{*}'), all entries found in the bib file are added to the
129 % bibliography.
130
131 No citation here.\nocite{knuth:ct}
132
133 % The \fullcite command prints a verbose citation similar to the
134 % full bibliography entry.
135
136 \fullcite{companion}
137
138 % \footfullcite is similar to \fullcite, except that the citation is
139 % put in a footnote.
140
141 This is just filler text.\footfullcite{companion}
142
143 \section*{Low-level commands}
144
145 % The commands in this section grant low-level access to all
146 % bibliographic data. See the biblatex manual for details about the
147 % different data types (name lists, literal lists, fields).
148
149 % The \citename command prints a name list. For example, the
150 % \citeauthor command shown above is similar to the following
151 % low-level command:
152
153 \citename{companion}{author}
154
155 % The \citelist command is similar to \citename but prints literal
156 % lists.
157
158 \citelist{companion}{publisher}
159
160 % The \citefield command prints fields. For example, the
161 % \citetitle* command shown above is similar to the following
162 % low-level command (except for the formatting):
163
164 \citefield{companion}{title}
165
166 % The list of references is printed by way of \printbibliography.
167
168 \printbibliography
169
170 \end{document}