%% Copyright 2013 Maïeul Rouquette % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. % % The Current Maintainer of this work is Maïeul Rouquette % This work consists of the files manuscripts*.dbx, manuscripts*.bbx, manuscripts*.lbx \ProvidesFile{manuscripts-commons} [\abx@bbxid] \ifdef{\biblatexmultipledm@bibstyle} {\RequireBibliographyStyle{\biblatexmultipledm@bibstyle}} {\RequireBibliographyStyle{verbose}} % This file contains code shared by manuscript.bbx and manuscript-noauthoshorthand. % This file is organized from the must close of user to the less close. % 1. Some commands to be redefined \newcommand{\collectionshelfmarkpunct}{\addspace} \newcommand{\datingpagespunct}{\addcomma\addspace} \newcommand{\librarycollectionpunct}{\addcomma\addspace} \newcommand{\mkcolumns}[1]{\addspace\mkbibparens{#1}} \newcommand{\mklayer}[1]{\addspace\mkbibparens{#1}} \newcommand{\mklocation}[1]{\mkbibnamelast{#1}} \newcommand{\mkmanuscriptdescriptionlabel}[1]{\textbf{#1}\manuscriptdescriptionlabelpunct} \newcommand{\mkshcite}[1]{#1} \newcommand{\locationlibrarypunct}{\addcolon\addspace} \newcommand{\manuscriptdescriptionlabelpunct}{\addcolon\addspace} \newcommand{\moreinterpunct}{\addsemicolon\addspace} \newcommand{\pagetotalpagespunct}{\addcolon\addspace} \def\recto{r} \def\verso{v} % 2. Some macros \newbibmacro{annotation}{% \iffieldundef{annotation}{}{\printfield{annotation}} } \newbibmacro{manuscript:more}{% \printlist{origin}% \setunit{\moreinterpunct}% \printnames{scribe}% \setunit{\moreinterpunct}% \printnames{owner}% } \newbibmacro{more+annotation+catalog}{% \iftoggle{shorthand:details}{% \setunit{\finentrypunct\par}% \usebibmacro{manuscript:more}% \setunit{\finentrypunct\par}% \usebibmacro{annotation}% \setunit{\finentrypunct\par}% \usebibmacro{catalog}% }{}% } \newbibmacro{catalog}{% \iffieldundef{catalog}{}% {\printfield{catalog}}% } \newbibmacro{collection+shelfmark}{% \printtext[collection+shelfmark]{% \printfield{collection}% \iffieldundef{collection}{}{\setunit{\collectionshelfmarkpunct}}% \printfield{shelfmark}% }% } \newbibmacro{date/dating}{% \iffieldundef{dating}{\usebibmacro{date}} {\printfield{dating}}% } \newbibmacro{location+library+collection+shelfmark}{% \printlist{location}% \setunit{\locationlibrarypunct}% \printfield{library}% \setunit{\librarycollectionpunct}% \usebibmacro{collection+shelfmark}% } \newbibmacro{manuscript:pages}{% \printfield{pagetotal}% \iffieldundef{columns}{}{\bibstring[\mkcolumns]{\strfield{columns}column}}% \setunit{\pagetotalpagespunct}% \printfield{pages}% \iffieldundef{layer}{}{\bibstring[\mklayer]{\strfield{layer}layer}}% } \newbibmacro{support+dating}{% \printfield{support}% \newunit% \usebibmacro{date/dating}% } % 3. Some Field or List Format \DeclareFieldFormat{catalog}{% \bibstring[\mkmanuscriptdescriptionlabel]{catalog}% #1% } \DeclareFieldFormat{collection+shelfmark}{% \printtext[title]{#1}% } \DeclareFieldFormat{dating}{#1\isdot} \DeclareFieldFormat{support}{\bibstring{#1}} \DeclareNameFormat{manuscript}{% \ifnumgreater{\value{listcount}}{\value{liststart}}% {\multilistdelim}% {\bibstring[\mkmanuscriptdescriptionlabel]{\currentname}}% \ifuseprefix {\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}} {\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}% } \DeclareNameAlias{scribe}{manuscript} \DeclareNameAlias{owner}{manuscript} \DeclareListFormat[manuscript]{location}{% \usebibmacro{list:delim}{\mklocation{#1}}% \mklocation{#1}\isdot% \usebibmacro{list:andothers}} \DeclareListFormat[manuscript]{origin}{% \ifnumgreater{\value{listcount}}{\value{liststart}}% {\multilistdelim}% {\bibstring[\mkmanuscriptdescriptionlabel]{origin}}% #1% } % 4. Printshorthands Environment \newtoggle{shorthand:details} \defbibenvironment{details} {\toggletrue{shorthand:details} \list {\printfield[shorthandwidth]{shorthand}} {\setlength{\listparindent}{\parindent}% \setlength{\labelwidth}{\shorthandwidth}% \setlength{\leftmargin}{\labelwidth}% \setlength{\labelsep}{\biblabelsep}% \addtolength{\leftmargin}{\labelsep}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}% \renewcommand*{\makelabel}[1]{##1\hss}}} {\endlist} {\item\iffieldundef{shorthand}{\hspace{-\labelwidth}\hspace{-\labelsep}}} % 5. Others %% 5.1 Driver \DeclareBibliographyDriver{manuscript}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \usebibmacro{location+library+collection+shelfmark}% \newunit \printlist{language}% \newunit\newblock \printfield{howpublished}% \newunit\newblock \printfield{note}% \newunit\newblock \usebibmacro{support+dating} \newunit\newblock \iftoggle{bbx:url} {\usebibmacro{url+urldate}} {}% \setunit{\datingpagespunct} \usebibmacro{manuscript:pages} \iftoggle{bbx:related} {\newunit\newblock% \usebibmacro{related:init}% \usebibmacro{related}} {}% \usebibmacro{more+annotation+catalog}% \usebibmacro{finentry} } \DeclareBibliographyDriver{cite:manuscript}{%For biblatex-chicago styles \usebibmacro{bibindex}% \usebibmacro{location+library+collection+shelfmark}% \newunit \printlist{language}% \newunit\newblock \printfield{howpublished}% \newunit\newblock \printfield{note}% \newunit\newblock \usebibmacro{support+dating} \newunit\newblock \setunit{\datingpagespunct} \usebibmacro{manuscript:pages} \usebibmacro{more+annotation+catalog}% \usebibmacro{finentry} } %% 5.2 Citation command \DeclareCiteCommand{\shcite}[\mkshcite] {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite:shorthand}} {\multicitedelim} {\usebibmacro{cite:postnote}} %% 5.3 NumCheckSetup (should not be changed) \NumCheckSetup{\def\verso{}\def\recto{}} %% 5.4 Language mapping \DeclareLanguageMapping{english}{english-manuscripts} \DeclareLanguageMapping{french}{french-manuscripts} % 5.5 bibcheck \defbibcheck{withshorthand}{\iffieldundef{shorthand}{\skipentry}{}} \defbibcheck{withoutshorthand}{\iffieldundef{shorthand}{}{\skipentry}} %% 5.6 Sorting \DeclareSortingScheme{manuscripts}{ \sort{ \field{presort} } \sort[final]{ \field{sortkey} } \sort{ \field{location} \literal{0000} } \sort{ \field{library} \literal{0000} } \sort{ \field{collection} \field{0000} } \sort{ \field[padside=left,padwidth=50,padchar=0]{sortshelfmark} \field[padside=left,padwidth=50,padchar=0]{shelfmark} } } % 6. Prevent trouble with abbreviated forme (verbose family) \RequirePackage{xpatch} \newbibmacro{manuscript:add:shortened}{\ifentrytype{manuscript}{\usebibmacro{location+library+collection+shelfmark}}{}} \newcommand{\manuscriptaddshortened}[1]{% \def\do##1{% \xpretobibmacro{##1}{\usebibmacro{manuscript:add:shortened}}{}{}% }% \docsvlist{#1}% } \AtBeginDocument{% \manuscriptaddshortened{cite:title,cite:short,cite:opcit}% } \endinput