summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-claves
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/biblatex-contrib/biblatex-claves
Initial commit
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-claves')
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/README4
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/claves.bbx122
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/claves.dbx22
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves-ref.bib33
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.bib16
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.pdfbin0 -> 86947 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.tex211
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/latexmkrc2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/makefile2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-claves/makefile16
10 files changed, 428 insertions, 0 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/README b/macros/latex/contrib/biblatex-contrib/biblatex-claves/README
new file mode 100644
index 0000000000..08f79fea74
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/README
@@ -0,0 +1,4 @@
+biblatex-claves
+==================
+
+Manage claves with biblatex (like Bibliotheca Hagiographica Graeca, Clavis Patrum Latinorum)
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/claves.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-claves/claves.bbx
new file mode 100644
index 0000000000..ccf5fcd16e
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/claves.bbx
@@ -0,0 +1,122 @@
+%% Copyright 2016-… 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 claves.dbx, claves.bbx
+% 0. Preamble
+
+\ProvidesFile{claves.dbx}[2017/04/09 v1.2.0 biblatex bibliography style (MR)]
+
+\ifdef{\biblatexmultipledm@bibstyle}
+ {\RequireBibliographyStyle{\biblatexmultipledm@bibstyle}}
+ {\RequireBibliographyStyle{verbose}}
+
+
+\RequirePackage{xpatch}
+
+% 1. Tools to declare new clavis
+\newcommand{\AddBiblatexClavis}[1]{%
+ \appto\biblatex@claves{#1,}%
+ \DeclareStyleSourcemap{%
+ \maps[datatype=bibtex]{%
+ \map[overwrite]{%
+ \step[fieldsource=#1,final]%
+ \step[fieldset=claves,fieldvalue={\string\multiclavesseparator\space\string\clavisformat{#1}\string\clavisseparator{}},append]%
+ \step[fieldset=claves,origfieldval, append]
+ }%
+ \map[overwrite]{%
+ \step[fieldsource=entrykey,match=\regexp{^#1$},final]
+ \step[fieldset=claves_definition, origfieldval]
+ }%
+ }%
+ }%
+}
+
+% 2. Format
+\newcommand{\multiclavesseparator}{\addsemicolon\ifpunct{\addspace}{}}
+\newcommand{\clavisseparator}{\addspace}
+\DeclareFieldFormat{claves}{\mkbibparens{#1}}
+\DeclareFieldFormat{claves_definition}{\clavisformat{#1}}
+\newcommand{\clavisformat}[1]{#1}
+
+% 3. Patching macro standard to add claves
+
+\newcommand{\@biblatex@claves@bibmacronotpatched}[1]{%
+ \PackageError{biblatex-claves}{Fail when patching `#1' bibmacro}%
+}%
+
+\xpatchbibmacro{title}
+ {\newunit}
+ {\usebibmacro{claves}}
+ {}
+ {\@biblatex@claves@bibmacronotpatched{title}}
+
+\newbibmacro{claves}{%
+ \iffieldundef{claves}%
+ {}%
+ {
+ \nopunct%
+ \setunit{\addspace}%
+ \printfield{claves}
+ }%
+ \newunit%
+}
+
+%4. List of claves
+
+\newcommand{\citeallclaves}{\nocite{\biblatex@claves}}
+
+\newcommand{\@biblatex@claves@bibdrivernotpatched}[1]{%
+ \PackageError{biblatex-claves}{Fail when patching `#1' bibdriver}%
+}%
+
+\newcommand{\clavesadddashinset}{%
+ \xpatchbibdriver{set}
+ {\booltrue{bbx@inset}}
+ {}%
+ {}%
+ {\@biblatex@claves@bibdrivernotpatched{claves}}%
+}
+\defbibenvironment{claves}%Inspired from shorthand environment
+ {\list
+ {\printtext[claves_definition]{\printfield[labelwidth]{entrykey}}}
+ {\setlength{\labelwidth}{\shorthandwidth}%
+ \setlength{\leftmargin}{\labelwidth}%
+ \setlength{\labelsep}{\biblabelsep}%
+ \addtolength{\leftmargin}{\labelsep}%
+ \setlength{\itemsep}{\bibitemsep}%
+ \setlength{\parsep}{\bibparsep}%
+ \renewcommand*{\makelabel}[1]{##1\hss}%
+ \renewcommand{\entrysetpunct}{\endgraf}%Break between set of an enty
+ \clavesadddashinset%Add the dash inside set (modify default style)
+ }%
+ }
+ {\endlist}
+ {\item}
+
+\DeclareSortingScheme{claves}{
+ \sort{
+ \field{entrykey}
+ }
+}
+
+
+%5. Inheritance
+ \DeclareDataInheritance{*}{*}{%
+ \noinherit{claves_definition}%
+ }%
+
+ \DeclareDataInheritance{*}{inbook}{%
+ \noinherit{claves}%
+ }%
+
+\endinput
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/claves.dbx b/macros/latex/contrib/biblatex-contrib/biblatex-claves/claves.dbx
new file mode 100644
index 0000000000..d07384f0a4
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/claves.dbx
@@ -0,0 +1,22 @@
+%% Copyright 2016-… 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 claves.dbx, claves.bbx
+\ProvidesFile{claves.dbx}
+[2017/04/09 v1.2.0 biblatex bibliography style (MR)]
+\DeclareDatamodelFields[type=field,datatype=literal]{%
+ claves,%
+ claves_definition%
+}
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves-ref.bib b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves-ref.bib
new file mode 100644
index 0000000000..533e0ab987
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves-ref.bib
@@ -0,0 +1,33 @@
+@book{CANT,
+ Address = {Turnhout},
+ Author = {Maurice Geerard},
+ Date = {1992},
+ Publisher = {Brepols},
+ Series = {Corpus Christianorum},
+ Title = {Clavis Apocryphorum Novi Testamenti}}
+@mvbook{BHG_3,
+ Address = {Bruxelles},
+ Author = {François Halkin},
+ Date = {1957},
+ Edition = {3},
+ Number = {81},
+ Publisher = {{Société des Bollandistes}},
+ Series = {Subsidia Hagiographica},
+ Title = {Bibliotheca hagiographica graeca},
+ Volumes = {3}}
+@book{BHG_auctarium,
+ Address = {Bruxelles},
+ Author = {François Halkin},
+ Date = {1969},
+ Number = {47},
+ Publisher = {{Société des Bollandistes}},
+ Series = {Subsidia Hagiographica},
+ Title = {Auctarium bibliothecae hagiographicae graecae}}
+@book{BHG_novum_auctarium,
+ Address = {Bruxelles},
+ Author = {François Halkin},
+ Date = {1984},
+ Number = {65},
+ Publisher = {{Société des Bollandistes}},
+ Series = {Subsidia Hagiographica},
+ Title = {Novum auctarium bibliothecae hagiographicae graecae}}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.bib b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.bib
new file mode 100644
index 0000000000..4cee43a9be
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.bib
@@ -0,0 +1,16 @@
+@bookinbook{BHG225,
+ Bhg = {225},
+ Cant = {285},
+ Crossref = {AAA2.2},
+ Editor = {Maximilien Bonnet},
+ Pages = {292-302},
+ Title = {Acta Barnabae}
+}
+@book{AAA2.2,
+ Address = {Darmstadt},
+ Date = {1903},
+ Editor = {Maximilien Bonnet},
+ Location = {Leipzig},
+ Publisher = {Hermann Mendelssohn},
+ Title = {Acta Apostolorum Apocrypha},
+ Volume = {2.2}}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.pdf
new file mode 100644
index 0000000000..c308324f95
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.tex b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.tex
new file mode 100644
index 0000000000..63e2fda4af
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/biblatex-claves.tex
@@ -0,0 +1,211 @@
+\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}
+\setminted{breaklines}
+\hypersetup{citecolor=black}
+% Usefull commands
+\newcommand{\biblatex}{\emph{biblatex}\xspace}
+\newcommand{\claves}{\emph{claves}\xspace}
+\newcommand{\clavis}{\emph{clavis}\xspace}
+\pretocmd{\bibfield}{\sloppy}{}{}
+\pretocmd{\bibtype}{\sloppy}{}{}
+\newcommand{\namebibstyle}[1]{\texttt{#1}}
+% Meta-datas
+\titlepage{%
+ title={Manage \claves with \biblatex},
+ subtitle={New fields},
+ email={maieul <at> maieul <dot> net},
+ author={Maïeul Rouquette},
+ revision={1.2.0},
+ date={2017/04/09},
+ url={https://git.framasoft.org/maieul/biblatex-claves}}
+
+\usepackage[citestyle=verbose,bibstyle=claves]{biblatex}
+\bibliography{biblatex-claves.bib}
+\bibliography{biblatex-claves-ref.bib}
+\AddBiblatexClavis{BHG}
+\AddBiblatexClavis{CANT}
+\begin{document}
+
+\printtitlepage
+\tableofcontents
+
+
+\section{Aim of the package}
+
+When studying antic and medieval literature, we may find many different texts published with the same title, or, in contrary, the same text published with different titles.
+To avoid confusion, scholars have published \claves, which are books listing ancient texts, identifying them by an identifier --- a number or a string of text.
+For example, for early Christianity, we have the \citetitle{BHG_3} (BHG),\footcites{BHG_3}{BHG_auctarium}{BHG_novum_auctarium}, the \citetitle{CANT} (CANT),\footcite{CANT} and other \claves.
+
+It could be useful to print the identifier of a texts in one specific \clavis, or in many \claves.
+
+This package allows us to create new field for different \claves, and to present all these fields in a consistent way.
+
+Considering this example:
+\inputminted{tex}{biblatex-claves.bib}
+
+It will be typeset as:
+\begin{quotation}
+\cite{BHG225}
+\end{quotation}
+
+Here, we can see the \enquote{BHG} and \enquote{CANT} identifiers.
+
+\section{Use}
+
+\subsection{Requirement}
+
+The package requires \biblatex~3.5 or later.
+
+\subsection{Loading the package}
+
+As the package defines new fields, it must be loaded as a bibliography style:
+\begin{minted}{latex}
+\usepackage[bibstyle=claves,citestyle=<your-citestyle>]{biblatex}
+\end{minted}
+The \emph{verbose} bibliography style is automatically loaded.
+
+If you must load an other bibliography style, or if you need to load package which requires to be loaded as bibliography style, like \emph{biblatex-bookinother}, you must use the \emph{biblatex-multiple-dm} package.
+ For example:
+\begin{minted}{latex}
+\usepackage[tools={claves,bookinther},bibstyle=verbose]{biblatex-multiple-dm}
+\usepackage[bibstyle=multiple-dm,citestyle=<your-citestyle>]{biblatex}
+\end{minted}
+
+Read the \emph{biblatex-multiple-dm} handbook for more details.
+
+\subsection{Defining the \claves}
+
+You must define which \claves\ you want to use, using \cs{AddBiblatexClavis} \textbf{in your preamble}.
+This command takes on argument, which is the abbreviated form of the concerned \clavis.
+ For example, in this handbook, the preamble contains:
+\begin{minted}{latex}
+\AddBiblatexClavis{BHG}
+\AddBiblatexClavis{CANT}
+\end{minted}
+Note the following points:
+\begin{itemize}
+ \item The order of \cs{AddBiblatexClavis} determines in which order will be typeset the \claves\ in bibliographic entries.
+ \item The case of the argument will be used for typesetting the \claves in bibliographic entries.
+\end{itemize}
+
+After that, you just have to add the fields in the concerned entry of the \verb+.bib+ file.
+Notes that if you don't call the concerned \cs{AddBiblatexClavis}, the \clavis\ won't be typeset.
+ That allows you to decide, in the last time of your work, which \claves you will use.
+
+ \subsection{Customizing style}
+You can redefine:
+\begin{itemize}
+ \item The \cs{multiclavesseparator} macro, which defines which character will be typeset between the different \claves\ identifiers. By default, a semicolon.
+ \item The \cs{clavisseparator} macro, which defines which character will be typeset between the \clavis abbreviated form and the \clavis identifier. By default, just a space.
+ \item The \verb+claves+ fieldformat, which defines the way all the \claves and identifier will be typeset. By default, in brackets.
+ \item The \cs{clavisformat} macro, which defines the way individual clavis abbreviation will by typse. For example, if you want italic/emphaze, use:
+ \begin{minted}{latex}
+\renewcommand{\clavisformat}[1]{\emph{#1}}
+ \end{minted}
+ By default, between parenthesis.
+\end{itemize}
+Note that you must use the \biblatex\ punctuation macro.
+Here, the default definition:
+\begin{minted}{latex}
+\newcommand{\multiclavesseparator}{\addsemicolon\ifpunct{\addspace}{}}
+\newcommand{\clavisseparator}{\addspace}
+\DeclareFieldFormat{claves}{\mkbibparens{#1}}
+\end{minted}
+\subsection{Printing the list of \claves}
+
+You could want to print the list of the \claves used, with the bibliographic reference.
+ To do, you must define some entries in your \verb+.bib+ file corresponding to the \claves:
+\inputminted{tex}{biblatex-claves-ref.bib}
+
+As you can see, the \citetitle{BHG_3} claves is in reality composed by one book in three volumes and two supplements (\enquote{auctarium}).
+ We could define a \bibtype{set} entry directly in the \verb+.bib+ file.
+ However, it could happen that you need to cite each entry individually, and a global \bibtype{set} entry does not allow it.\footnote{Cf. \url{https://github. com/plk/biblatex/issues/470}.}
+
+ That's why the best way is to define locally entry set in a \verb+refsection+ environment.\footnote{Read the \biblatex\ handbook about this environment, which allow you to have a local bibliography.} Consequently, we provide a \cs{citeallclaves} macro, which automatically add a \cs{nocite} for all the \claves\ defined by the \cs{AddBiblatexClavis} macros in your preamble.
+
+ We also provide a \verb+claves+ sorting scheme, and a \verb+claves+ bibliographic environment. So to print the concerning \claves, while defining local \bibtype{set} entry, you must do something like this:
+\begin{minted}{latex}
+\begin{refsection}
+ \begin{refcontext}[sorting=claves]
+ \setlength{\shorthandwidth}{3em}
+ \defbibentryset{BHG}{BHG_3,BHG_auctarium,BHG_novum_auctarium}
+ \citeallclaves% Be careful on the order
+ \printbibliography[env=claves,title=List of \emph{claves}]
+ \end{refcontext}
+\end{refsection}
+\end{minted}
+
+That produces the following output:
+\begin{quotation}
+\begin{refsection}
+ \begin{refcontext}[sorting=claves]
+ \setlength{\shorthandwidth}{3em}
+ \defbibentryset{BHG}{BHG_3,BHG_auctarium,BHG_novum_auctarium}
+ \citeallclaves
+ \printbibliography[env=claves,title=List of \emph{claves}]
+ \end{refcontext}
+\end{refsection}
+\end{quotation}
+
+Note the following points:
+\begin{itemize}
+ \item The bibliographic keys are used as label. Consequently, be careful with case, as \emph{biber} is sensitive to it.
+ \item Many time, \claves have a shorter former too long for the default label size defined by \biblatex.
+ That why, in our example, we have redefined the \cs{shorthandwidth} length.
+ \item Contrary to the default style, all the entry of a \bibtype{set} are in there own paragraph, and we use dashes when citing many times the same author. If you want to define your own bibliographic environment devoted to the \claves, you can use the following lines insides:
+ \begin{minted}{latex}
+\renewcommand{\entrysetpunct}{\endgraf}
+\clavesadddashinset
+ \end{minted}
+\end{itemize}
+
+\section{Knowing if an entry is used as \emph{clavis}}
+
+You may want to know if an entry is a \emph{clavis}, that is its entrykey was added to \cs{AddBiblatexClavis}. To test it, you must use
+
+\begin{minted}{latex}
+\iffieldundef{claves_definition}%
+ {<If not a clavis>}%
+ {<If a clavis>}%
+\end{minted}
+
+\section{Notes about inheritance}
+
+The \bibfield{claves} field are not inherited from the main entry when a subentry is an \bibtype{inbook} entry.
+\section{Credits}
+
+This package was created for Maïeul Rouquette's phd dissertation\footnote{\url{http://apocryphes.hypothese.org}.} in 2016.
+It is licensed on the \emph{\LaTeX\ Project Public License}.\footnote{\url{http://latex-project.org/lppl/lppl-1-3c.html}.}.
+
+
+All issues can be submitted, in French or English, in the Framasoft issues page.\footnote{\url{https://git.framasoft.org/maieul/biblatex-claves/issues}.}
+
+
+\section{Change history}
+
+\begin{changelog}
+
+\begin{release}{1.2.0}{2017-04-09}
+\item Mark the entries used as \emph{claves} with \bibfield{claves\_definition} field.
+\item Add \cs{clavisformat} macro, for more customization.
+\end{release}
+
+\begin{release}{1.1.0}{2016-09-25}
+\item Prevent inheritance of the \bibfield{claves} field for \bibtype{inbook} entries.
+\end{release}
+
+\begin{release}{1.0.0}{2016-09-11}
+\item First public release.
+\end{release}
+
+\end{changelog}
+\end{document}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/latexmkrc b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/latexmkrc
new file mode 100644
index 0000000000..d6cfc714fa
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/latexmkrc
@@ -0,0 +1,2 @@
+$pdflatex = "xelatex --shell-escape %S";
+$pdf_mode = "1";
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/makefile b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/makefile
new file mode 100644
index 0000000000..7846df29ac
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/documentation/makefile
@@ -0,0 +1,2 @@
+all:
+ latexmk *tex
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-claves/makefile b/macros/latex/contrib/biblatex-contrib/biblatex-claves/makefile
new file mode 100644
index 0000000000..090d25ae3c
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-claves/makefile
@@ -0,0 +1,16 @@
+dist: all
+ rm -rf biblatex-claves
+ mkdir biblatex-claves
+ ln README *bbx *dbx *makefile biblatex-claves
+ mkdir biblatex-claves/documentation
+ ln documentation/*tex documentation/*bib documentation/*pdf documentation/makefile documentation/latexmkrc biblatex-claves/documentation
+ $(RM) ../biblatex-claves.zip
+ zip -r ../biblatex-claves.zip biblatex-claves
+
+
+clean:
+ $(MAKE) -C documentation clean
+ @$(RM) *.pdf *.toc *.aux *.out *.fdb_latexmk *.log *.bbl *.bcf *.blg *run.xml *.synctex.gz*
+
+all: documentation/biblatex-claves.tex
+ $(MAKE) -C documentation all