% !Mode:: "TeX:DE:UTF-8:Main"
% $UFDate: 2017-12-03 18:19:20 +0100 -- Commit: 4f26014 (HEAD, master) -- master$
\documentclass[DIV=12]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[autostyle]{csquotes}
\usepackage{microtype}
\usepackage[style=authoryear-ibid,hyperref=false]{biblatex}
\usepackage{citeall}
\usepackage{fourier}
\usepackage{ydoc-desc,tabularx}
\usepackage{enumitem,needspace}
\makeatletter
\enitkv@key{enumitem}{compactsep}[true]{%
  \divide\partopsep by 2\relax
  \divide\topsep by 2\relax
  \divide\itemsep by 2\relax
  \divide\parsep by 2\relax}
\makeatother
\addbibresource{examples-citeall.bib}
\title{The \pkg{citeall} package, v1.4}
\author{Ulrike Fischer\thanks{fischer@troubleshooting-tex.de}}

\begin{document}
\maketitle
\section{Changes}
Version 1.4 changed the code to adapt the package to the newest biblatex 3.9.


Version 1.3 added code to handle the @preamble field in a bib. Changed the definition of \verb+\sortlist+ to adapt to the newest biblatex.

Version 1.2 adapts the package to biblatex 3.0 and correct some small bugs (e.g. unwanted spaces).
\section{Important}
\pkg{citeall} works only together with (newer versions of) \pkg{biblatex}.  \pkg{biblatex} should be loaded before \pkg{citeall}.

The package relies on some inner working of \pkg{biblatex}, so it could break with future or older versions (I tested with version 3.9).

\section{The aim of the package}
The \pkg{citeall} package is a package to help to adapt and debug \pkg{biblatex}
citation styles. When adapting such a style one often needs to inspect the
output of examples. While it is easy with \verb+\nocite{*}+ to output all entries of a bib-file in the bibliography it is more troublesome to show citations.
So I wrote a (very) small package which allows me to show citations of all entries of the bib-files.




\section{The command}
The main command of the package is called like the package and has two optional arguments:

\DescribeMacro\citeall[<list of commands>][<number of entries>]

The second optional argument sets the number of entries of the .bib (more precisely the .bbl-file) printed by \cs{citeall}. By default everything is cited.

The first optional argument is a comma separated list.
For each entrykey in the .bbl \cs{citeall} will loop through this list and pass to each item the entrykey as last argument. By default this list consist simply of a \cs{cite} command.  The items don't need to be cite commands. As the examples show you can add text and other commands.

\begin{itemize}[compactsep]
\item The last command should be something that can handle the entry key argument.
\item If there are brackets e.g. from optional argument of a \cs{cite} you should protect them with braces.
\item If there are commas you should protect them with braces.
\item If you want to insert a paragraph break, use \cs{endgraf}
\item Don't overdo the system. It is meant for simple debugging not for complicated citation printouts.
\end{itemize}

\section{Some examples}
\verb+\citeall+            \begin{tabular}[t]{p{0.3\textwidth}}
                           \citeall
                           \end{tabular}
\verb+\citeall[][1]+       \begin{tabular}[t]{p{0.3\textwidth}}
                           \citeall[][1]
                           \end{tabular}


\noindent
\verb+\citeall[\fullcite]+\begin{tabular}[t]{p{0.7\textwidth}}
                           \citeall[\fullcite]
                           \end{tabular}


\noindent
\verb+\citeall[\cite[15],\cite]+\begin{tabular}[t]{p{0.7\textwidth}}
                                \citeall[\cite[15],\cite]
                                \end{tabular}

\noindent
\verb+\citeall[Key: \textcolor{red},{\cite[15]},Test ibid: \cite]+

\begin{tabular}[t]{p{0.7\textwidth}}
 \citeall[Key: \textcolor{red},{\cite[15]},Test ibid: \cite]
\end{tabular}

\noindent
\verb+\citeall[{\cite[15]},\endgraf \cite]+

\begin{tabular}[t]{p{0.7\textwidth}}
 \citeall[{\cite[15]},\endgraf \cite]
\end{tabular}

\section{Printing the bibliography}
\cs{citeall} internally issues a \verb+\nocite{*}+, so \cs{printbibliography} will print all entries of the bib-file. Since version 1.1 \cs{citeall} adds all entries it cites  to a category \enquote{citeall}. So if you restrict the number of citation with the second optional argument, you can also restrict the length of the bibliography with \verb+\printbibliography[category=citeall]+

\Needspace{8\baselineskip}
\section{Configuration}

\DescribeMacro\citeallgroupseparator
\DescribeMacro\citeallseparator
\DescribeMacro\citeallfinentry
\DescribeMacro\citealldefaultcite

By default the item of an entry are separated by a comma and a space. This can be changed by redefining \cs{citeallseparator}. The last item is finished by \cs{citeallfinentry} (default nothing). The entries are separated by a \cs{par}, this can be changed by redefining \cs{citeallgroupseparator}.
The default cite command used by \cs{citeall} is (\cs{cite}). This can be changed by redefining \cs{citealldefaultcite}.

\DescribeMacro\citeallpreambledefinition

.bib files can contain a special entry type \texttt{@preamble} which can contain definitions that should be executed at the begin of the bibliography, e.g. to ensure that some commands are defined. Such a field lead to a command \verb+\preamble{...}+ in the .bbl. When \cs{citeall} reads the .bbl it redefines \cs{preamble} to do nothing. You can change this behaviour by redefining this macro. It should always have one argument!


\end{document}
