@slide(layout=chapter-slide)

@number
12

@title
Reference management


@slide(layout=content-only)

@title
What do we need?

@content
*	a **bibliography file** (hereafter `.bib` file) for storing references
*	**BibLaTeX** as an interface between the references and LaTeX


@slide(layout=wide-content)

@title
What is this mysterious `.bib` file?

@content
*	collection of references in BibLaTeX format
*	example:

``` {.hljs .lang-tex}
@article{turing1990, % the type of the document and an identifier for the \cite command
    title={The chemical basis of morphogenesis}, % information
    author={Turing, Alan Mathison},              % about
    journal={Bulletin of mathematical biology},  % the
    volume={52},                                 % literature
    pages={153--197},                            % work
    date={1990},                                 % follows
    publisher={Springer}                         % …
}
```

@slide(layout=content-only)

@title
BibLaTeX

@content
* Package for creating and designing bibliographies
* Use of **biber** as backend

<div class="box warning">
**Some well-meaning advice**

You want the references to look professional?

Trust BibLaTeX’s default citation styles!

This conversely means: Avoid fiddling around with styles manually.
</div>

>	Two things are infinite: the universe and&nbsp;the&nbsp;assortment of citation styles.<cite>Unknown</cite>


@slide(layout=content-only)

@title
What you need

@content

* Include the `BibLaTeX` package in the preamble:

``` {.lang-tex .hljs}
\usepackage[style=<citation-style>, 
backend=biber]{biblatex}
```

* Include the `.bib`-file in the preamble:

``` {.lang-tex .hljs}
\addbibresource{<bib-file>}
```

* Generate the bibliography:

``` {.lang-tex .hljs}
\printbibliography
```

* `BibLaTeX` documentation: [Link](https://ctan.org/pkg/biblatex?lang=de)
* `BibLaTeX` cheat sheet: [Link](https://tug.ctan.org/info/biblatex-cheatsheet/biblatex-cheatsheet.pdf)



@slide(layout=content-only)

@title
Changing the citation style

@content
* Built-in styles for direct use (z.B. `authoryear`, `numeric`, `alphabetic`)
* additionally options for configurations and other styles (z.B. `apa`, `ieee`, `chicago-authordate`)

``` {.lang-tex .hljs}
\usepackage[style=numeric, citestyle=ieee, 
backend=biber]{biblatex}
```

@slide(layout=content-only)

@title
Sorting entries

@content

``` {.lang-tex .hljs}
\usepackage[style=numeric, citestyle=ieee, 
sorting=nty, backend=biber]{biblatex}
```
<table>
  <tr>
	<th>Code</th>
	<th>Description</th>
  </tr>
  <tr>
	<td>nty</td>
	<td>Name, Title, Year</td>
  </tr>
  <tr>
	<td>nyt</td>
	<td>Name, Year, Title</td>
  </tr>
  <tr>
	<td>nyvt</td>
	<td>Name, Year, Volume, Title</td>
  </tr>
    <tr>
	<td>ydtn</td>
	<td>Year (descending), Title, Name</td>
  </tr>
</table>


@slide(layout=content-only)

@title
How is it used?

@content
BibLaTeX adds some citation commands to LaTeX. In addition, we need the `natbib` package.

<table>
  <tr>
	<th>Code</th>
	<th>Description</th>
  </tr>
  <tr>
	<td>`\parencite{turing1990}`</td>
	<td>[Turing, 1990]</td>
  </tr>
  <tr class="fragment">
	<td>`\textcite{turing1990}`</td>
	<td>Turing (1990)</td>
  </tr>
  <tr class="fragment">
	<td>`\textcite[p. 159]`<br />`{turing1990}`</td>
	<td>Turing (1990, p. 159)</td>
  </tr>
</table>

++ Citing with additional text:<br/>`\cite[<prefix>][<suffix>]{<source>}`

@slide(layout=content-and-preview)

@title
An example

@content
``` {.lang-tex .hljs}
\usepackage[style=authoryear, 
maxnames=3, 
minnames=1, 
nohashothers=true, 
dashed=false, 
url=false, 
backend=biber]{biblatex}
```
An exemplary reference in the citation style above:
``` {.lang-tex .hljs}
\textcite{thatcher2002} or in parentheses
\parencite{thatcher2002}.

\printbibliography
```

@preview
![](svg/chapter-14/example_citation_en-crop.svg)




@slide(layout=preview-only)

@preview
![Citing in Alpha style](svg/literature/bibtex-alpha-example-crop.svg){.large .thin-padding}


@slide(layout=preview-only)

@preview
![Citing in IEEE style](svg/literature/bibtex-ieee-example-crop.svg){.large .thin-padding}


@slide(layout=preview-only)

@preview
![Finding ready-made BibTeX entries – University of Bamberg Library](svg/literature/bamberg_catalogue_bibtex.jpg){.large}


@slide(layout=preview-only)

@preview
![Finding ready-made BibTeX entries – Google Scholar](svg/literature/google_bibtex1.jpg){.large}


@slide(layout=preview-only)

@preview
![Finding ready-made BibTeX entries – Google Scholar](svg/literature/google_bibtex2.jpg){.large}


@slide(layout=preview-only)

@preview
![Finding ready-made BibTeX entries – dblp.org](svg/literature/dblp.jpg){.large}


@slide(layout=wide-task)

@task-number
12

@title

Creating and inserting references

@content
* Create a new BibTeX file called `literature.bib` in the `exercises/literature` folder.
*	Use Google Scholar or dblp.org to retrieve BibTeX references for the following $\LaTeX$ handbooks:
	*	Dilip Datta (2017): $\LaTeX$ in 24 Hours. A Practical Guide for Scientific Writing.
	*	Frank Mittelbach / Michel Goossens (2010): Der $\LaTeX$-Begleiter.
* Add the BibTeX entries to the BibTeX file.
* Assign unique and meaningful BibTeX keys.
* Add the bibliography file to the project's preamble.
* Make use of the `alpha` bibliography style.
* Cite the two handbooks in the file `exercises/literature/literature.tex`.
* Ensure that the bibliography is listed.

:::{.box .warning}
**Not**: If the compilation fails, it may be helpful to remove all temporary files (`….aux/bbl/blg/loc/out/pdf/soc/toc`) and to compile again.
:::

@slide(layout=extra-content-only)

@title
The University Library recommends …

@content
* reference management software (esp. **[Zotero](https://www.zotero.org/)**) help to build a literature database, store quotations, and organize one's own notes
* ++ support available from the **library's own reference management team**: literaturverwaltung.ub@uni-bamberg.de
* ++ in Zotero: activate the plugin **["Better BibTeX"](https://retorque.re/zotero-better-bibtex/)** (applies also if you are using `biblatex`)

:::{.box .warning .fragment}
**💡 Further information**

There are plenty of resources about the setup available online.
:::


@slide(layout=extra-content-only)

@title
Setup for Zotero with Better BibTeX

@content
* **Zotero**: 
  * install **["Better BibTeX"](https://retorque.re/zotero-better-bibtex/)** 
  * Tools > Plugins > enable `Better BibTeX for Zotero`
  * export your library from Zotero, set `Better BibLaTex` as format, and set `keep updated` to true
  * save the library in your LaTeX project archive and use it as the `.bib`-file
* **TeXstudio**: 
  * Bibliography > set type to `BibLaTeX`
  * Options > Configure TeXstudio > Generate > set standard for bibliography to `Biber`

@slide(layout=extra-content-only)

@title
Demo: Referencing with Zotero and BibLaTeX

@content
* Hint: **["Zotero Connector for Firefox"](https://www.zotero.org/download/)** for easy import of BibTeX entries
* First set up Zotero with Better BibTeX (see previous slide)
* Open the reference source and click on the Firefox extensions
* Run Zotero Connector and import the BibTeX entry into Zotero
* Reference the source as usual according to the procedures already described