\documentclass[usenames,dvipsnames]{beamer}

\usepackage{xltxtra}
\usepackage{etoolbox}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{polyglossia}
\usepackage[style=american]{csquotes}
\usepackage[backend=biber]{biblatex-chicago}
\usepackage{booktabs}
\usepackage{verse}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage[normalem]{ulem}
\usepackage{multicol}
\usepackage[cache=false]{minted}
\usepackage{ragged2e}
\usepackage{indentfirst}
\usepackage{comment}
\usepackage{wrapfig}
\usepackage{hyperref}

\definecolor{burgundy}{HTML}{990000}
\hypersetup{colorlinks,linkcolor=,urlcolor=burgundy}
\setdefaultlanguage{english}
\usefonttheme{serif}
\setmainfont[Ligatures=TeX]{Junicode}
\setsansfont[Ligatures=TeX]{Junicode}
\usetikzlibrary{decorations.text,tikzmark,positioning}
\settowidth{\versewidth}{line length indicated thus}
\setlength{\vrightskip}{-7em}
%\setlength{\vleftskip}{2em}
\setlength{\vgap}{1em}
\newlength{\rightquotedist}
\setlength{\rightquotedist}{85mm}
\newlength{\rightprosequotedist}
\setlength{\rightprosequotedist}{100mm}
\newlength{\longversewidth}
\settowidth{\longversewidth}{length of a hypermetric or Middle Engl verse line}
\verselinenumbersleft
\newcommand{\caes}{\hspace*{1em}}
\newcommand{\halflinegap}{\hspace*{8em}}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{bibliography item}{}
\setbeamerfont{quote}{shape=\upshape,family=\rmfamily}
\addbibresource{slides.bib}

\DefineBibliographyStrings{american}{%
  references = {Bibliography},
}

\newcommand{\lmr}{\fontfamily{lmr}\selectfont}
\newcommand{\cmr}{\fontfamily{cmr}\selectfont}
\let\oldLaTeX\LaTeX
\renewcommand{\LaTeX}{{\lmr\oldLaTeX}\,}
\let\oldXeLaTeX\XeLaTeX
\renewcommand{\XeLaTeX}{{\lmr\oldXeLaTeX}}
\let\oldTeX\TeX
\renewcommand{\TeX}{{\lmr\oldTeX}}
\let\oldXeTeX\XeTeX
\renewcommand{\XeTeX}{{\lmr\oldXeTeX}}

\title{\texttt{biblatex}}
\date{13 December 2018}
\author{\includegraphics[scale=.44]{by}\newline \href{http://langeslag.org}{P. S. Langeslag}}

\begin{document}

\maketitle

\begin{frame}
	\frametitle{An Overdue Note on Dashes}
	\begin{table}
		\begin{tabular}{lcc}
			\toprule
			\bfseries{Description} & \bfseries{Glyph} & \bfseries{Source}\\
			\midrule
			Hyphen	&	-	&	\texttt{-}\\
			En-dash	&	–	&	\texttt{--}\\
			Em-dash	&	— 	&	\texttt{---}\\
			\bottomrule
		\end{tabular}
	\end{table}
\end{frame}

\begin{frame}
	\frametitle{A Selection of Popular Citation Managers}
	\begin{block}{Citavi}
		\begin{itemize}
			\item Proprietary; commercial (free for small projects)
			\item Windows only (currently)
			\item Integration with Word; LibreOffice support discontinued
			\item Exports to BibTeX and \texttt{biblatex}
		\end{itemize}
	\end{block}
	\pause
	\begin{block}{Endnote}
		\begin{itemize}
			\item Proprietary; commercial
			\item Windows and Mac only
			\item Integration with Word, LibreOffice, OpenOffice
			\item Exports to BibTeX
		\end{itemize}
	\end{block}
\end{frame}

\begin{frame}
	\frametitle{A Selection of Popular Citation Managers}
	\begin{block}{Zotero}
		\begin{itemize}
			\item AGPL; free
			\item Cross-platform
			\item Integration with Word, LibreOffice, OpenOffice
			\item Exports to BibTeX and \texttt{biblatex}
		\end{itemize}
	\end{block}
\end{frame}

\begin{frame}
	\frametitle{BibTeX vs \texttt{biblatex}}
	\begin{block}{BibTeX}
	\begin{itemize}
		\item Relies on BibTeX’s own BAFLL language to format references
		\item Only permits latin1 encoding
	\end{itemize}
\end{block}
	\begin{block}{\texttt{biblatex}}
	\begin{itemize}
		\item Relies on the \LaTeX language to format references
		\item Relies on BibTeX or \texttt{biber} for sorting
		\item Allows utf8 encoding
		\item Permits multiple, subdivided bibliographies
	\end{itemize}
\end{block}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Loading \texttt{biblatex}}
\begin{minted}{latex}
\usepackage{polyglossia} % for localization
\usepackage[style=american]{csquotes} % for localization
\usepackage[style=authortitle-ibid]{biblatex}

\setdefaultlanguage{english} % for localization
\addbibresource{filename.bib}
\end{minted}

\begin{block}{Common Options}
	\begin{itemize}
		\item \texttt{backend=bibtex|bibtex8|biber} (default: \texttt{biber})
		\item \texttt{style=filename} (see manual §3.3)
	\end{itemize}
\end{block}
\end{frame}

\begin{frame}
	\frametitle{Some Built-In Styles}
	\begin{itemize}
		\item \texttt{authoryear}
		\item \texttt{authoryear-comp} (prints author only once)
		\item \texttt{authoryear-ibid}
		\item \texttt{authoryear-icomp}
		\item \texttt{authortitle}
		\item \texttt{authortitle-comp}
		\item \texttt{authortitle-ibid}
		\item \texttt{authortitle-icomp}
		\item \texttt{numeric}
		\item \texttt{verbose}
	\end{itemize}
\end{frame}

\begin{frame}[fragile]
	\frametitle{How to Use Common Styles}
	\begin{block}{MLA}
\begin{minted}{latex}
\usepackage[style=mla-new]{biblatex}
\end{minted}
	\end{block}
	\begin{block}{Chicago Manual of Style}
\begin{minted}{latex}
\usepackage[notes]{biblatex-chicago}
 % Or, for Harvard style:
\usepackage[authordate,backend=biber]{biblatex-chicago}
\end{minted}
	\end{block}

	See \texttt{biblatex-mla.pdf} and especially \texttt{biblatex-chicago.pdf}.
\end{frame}

\begin{frame}[fragile]
	\frametitle{A Book Entry}
\begin{minted}{latex}
@book{fulk18a,
   author = {R. D. Fulk},
   title = {A Comparative Grammar of the Early Germanic
    Languages},
   series = {Studies in Germanic Linguistics},
   number = {3},
   location = {Amsterdam and Philadelphia},
   publisher = {John Benjamins},
   date = {2018},
   doi = {https://doi.org/10.1075/sigl.3},
   keywords = {reference,linguistics}
}
\end{minted}
\end{frame}

\begin{frame}[fragile]
	\frametitle{An Article Entry}
\begin{minted}{latex}
@article{git14aud,
   author = {Helen Gittos},
   title = {The Audience for Old English Texts},
   subtitle = {Ælfric, Rhetoric and \mkbibquote{the
    Edification of the Simple}},
   shorttitle = {Audience},
   journaltitle = {Anglo-Saxon England},
   volume = {43},
   date = {2014},
   pages = {231--266}
}
\end{minted}
\end{frame}

\begin{frame}[fragile]
	\frametitle{An Essay Entry}
\begin{minted}{latex}
@inbook{wil05lfr, % cf. @incollection
   author = {Jonathan Wilcox},
   title = {Ælfric in Dorset and the Landscape of
    Pastoral Care},
   shorttitle = {Ælfric in Dorset},
   booktitle = {Pastoral Care in Late Anglo-Saxon England},
   editor = {Francesca Tinti},
   location = {Woodbridge},
   publisher = {Boydell},
   date = {2005},
   pages = {52--62}
}
\end{minted}
\end{frame}

\begin{frame}[fragile]
	\frametitle{A Website Entry}
\begin{minted}{latex}
@online{ononline,
   author = {Todd B. Krause and Jonathan Slocum},
   title = {Old Norse Online},
   url = {https://lrc.la.utexas.edu/eieol_toc/norol}
   urldate = {2018-12-13}
}
\end{minted}
\end{frame}


\begin{frame}
	\frametitle{Breakage}
	\begin{block}{Things That Will Fatally Break Your Bibliographical File}
		\begin{itemize}
			\item Omitting a comma after a nonfinal field
			\item Omitting a curly brace
		\end{itemize}
	\end{block}

	\begin{block}{Things That Will Locally Break Your Bibliographical Entry}
		\begin{itemize}
			\item Using a disallowed format for a given field
			\begin{itemize}
				\item e.g. anything but \texttt{YYYY*} for \texttt{date}
			\end{itemize}
		\end{itemize}
	\end{block}
\end{frame}

\begin{frame}
	\frametitle{Things That Won’t Break Your \texttt{.bib} File}
	\begin{itemize}
		\item A comma after a final field
		\item Your own choice of spacing and indentation
		\item Omitting a linebreak after a comma
	\end{itemize}
\end{frame}

\begin{frame}
	\frametitle{The \texttt{book} Entry Type (Selective Fields)}
		\begin{itemize}
			\item \textcolor{burgundy}{\texttt{author}} and/or \textcolor{burgundy}{\texttt{editor}}
			\item \textcolor{burgundy}{\texttt{title}}
			\item \texttt{subtitle}
			\item \texttt{location}
			\item \texttt{publisher}
			\item \textcolor{burgundy}{\texttt{year}} or \textcolor{burgundy}{\texttt{date}}
			\item \texttt{introduction}
			\item \texttt{afterword}
			\item \texttt{series}
			\item \texttt{number}
			\item \texttt{volume}
			\item \texttt{volumes}
			\item \texttt{edition} (integer or literal)
			\item \texttt{url}
		\end{itemize}
\end{frame}

\begin{frame}[fragile]
	\frametitle{\texttt{book} Complications: Editors and Editor Types}
\begin{minted}{latex}
@book{web07bib,
   editor = {Robert Weber},
   editora = {Roger Gryson},
   editoratype = {reviser},
   title = {Biblia sacra iuxta vulgatam versionem},
   shorttitle = {Biblia sacra},
   edition = {5},
   location = {Stuttgart},
   publisher = {Deutsche Bibelgesellschaft},
   date = {2007},
   langid = {latin},
   keywords = {primary}
}
\end{minted}
\begin{block}{Standard Editor Types}
		\vspace*{-4mm}
	\begin{multicols}{3}
		\begin{itemize}
			\item editor
			\item compiler
			\item founder
			\item continuator
			\item redactor
			\item reviser
			\item collaborator
			\item organizer
		\end{itemize}
	\end{multicols}
\end{block}
\end{frame}

\begin{frame}[fragile]
	\frametitle{\texttt{book} Complications: Reprints}
\begin{minted}{latex}
@book{burgra69,
   author = {Burke, Kenneth},
   title = {A Grammar of Motives},
   shorttitle = {Grammar},
   origlocation = {London},
   origpublisher = {Prentice-Hall},
   origyear = {1945},
   location = {Berkeley and Los Angeles},
   publisher = {University of California Press},
   year = {1969}
}
\end{minted}
\end{frame}



\begin{frame}
	\frametitle{The \texttt{article} Entry Type (Selective Fields)}
\begin{itemize}
	\item \textcolor{burgundy}{\texttt{author}} or \textcolor{burgundy}{\texttt{editor}}
	\item \textcolor{burgundy}{\texttt{title}}
	\item \texttt{subtitle}
	\item \textcolor{burgundy}{\texttt{journaltitle}}
	\item \textcolor{burgundy}{\texttt{year}} or \textcolor{burgundy}{\texttt{date}}
	\item \texttt{volume}
	\item \texttt{issue}
	\item \texttt{url}
\end{itemize}
\end{frame}

\begin{frame}
	\frametitle{The \texttt{inbook} Entry Type (Selective Fields)}
\begin{itemize}
	\item \textcolor{burgundy}{\texttt{author}}
	\item \textcolor{burgundy}{\texttt{title}}
	\item \texttt{subtitle}
	\item \textcolor{burgundy}{\texttt{booktitle}}
	\item \texttt{editor}
	\item \texttt{location}
	\item \texttt{publisher}
	\item \texttt{series}
	\item \texttt{number}
	\item \textcolor{burgundy}{\texttt{year}} or \textcolor{burgundy}{\texttt{date}}
	\item \texttt{volumes}
	\item \texttt{url}
\end{itemize}
\end{frame}

\begin{frame}
	\frametitle{The \texttt{online} Entry Type (Selective Fields)}
\begin{itemize}
	\item \textcolor{burgundy}{\texttt{author}}
	\item \textcolor{burgundy}{\texttt{title}}
	\item \texttt{subtitle}
	\item \textcolor{burgundy}{\texttt{year}} or \textcolor{burgundy}{\texttt{date}}
	\item \textcolor{burgundy}{\texttt{url}}
	\item \texttt{urldate}
\end{itemize}
\end{frame}

\begin{frame}
	\frametitle{Some Other Common Entry Types}
	\begin{itemize}
		\item \texttt{manual}
		\item \texttt{mvbook} (multivolume book)
		\item \texttt{bookinbook}
		\item \texttt{collection}
		\item \texttt{incollection}
		\item \texttt{misc}
		\item \texttt{proceedings}
		\item \texttt{inproceedings}
		\item \texttt{reference}
		\item \texttt{inreference}
		\item \texttt{mvreference}
		\item \texttt{report}
		\item \texttt{thesis}
		\item \texttt{unpublished}
	\end{itemize}
\end{frame}

\begin{frame}[fragile]
	\frametitle{The \texttt{author} and \texttt{editor} Fields}
	\begin{itemize}
		\item Can be in \texttt{Firstname Lastname} or \texttt{Lastname, Firstname} format, but subsequent names must be \texttt{Firstname Lastname}
		\item Separate multiple authors by “\texttt{and}”, no commas!
		\item How names with “\,‘von’ parts” are printed and sorted may be set globally using the \texttt{useprefix=true|false} option when loading the \texttt{biblatex} package
		\item Individual entries may depart from the global \texttt{useprefix} setting using the field \mintinline{latex}{options = {useprefix=true|false}}
		\item \texttt{biblatex} also tries to handle “\,‘Jr’ parts”; enter these in a conventional format to help it do so
		\item Icelandic Names and other monoliths may be set off in braces: \mintinline[breaklines]{latex}{author = {{Svanhildur Óskarsdóttir} and Emily Lethbridge}}
	\end{itemize}
\end{frame}

\begin{frame}
	\frametitle{The \texttt{title} Fields}
	\begin{itemize}
		\item \texttt{title} (everywhere required)
		\item \texttt{subtitle}
		\item \texttt{titleaddon} (formatted differently from main title)
		\item \texttt{shorttitle}
		\item \texttt{booktitle} (required for \texttt{inbook} type)
		\item \texttt{booksubtitle}
		\item \texttt{booktitleaddon}
		\item \texttt{maintitle} (for a multivolume work)
		\item \texttt{mainsubtitle} (idem)
		\item \texttt{journaltitle}
		\item \texttt{journalsubtitle}
		\item \texttt{issuetitle}
		\item \texttt{issuesubtitle}
		\item (\texttt{reprinttitle} --- not standard)
	\end{itemize}
\end{frame}

\begin{frame}
	\frametitle{The \texttt{year}, \texttt{month}, and \texttt{date} Fields}
	\begin{minipage}[t]{0.48\textwidth}
		\begin{block}{\texttt{year}}
			Literal integer only; e.g. \texttt{2018}.
		\end{block}
	\end{minipage}
	\hfill
	\begin{minipage}[t]{0.48\textwidth}
	\begin{block}{\texttt{month}}
		Literal integer only; e.g. \texttt{6}.
	\end{block}
	\end{minipage}
	\begin{block}{\texttt{date}}
		Recommended instead of the above. Permitted formats:
		\begin{itemize}
			\item \texttt{2018}
			\item \texttt{2018-06}
			\item \texttt{2018-06-20}
			\item \texttt{2018-06-20T23:06:30}
			\item \texttt{2018/}
			\item \texttt{/2018}
			\item \texttt{2014/2018}
			\item \texttt{2014-02/2018-06}
			\item \texttt{2014-02-28/2018-06-20}
		\end{itemize}
	\end{block}
\end{frame}

\begin{frame}
	\frametitle{The \texttt{language} and \texttt{langid} Fields}
	\begin{block}{\texttt{language}}
		\begin{itemize}
			\item Reproduced \emph{in the citation text} to identify the work’s main language
			\item May be a literal or a localization key
		\end{itemize}
	\end{block}

	\vspace*{-3mm}

	\begin{block}{\texttt{langid}}

	\vspace*{-2mm}
	
		\begin{itemize}
			\item Indicates the language of the entry for localization and hyphenation\newline (so e.g. capitalization is handled correctly!)
			\item Must be a localization key
		\end{itemize}
	\end{block}

	\vspace*{-3mm}

	\begin{block}{Localization Keys (Selective)}

	\vspace*{-2mm}

		\begin{multicols}{3}
			\begin{itemize}
				\item \texttt{american}
				\item \texttt{british}
				\item \texttt{canadian}
				\item \texttt{danish}
				\item \texttt{dutch}
				\item \texttt{french}
				\item \texttt{icelandic}
				\item \texttt{ngerman}
				\item \texttt{norsk}
				\item \texttt{nswissgerman}
				\item \texttt{nynorsk}
				\item \texttt{swedish}
			\end{itemize}
		\end{multicols}

	\vspace*{-2mm}
	
		See further \texttt{biblatex.pdf}, Table 2.
	\end{block}
\end{frame}

\begin{comment}
\begin{frame}[fragile]
	\frametitle{Notes and Addenda}
\begin{minted}{latex}
@article{lap75her,
   author = {Michael Lapidge},
   title = {The Hermeneutic Style in Tenth-Century
    Anglo-Latin Literature},
   journaltitle = {Anglo-Saxon England},
   volume = {4},
   date = {1975},
   pages = {67--111},
   addendum = {Reprinted with addenda in Lapidge,
    \mkbibemph{Anglo-Latin Literature, 900--1066} (London:
    Hambledon, 1993), 105--49, 474--9}
}
\end{minted}

	\begin{itemize}
		\item \texttt{addendum} is printed at the end; \texttt{note} is printed earlier.
	\end{itemize}
\end{frame}
\end{comment}

\begin{frame}[fragile]
	\frametitle{Special Formatting (Selection)}
	\begin{itemize}
		\item \mintinline{latex}{\mkbibemph % \emph{italics}}
		\item \mintinline{latex}{\mkbibquote % “quotation marks”}
		\item \mintinline{latex}{\mkbibparens % (parentheses)}
		\item \mintinline{latex}{\mkbibbrackets % [brackets]}
		\item \mintinline{latex}{\mkbibordinal % nth}
		\item \mintinline{latex}{\mkbibordedition % nth (edition)}
		\item \mintinline{latex}{\mkbibacro % acronym}
		\item \mintinline{latex}{\mkbibfootnote % footnote}
	\end{itemize}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Special Formatting}
\begin{minted}{latex}
@book{ful08beo,
   editor = {R. D. Fulk and Robert E. Bjork and John D.
    Niles},
   title = {Klaeber's \mkbibquote{\,\mkbibquote{Beowulf
    and \mkbibquote{The Fight at Finnsburg}}},
   shorttitle = {Beowulf},
   location = {Toronto},
   publisher = {University of Toronto Press},
   year = {2008},
   keywords = {primary}
}
\end{minted}

\begin{itemize}
	\item NB this example is not localization-independent!
\end{itemize}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Cross-Referencing}
	\begin{minted}{latex}
@book{gig99sim,
   editor = {Gerd Gigerenzer and Peter M. Todd},
   title = {Simple Heuristics That Make Us Smart},
   location = {Oxford},
   publisher = {Oxford University Press},
   year = {1999}
}

@inbook{gig99fas,
   crossref = {gig99sim},
   author = {Gerd Gigerenzer and Peter M. Todd},
   title = {Fast and Frugal Heuristics},
   subtitle = {The Adaptive Toolbox},
   pages = {3--34}
}
\end{minted}
Or use \texttt{xref}, which, however, inherits no data from the parent entry.
\end{frame}

\begin{frame}[fragile]
	\frametitle{Generating a Bibliography}

	\begin{block}{Preamble}
\begin{minted}{latex}
\addbibresource{filename.bib}
\end{minted}
	\end{block}

	\begin{block}{Document}
\begin{minted}{latex}
\printbibliography[heading=References]
\end{minted}
	\end{block}

The bibliography prints only cited items.

\end{frame}

\begin{frame}[fragile]
	\frametitle{Adding Noncited Entries to Your Bibliography}

\begin{minted}{latex}
% Add noncited entries to the bibliography:
\nocite{label1}
\nocite{label2}

% Add all entries in scope:
\nocite{*} 

\printbibliography
\end{minted}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Using Keywords}
\begin{minted}{latex}
\printbibliography[heading=Primary,keyword=primary]
\printbibliography[heading=Secondary,keyword=secondary,
 keyword=reference]
\printbibliography[heading=Reviews,notkeyword=primary,
 notkeyword=secondary]
\end{minted}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Basic Citations}
\begin{block}{Citing a Single Source}
\begin{minted}{latex}
\cite{label}
\cite[1--22]{label}
\cite[passim]{label}
\cite[cf.][1--22]{label}
\cite[contrast][]{label}
\Cite{label} % capitalizes the "'von' part"
             % (there are analogous versions
             % of all citation commands)
\end{minted}
\end{block}

\begin{block}{Citing Multiple Sources}
\begin{minted}{latex}
\cites[1--22]{source1}[54]{source2}
\cites[contrast][]{str58dis}[and again][]{gun00sea}
\end{minted}
\end{block}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Parenthetical Citations}
\begin{block}{Citing a Single Source}
\begin{minted}{latex}
\parencite[1--22]{label}
\end{minted}
\end{block}

\begin{block}{Citing Multiple Sources}
\begin{minted}{latex}
\parencites[1--22]{source1}[54]{source2}
\end{minted}
\end{block}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Footnote Citations}
\begin{block}{Citing a Single Source}
\begin{minted}{latex}
\footcite[1--22]{label}
\end{minted}
\end{block}

\begin{block}{Citing Multiple Sources}
\begin{minted}{latex}
\footcites[1--22]{source1}[54]{source2}
\end{minted}
\end{block}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Automatic Citations}

	\begin{itemize}
		\item Reads global settings to create footnote or parenthetical citations
		\item Actively avoids misplaced and duplicate punctuation
		\item Never use \mintinline{latex}{\cite}, \mintinline{latex}{\parencite}, or \mintinline{latex}{\footcite} again!
	\end{itemize}
\begin{block}{Citing a Single Source}
\begin{minted}{latex}
\autocite[1--22]{label}
\end{minted}
\end{block}

\begin{block}{Citing Multiple Sources}
\begin{minted}{latex}
\autocites[1--22]{source1}[54]{source2}
\end{minted}
\end{block}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Compiling \texttt{biblatex} Without \texttt{vimtex} Using \texttt{biber}}
\begin{minted}{bash}
xelatex --interaction=nonstop filename
biber filename
xelatex --interaction=nonstop filename
\end{minted}

You may omit the \texttt{.tex} extension.
\end{frame}

\begin{frame}[t]
\frametitle{Bibliography}
\nocite{biblatex}
\nocite{biblatex-chicago}
\printbibliography
\end{frame}

\end{document}
