\documentclass{ltxdockit}[2011/03/25]
\usepackage{btxdockit}
\usepackage{fontspec}
\usepackage[mono=false]{libertine}
\usepackage{microtype}
\usepackage[american]{babel}
\usepackage[strict]{csquotes}
\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
\usepackage{shortvrb}
\usepackage{pifont}
\usepackage{minted}
% Usefull commands
\newcommand{\biblatex}{biblatex\xspace}
\pretocmd{\bibfield}{\sloppy}{}{}
\pretocmd{\bibtype}{\sloppy}{}{}
% Meta-datas
\titlepage{%
	title={Manuscripts description for philology with biblatex},
	subtitle={New data types},
	email={maieul <at> maieul <dot> net},
	author={Maïeul Rouquette},
	revision={1.6.1},
	date={21/10/2014},
	url={https://github.com/maieul/biblatex-manuscripts-philology}}


\begin{document}

\printtitlepage
\tableofcontents
\section{Introduction}
\subsection{Goals}
The \biblatex package defines some standard fields for entry, and allows to use extra fields, like \bibfield{usera}, \bibfield{userb}. However, the number of extra fields needed to describe manuscripts in an introduction of a critical edition of classical texts is too great to use these fields' names without mistake.

The aim of this package is double:

\begin{itemize}
\item Provides new datatype: \bibtype{manuscripts} with adapted fields.
\item Provides new bibliography styles to print the list of manuscripts:
\begin{itemize}
	\item As a detailed list of witnesses of a text.
	\item As a \emph{conspectus siglorum}.
\end{itemize}
\end{itemize}

You can see minimal example in the file \href{file:example.pdf}{example.pdf}.
\subsection{Credits}

This package was created for Maïeul Rouquette's PHD\footnote{\url{http://apocryphes.hypothese.org}.} in 2014. It is licenced on the \emph{\LaTeX\ Project Public Licence}\footnote{\url{http://latex-project.org/lppl/lppl-1-3c.html}.}.

All issues can be submitted, in French or English, in the GitHub issues page\footnote{\url{https://github.com/maieul/biblatex-manuscripts-philology/issues}.}.


\section{New type and fields}

This package defines one new bibtype \bibtype{manuscript}, which is to be used to define a manuscript.

\subsection{Mandatory}
This bibtype has these mandatory fields:

\begin{fieldlist}

\fielditem{collection}{literal} the collection in the library. For example: \verb+Supplément grec+.

\fielditem{location}{literal} the city or place where the manuscript is kept. For example: \verb+Paris+ or \verb+Oxford+.

\fielditem{library}{literal} the library where the manuscript is kept. For example: \verb+Bibliothèque Nationale de France+.


\fielditem{shelfmark}{literal} the shelfmark in the collection. For example: \verb+241+.
\end{fieldlist}

\subsection{Optional}
This bibtype can use the optional fields:

\begin{fieldlist}

\fielditem{bookpagination}{key} the pagination of the manuscript which is studied. The standard pagination keys are allowed, but the package add a new key: \texttt{folio}. The value of this field is to be used for printing the \bibfield{pages} and \bibfield{pagetotal}.

\fielditem{columns}{integer} the number of column by pages. Basically, only two numbers are allowed: \verb+1+ or \verb+2+.

\fielditem{dating}{litteral} the dating of the manuscript. It can be for example a century.

\label{field:layer}\fielditem{layer}{key} for palimpsests, the layer which is studied. There is two possibility: 
	\begin{description}
		\item[inf] for the inferior layer.
		\item[sup] for the superior layer 
	\end{description}

\fielditem{shortcollection}{litteral} the abreviated form of the collection. Not used by the default style.\label{field:shortcollection}


\fielditem{shortlibrary}{litteral} the abreviated form of the library. Not used by the default style.


\fielditem{pages}{range} the pages which are studied in the manuscript. In this field, you can use the macros \cs{recto} and \cs{verso}.

\fielditem{pagetotal}{integer} the number of pages in the manuscript.


\fielditem{pagination}{key} the pagination of part of manuscript which is studied. The standard pagination key are allowed, but the package add a new key: \verb+folio+.


\fielditem{shorthand}{litteral} the shorthand of the manuscript. If this field is empty, the entry key will be used as shorthand, except if the version \opt{manuscript-noautoshorthand} is loaded. See \secref{noautoshorthand}.

\fielditem{support}{key} the support of the manuscript, which will be translated in your work language. These keys are defined: \texttt{papyrus}, \texttt{paper}, \texttt{pergament}.

\end{fieldlist}

\subsection{Special}\label{fields:special}
There are also two special fields, which are printed only if we ask for them explicitly:

\begin{fieldlist}
\fielditem{annotation}{litteral} some annotation about the manuscript and its content. If you want to add paragraphs inside it, you must use the \cs{par} command between each paragraph.


\fielditem{catalog}{special} a list of catalogues which describe the manuscript. You must fill this field with arguments of a \cs{cites} command. For example:

\begin{minted}{tex}
@manuscript{key,
  field1 = {value1},
  field2 = {value2},
  catalog = {[prenote1][postnote1]{key1}[prenote2][postnote2]{key2}}
\end{minted}


\fielditem{origin}{list} the places where the manuscript was written.

\fielditem{owner}{name} the name(s) of the owner(s) of the manuscript in the past.

\fielditem{scribe}{list} the name(s) of the scribe(s).

\end{fieldlist}

\section{Use}
\subsection{Loading}

When loading the \biblatex package, use the option \opt{bibstyle} with value equal to \opt{manuscripts}.

\begin{minted}{latex}
\usepackage[bibstyle=manuscripts,otheroption…]{biblatex}
\end{minted}

\label{noautoshorthand}If you don't want the \bibfield{shorthand} of the manuscript be auto-defined from the entry key, use \opt{manuscripts-noautoshorthand instead}.

\begin{minted}{latex}
\usepackage[bibstyle=manuscripts-noautoshorthand,otheroption…]{biblatex}
\end{minted}
\subsection{Citation of one manuscript}

The manuscript description is supposed to be used with a \opt{citestyle} of the \emph{verbose} family (see the \biblatex handbook).

So, if you use:
\begin{minted}{latex}
\cite{manuscriptkey}
\end{minted}

the full reference of the manuscript will be printed (see the example file). However, you can use \cs{shcite} to print directly the shorthand of the manuscript:

\begin{minted}{latex}
\shcite{manuscriptkey}
\end{minted}

\subsection{List of manuscripts: \emph{conspectus siglorum}}

You can use the standard command \cs{printshorthands} with appropriate options:

\begin{minted}{latex}
\printshorthands[type=manuscript,title=Conspectus siglorum]
\end{minted}

In the previous example, with use one option to print shorthands only for manuscripts entries, and we set the title to the classical one \enquote{Conspectus siglorum}.

\subsection{List of manuscripts with detailed fields}

If you want to print a list of manuscripts with detailed fields listed in \secref{fields:special}, just use the \opt{env} option, with value equal to
\cnt{details}.

\begin{minted}{latex}
\printshorthand[type=manuscript,env=details,title=Description of manuscripts]
\end{minted}

In this case, you must run two times biber: one after the first run of \LaTeX\ and one after the second run, to add in the \file{.bbl} the catalogues. After that, run a three time \LaTeX.

If you use \opt{manuscripts-noautoshorthand} version, this list could contain manuscripts without shorthand. By default, the descriptions of such manuscripts will be aligned on the left of the shorthands column. 

\label{bibcheck}An other solution is to make two lists: one with manuscripts with shorthand and one with manuscript withoutshortands. You can add to your \cmd{printbiblography} or \cmd{printshorthands}  commands a \opt{bibcheck} option, equal to \opt{withshorthand} or \opt{withoutshorthand}. As you:
\begin{minted}{latex}
\printshorthands[
  type=manuscript,
  env=details,
  title=Description of used manuscripts,
  check=withshorthand
]
\printbibliography[
  type=manuscript,
  title=Description of other manuscripts,
  check=withoutshorthand
]
\end{minted}

\subsection{Sorting list of manuscripts without shorthand}

\label{sorting} If you doesn't use the shorthands' feature, you can want to print a list of manuscripts, sorted by Town, Library, Collection, Shelfmark.

You can use, for that, the option \opt{sorting=manuscripts}. 

\begin{minted}{latex}
\printbibliography[
  type=manuscript,
  title=Description of other manuscripts,
  sorting=manuscripts
]
\end{minted}

You can use the special field \bibfield{sortshelfmark} if the way you shelf marks are sorted is not the way they are printed (like in normal entry type, you can use \bibfield{sorttitle}.

\section{Customization}

\subsection{Commands}

You can redefine, with \cs{renewcommand} some commands defined in \file{manuscripts.bbx}. The commands starting with \cs{mk...} take one argument, the other take no argument. In these command, use the punctuation commands of \biblatex.

\begin{ltxsyntax}
\csitem{collectionshelfmarkpunct} the punct between \bibfield{collection} and \bibfield{shelfmark}. By default \cs{addspace}.

\csitem{datingpagespunct} the punct between \bibfield{dating} and \bibfield{pages}. By default \cs{addcomma}\cs{addspace}. The \cs{isdot} is automatically called when printing \bibfield{dating} field. 

\csitem{librarycollectionpunct} the punct between \bibfield{library} and \bibfield{collection}. By default \cs{addcomma}\cs{addspace}.

\csitem{mkcolumns} the way the \bibfield{columns} are printed. By default, in parens.

\csitem{mklocation} the way the \bibfield{location} is printed. By default, with the command \cs{mkbibnamelast}.

\csitem{mkmanuscriptdescriptionlabel} the way the label are printed before the special field. By default, in bold, following with \cs{manuscriptdescriptionlabelpunct}.

\csitem{mkshcite} the way the shorthand is printed when using \cs{shcite}. By default, no special formatting.

\cs{locationlibrarypunct} the punct between \bibfield{location} and \bibfield{library}.  By default \cs{addcolon}\cs{addspace}.

\cs{manuscriptdescriptionlabelpunct} the punct between label and text, for the special fields. By default \cs{addcolon}\cs{addspace}.

\cs{moreinterpunct} the punct between each special fields when printing in the same paragraph. By default \cs{addcolon}\cs{addspace}.

\cs{pagetotalpagespunct} the punct between \bibfield{pagetotal} and \bibfield{pages}. By default \cs{addcolon}\cs{addspace}.
\end{ltxsyntax}

\subsection{Commands to use in the \bibfield{pages} field}

In the pages field, you can use \cs{recto} and \cs{verso} command when you speak of folios. Default value are \cnt{r} and \cnt{v} but you can change them.

\subsection{Localization strings}

Some specific localization strings are defined in the \file{manucripts-xxx.lbx} files. Read the \biblatex handbook to know how to customize it.

\subsection{Macros and field formats}

The \file{manuscripts-shared.bbx} file defines bibmacros and field formats (read the \biblatex handbook to know more about bibmacro and field format). We can't list all of them, but you can look on them to know how to customize more finely the manuscripts description.

\section{Use with biblatex-realauthor}\label{biblatex-multiple-dm}

To use this package with the features of \verb+biblatex-realauthor+, you must use the package \verb+biblatex-multiple-dm+.


\section{Change history}

\begin{changelog}

\begin{release}{1.6.1}{2014-10-21}	
  	\item Add \cs{isdot} after each printing of the \bibfield{dating} field, to allow to use abbreviations with a dot (like \enquote{c.}) without adding a uppercase after. Consequently, \cs{isdot} is deleted from \cs{datingpagespunct}.
\end{release}

\begin{release}{1.6.0}{2014-10-16}	
  	\item Patching some bibmacros to prevent lost of manuscript descriptions when using  op. cit abreviation.
\end{release}

\begin{release}{1.5.0}{2014-10-08}	
  	\item Formating of collection+shelfmark defined in a FielFormat.
	\item Compatibility with \verb+chicago-notes+ styles.
\end{release}

\begin{release}{1.4.0}{2014-06-23}
	\item Compatibility with \verb+biblatex-multiple-dm+.\see{biblatex-multiple-dm}
\end{release}


\begin{release}{1.3.0}{2014-06-16}
	\item Add sorting description.\see{sorting}
\end{release}

\begin{release}{1.2.0}{2014-04-07}
	\item Add \bibfield{layer}.\see{field:layer}
\end{release}

\begin{release}{1.1.1}{2014-03-20}
	\item Delete \opt{msnoautoshorthand} option and replace it by the \opt{manuscripts-noautoshorthand} style. \see{noautoshorthand}
\end{release}

\begin{release}{1.1.0}{2014-03-15}
\item Add \opt{msnoautoshorthand} option.
\item Add \bibfield{shortcollection} field.\see{field:shortcollection}
\item Add \opt{withshorthand} and \opt{withoutshorthand} bibcheck. \see{bibcheck}
\end{release}

\begin{release}{1.0.0}{2014-01-20}
\item First public release.
\end{release}
\end{changelog}
\end{document}
