Debian Codegraph @

texmf-dist/doc/latex/ualberta/02_Chapters/07_Citations_And_References.tex

raw
1 \chapter{Citations, References, and Cross-References}\label{ch:citref}
2 This section will be showing off some of the different ways to include \enquote{citations} and \enquote{cross-references} within your document.
3 Note that \textbf{cross-references} in \LaTeX\ utilize \cmd{ref} as a command, while one might think that this is short for reference this is not the case citation/references utilize the \cmd{cite} command.
4 \section{Cross-References}
5 In \LaTeX, references will \enquote{reference} a \cmd{label}\mopt{Reference:Label} command.
6 This section has the following command to define the Chapter:
7 \begin{Center}
8 \lstinline|\chapter{Citations/References, and Cross-References}\label{ch:citref}|
9 \end{Center}
10 By using \cmd{ref}\mopt{ch:citref}|, this allows you to insert a cross\hyp{}reference that look like this \ref{ch:citref}.
11 Now this by itself is not the most useful, to make it a bit better we should keep track of what we are cross\hyp{}referencing, in this case a \textbf{Chapter}, and add this label in front of the cross\hyp{}reference (\lstinline|Chapter~\ref{sec:citref}|) and this will display like this: Chapter~\ref{ch:citref}.
12
13 \note{To ensure the reference is not split we need add a non\hyp{}breaking space (\(\sim \)) to prevent \LaTeX\ from accidentally adding a line\hyp{}break between the label we added and the actual cross\hyp{}reference.}
14
15 While using the \cmd{ref} command, you might ask \enquote{\textit{Why does \LaTeX{} not just know what it is that I am referencing and insert that automatically in front of the reference?}}
16 The answer is to provide more flexibility to the user.
17 However, that being said, individuals have created a number of packages that work to enhance the workflow of adding these cross-references.
18 Some of these are provided by the \pkg{hyperref} and \pkg{cleveref} packages.
19 To include these packages add the following lines to the \textbf{bottom} of your preamble (order matters, \pkg{cleveref} needs to be after \pkg{hyperref}; and \pkg{hyperref} should be one of the last packages loaded):
20 \begin{lstlisting}[style=LaTeXStyle]
21 \usepackage{hyperref}
22 \usepackage[nameinlink]{cleveref}
23 \end{lstlisting}
24 With these packages loaded we can now use the commands listed in \Cref{tab:reftable}.\footnote{Note that because the floats are added where they are in the text this causes them to insert large amounts of white space because it only fits on the following page.}
25 \begin{table}[H]
26 \caption{Built-in, hyperref, and cleveref commands and outputs}
27 \label{tab:reftable}
28 \centering
29 \begin{tabularx}{0.5\linewidth}{CC}
30 \toprule
31 \textbf{Command} & \textbf{Output} \\
32 \midrule
33 \multicolumn{2}{c}{built-in}\\
34 \lstinline|\\ref\{\}| & \ref{tab:reftable} \\
35 \lstinline|\\pageref\{\}| & \pageref{tab:reftable} \\
36 \midrule
37 \multicolumn{2}{c}{hyperref}\\
38 \lstinline|\\autoref\{\}| & \autoref{tab:reftable} \\
39 %\lstinline|\\autoref*\{\}| & \autoref*{tab:reftable} \\
40 \midrule
41 \multicolumn{2}{c}{cleveref}\\
42 \lstinline|\\cref\{\}| & \cref{tab:reftable} \\
43 \lstinline|\\Cref\{\}| & \Cref{tab:reftable} \\
44 \lstinline|\\cref*\{\}| & \cref*{tab:reftable} \\
45 \lstinline|\\Cref*\{\}| & \Cref*{tab:reftable} \\
46 \lstinline|\\cpageref\{\}| & \cpageref{tab:reftable} \\
47 \lstinline|\\Cpageref\{\}| & \Cpageref{tab:reftable} \\
48 \lstinline|\\namecref\{\}| & \namecref{tab:reftable} \\
49 \lstinline|\\nameCref\{\}| & \nameCref{tab:reftable} \\
50 \bottomrule
51 \end{tabularx}
52 \end{table}
53 Further, the \pkg{cleveref} also includes features that allows for the auto sorting and combining of references:
54 \begin{lstlisting}[style=LaTeXStyle]
55 \Cref{fig:doubleImage,fig:singleImage,fig:tripleImage1,fig:quadImage}
56 \end{lstlisting}
57 Noting that there are \textbf{NO} spaces between the labels; this will produce: \Cref{fig:doubleImage,fig:singleImage,fig:tripleImage1,fig:quadImage}.
58 Allowing one to quickly and efficiently keep references up-to-date and consistent in their style.
59 More examples of the use of the \pkg{cleveref} cross-referencing is found through the rest of this \nameCref{ch:citref}.
60 \section{Citations/References}
61
62
63 \section{Citation Managers}
64
65 \subsection{JabRef}
66 Information on the use of this has been moved to it's own Chapter %%TODO: REMOVE THIS LINE
67 \section{This is old Material}
68 %TODO: REMOVE AND INCORPERATE THE INFORMATION INTO THE ABOVE NEW SECTIONS.
69 This section will be showing off some of the different ways to include \enquote{citations} and \enquote{cross-references} within your document.
70 Note that \textbf{cross-references} in \LaTeX\ utilize \cmd{ref} as a command, while one might think that this is short for reference this is not the case citation/references utilize the \lstinline|\cite{}| commands.
71 \subsection{Cross-References}\label{subsec:cross-reference}
72 In \LaTeX, references will \enquote{reference} a \lstinline|\label{Reference:Label}| command.
73 This section has the following command to define the the section:
74 \begin{Center}
75 \lstinline|\subsection{Cross-References}\label{subsec:cross-reference}|
76 \end{Center}
77 By using \lstinline|\ref{subsec:cross-reference}|, this allows you to insert a reference that look like this: \ref{subsec:cross-reference}.
78 Now this by itself is not the most useful, to make it a bit better we should keep track of what we are referencing, in this case a \textbf{Section}, and add this label in front of the reference (\lstinline|Section~\ref{subsec:cross-reference}|) and this will display like this: Section~\ref{subsec:cross-reference}.
79 Note to ensure the reference is not split we add a non-breaking space (\lstinline|~|) to prevent \LaTeX\ from adding a line break.
80
81 While using the ref command, you might ask \enquote{\textit{Why does \LaTeX\ not just know what it is that I am referencing and insert that automatically in front of the reference?}}
82 The answer is to provide more flexibility to the user.
83 However, that being said, individuals have created a number of packages that work to enhance the workflow of adding these cross-references.
84 Some of these are provided by the \pkg{hyperref} and \pkg{cleveref} packages.
85 To include these packages add the following lines to the bottom of your preamble (order matters, cleveref needs to be after hyperref and hyperref should be one of the last packages loaded):
86 \begin{lstlisting}[style=LaTeXStyle]
87 \usepackage{hyperref}
88 \usepackage[nameinlink]{cleveref}
89 \end{lstlisting}
90 With these packages installed we can now use the commands in \Cref{tab:reftable}.\footnote{Note that because the floats are added where they are in the text this causes them to insert large amounts of white space because it only fits on the following page.}
91 \begin{table}[H]
92 \caption{Built-in, hyperref, and cleveref commands and outputs}
93 \label{tab:reftable2}
94 \centering
95 \begin{tabularx}{0.5\linewidth}{CC}
96 \toprule
97 \textbf{Command} & \textbf{Output} \\
98 \midrule
99 \multicolumn{2}{c}{built-in}\\
100 \lstinline|\\ref\{\}| & \ref{tab:reftable2} \\
101 \lstinline|\\pageref\{\}| & \pageref{tab:reftable2} \\
102 \midrule
103 \multicolumn{2}{c}{hyperref}\\
104 \lstinline|\\autoref\{\}| & \autoref{tab:reftable2} \\
105 \midrule
106 \multicolumn{2}{c}{cleveref}\\
107 \lstinline|\\cref\{\}| & \cref{tab:reftable2} \\
108 \lstinline|\\Cref\{\}| & \Cref{tab:reftable2} \\
109 \lstinline|\\cref*\{\}| & \cref*{tab:reftable2} \\
110 \lstinline|\\Cref*\{\}| & \Cref*{tab:reftable2} \\
111 \lstinline|\\cpageref\{\}| & \cpageref{tab:reftable2} \\
112 \lstinline|\\Cpageref\{\}| & \Cpageref{tab:reftable2} \\
113 \lstinline|\\namecref\{\}| & \namecref{tab:reftable2} \\
114 \lstinline|\\nameCref\{\}| & \nameCref{tab:reftable2} \\
115 \bottomrule
116 \end{tabularx}
117 \end{table}
118 Further, the \pkg{cleveref} also includes features that allows for the auto sorting and combining of references:
119
120 \begin{lstlisting}[style=LaTeXStyle]
121 \Cref{fig:doubleImage,fig:singleImage,fig:tripleImage1,fig:quadImage}
122 \end{lstlisting}
123 Noting that there are \textbf{NO} spaces between the labels; this will produce: \Cref{fig:doubleImage,fig:singleImage,fig:tripleImage1,fig:quadImage}.
124 Allowing one to quickly and efficiently keep references up-to-date and consistent in their style.
125 More examples of the use of the \pkg{cleveref} cross-referencing is found through the rest of this document.
126 \subsection{Citations}\label{subsec:citations}
127 Citations are a lot easier than dealing with the cross-referencing.
128 There are no additional packages required for citations, the built-in ones are feature-rich enough.
129 Now, while there are no additional packages required to make citations in your document, there are in fact a few programs that should help you manage all of your citations/references.
130 These programs can include Mendeley, JabRef, or Zotero; a comparison of the softwares can be found in \Cref{tab:refSoftware}, and more information of the use of JabRef can be found in \Cref{ch:JabRef}.
131 \begin{table}[htbp]
132 \centering
133 \caption{Comparison of Reference Softwares}
134 \label{tab:refSoftware}%
135 \begin{tabularx}{0.95\linewidth}{Lcccr}
136 \toprule
137 Software & Developer & Version & Cost & License \\
138 \midrule
139 JabRef & The JabRef Team & 5.11 & Free & MIT \\
140 Mendeley & Elsevier & 2.99.0 & {Free up to 2~GB} & Proprietary \\
141 Zotero & CDS & 6.0.27 & {Free up to 300~MB} & AGPL \\
142 \bottomrule
143 \end{tabularx}%
144 \end{table}%
145 Single citations can be included with the \cmd{cite}\mopt{citationKey} command, the one at the end of this sentence is created with the \cmd{cite}\mopt{TEST} command\cite{TEST}.
146 Multiple citations can be included in a single cite command by adding commas in between the citation keys.
147 The citation at the end of this sentence shows how to create more than one citation and how they are grouped together, it is created with the \cmd{cite}\mopt{testone,cite2,cite3,cite4,cite5} command\cite{testone,cite2,cite3,cite4,cite5}.
148 Finally this sentence shows how a gap in the citations is handled, this is created with the \cmd{cite}\mopt{testone,cite2,cite3,cite5} command\cite{testone,cite2,cite3,cite5}.