summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-shortfields
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-shortfields
Initial commit
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-shortfields')
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/README7
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/biblatex-shortfields.sty147
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields-example.pdfbin0 -> 27690 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields-example.tex18
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.bib111
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.pdfbin0 -> 51904 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.tex114
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/latexmkrc2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/makefile5
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-shortfields/makefile17
10 files changed, 421 insertions, 0 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/README b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/README
new file mode 100644
index 0000000000..65ac0a7efc
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/README
@@ -0,0 +1,7 @@
+biblatex-shortfields
+==================
+
+Use short version of fields (series, journal) when defined.
+
+Print a list of the short versions of the fields, mixing multiple fields type.
+For example, a liste mixing short version of series field and short version of journal field.
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/biblatex-shortfields.sty b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/biblatex-shortfields.sty
new file mode 100644
index 0000000000..ee8f6e8752
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/biblatex-shortfields.sty
@@ -0,0 +1,147 @@
+%% Copyright 2017-… 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
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{biblatex-shortfields}[2017/11/19 v1.0.1 Print unique list of short fields]
+\providecommand{\biblatex@claves}{}%
+% 1. Use short version of fields instead of long version
+\renewbibmacro*{series+number}{%
+ \iffieldundef{shortseries}{\printfield{series}}{\printfield{shortseries}}%
+ \setunit*{\addspace}%
+ \printfield{number}%
+ \newunit}
+
+\renewbibmacro*{journal}{%
+ \iffieldundef{shortjournal}{%
+ \iffieldundef{journaltitle}%
+ {}%
+ {\printtext[journaltitle]{%
+ \printfield[titlecase]{journaltitle}%
+ \setunit{\subtitlepunct}%
+ \printfield[titlecase]{journalsubtitle}}}%
+ }{%
+ \printtext[journaltitle]{\printfield[titlecase]{shortjournal}}%
+ }%
+}%
+
+
+% 2. Custom sorting scheme
+
+\ifdef{\DeclareSortingTemplate}%
+ {}%
+ {\let\DeclareSortingTemplate\DeclareSortingScheme}%
+
+\DeclareSortingTemplate{shortfields}{
+ \sort{
+ \field{claves_definition}
+ \field{shortjournal}
+ \field{shortseries}
+ }
+ \sort{
+ \field{series}
+ \field{journaltitle}
+ }
+}
+
+%3. Bibcheck
+
+\defbibcheck{shortfields}{%
+ %First, the entrytype NOT corresponding to claves
+ \iffieldundef{claves_definition}%
+ {% If not the corresponding to a claves
+ \ifboolexpr{%
+ (test{\iffieldundef{shortseries}} or test{\iffieldundef{series}})%
+ and%
+ (test {\iffieldundef{shortjournal}} or test {\iffieldundef{journaltitle}})%
+ }{%
+ \skipentry%
+ }{%
+ %For series
+ \ifboolexpr{%
+ test {\iffieldundef{series}}%
+ and%
+ test {\iffieldundef{shortseries}}%
+ }{}%
+ {%
+ \ifcsdef{\strfield{shortseries}=\strfield{series}}{%
+ \skipentry%
+ }{%
+ \savefieldcs{series}{\strfield{shortseries}=\strfield{series}}%
+ }%
+ }%
+ % For journal
+ \ifboolexpr{%
+ test {\iffieldundef{journaltitle}}%
+ and%
+ test {\iffieldundef{shortjournal}}%
+ }{}%
+ {%
+ \ifcsdef{\strfield{shortjournal}=\strfield{journaltitle}}{%
+ \skipentry%
+ }{%
+ \savefieldcs{journaltitle}{\strfield{shortjournal}=\strfield{journaltitle}}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+}%
+
+
+\newlength{\shortfieldswidth}
+\setlength{\shortfieldswidth}{4em}
+\defbibenvironment{shortfields}
+ {%
+ \let\old@blx@driver\blx@driver%
+ \ifdef{\clavesadddashinset}{%
+ \clavesadddashinset%Add the dash inside set (modify default style)
+ \renewcommand{\entrysetpunct}{\endgraf}%Break between set of an enty
+ }{}%
+ \renewcommand{\blx@driver}[1]{\blx@bbx@shortfields}%
+ \list{%
+ \iffieldundef{claves_definition}%
+ {%
+ \printfield{shortseries}%
+ \printfield[journaltitle]{shortjournal}%
+ }%
+ {\printfield[claves_definition]{entrykey}}%
+ }%
+ {%
+ \labelwidth\shortfieldswidth
+ \labelsep\biblabelsep
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \itemsep\bibitemsep
+ \parsep\bibparsep
+ \def\makelabel##1{##1\hss}}}
+ {\endlist}
+ {\item}
+
+\DeclareBibliographyDriver{shortfields}{%
+ \iffieldundef{claves_definition}%
+ {%
+ \printfield{series}%
+ \printfield{journaltitle}%
+ }%
+ {\let\blx@driver\old@blx@driver\blx@driver{\thefield{entrytype}}}%
+}
+
+% The use level command
+\newcommand{\printbibshortfields}[1][title=\biblistname]{%
+ \begin{refcontext}[sorting=shortfields]
+ \printbibliography[check=shortfields,env=shortfields,#1]%
+ \end{refcontext}
+}
+
+
+\endinput
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields-example.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields-example.pdf
new file mode 100644
index 0000000000..63bafa9862
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields-example.tex b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields-example.tex
new file mode 100644
index 0000000000..bf1b65bb99
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields-example.tex
@@ -0,0 +1,18 @@
+\documentclass{article}
+\usepackage{libertineotf}
+\usepackage{polyglossia}
+\usepackage{csquotes}
+\setmainlanguage{french}
+
+\usepackage[citestyle=verbose,bibstyle=claves]{biblatex}
+\AddBiblatexClavis{BHG}
+\AddBiblatexClavis{CPG}
+\usepackage{biblatex-shortfields}
+\addbibresource{biblatex-shortfields.bib}
+\begin{document}
+\nocite{*}
+\printbibshortfields
+\printbibliography
+
+
+\end{document}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.bib b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.bib
new file mode 100644
index 0000000000..800fe3c1a5
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.bib
@@ -0,0 +1,111 @@
+@article{Delehaye1907,
+ Author = {Hippolyte Delehaye},
+ Date = {1907},
+ Journaltitle = {Analecta Bollandiana},
+ Number = {26},
+ Shorttitle = {AB},
+ Pages = {161-301},
+ Title = {Saints de Chypre}
+}
+
+@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}}
+@set{BHG,
+ entryset={BHG_3,BHG_auctarium,BHG_novum_auctarium}
+}
+@mvbook{CPG,
+ Address = {Turnhout},
+ Author = {Maurice Geerard},
+ Date = {1974/2003},
+ Publisher = {Brepols},
+ Series = {Corpus Christianorum Series Graeca},
+ Shortseries = {CCSG},
+ Title = {Clavis Patrum Graecorum},
+ Volumes = {5}}
+@book{BHG410,
+ Author = {{Alexandre de Chypre}},
+ Bhg = {410},
+ Cpg = {7398},
+ Number = {87.3},
+ Pages = {4015-4076},
+ Pagination = {column},
+ Series = {Patrologia Graeca},
+ Shortseries = {PG},
+ Title = {De venerandae ac vivificae crucis inventione}}
+@book{CCSG16,
+ Editor = {Edmond Voordeckers and Franz Tinnefeld},
+ Number = {16},
+ Series = {Corpus Christianorum Series Graeca},
+ Shortseries = {CCSG},
+ Title = {Iohannis Cantacuzeni Refutationes duae Prochori Cydonii et Disputatio cum Paulo patriarcha latino epistulis septem tradita}
+}
+@mvbook{Malamut1988,
+ Address = {Paris},
+ Author = {Élisabeth Malamut},
+ Date = {1988},
+ Number = {8},
+ Publisher = {Publications de la Sorbonne},
+ Series = {Byzantina Sorbonensia},
+ Subtitle = {\textsc{viii}-\textsc{xii}\textsuperscript{e} siècles},
+ Title = {Les îles de l'Empire byzantin},
+ Volumes = {2}
+}
+@book{CCSA4,
+ Editor = {Louis Leloir},
+ Number = {4},
+ Series = {Corpus Christianorum Series Apocryphorum},
+ Shortseries = {CCSA},
+ Subtitle = {Traduction de l'édition arménienne de Venise},
+ Title = {Écrits apocryphes sur les apôtres},
+ Volume = {2}}
+@book{CCSG26,
+ Editor = {Van Deun, Peter and Jacques Noret},
+ Number = {26},
+ Series = {Corpus Christianorum Series Graeca},
+ Shortseries = {CCSG},
+ Title = {Hagiographica Cypria}}
+@article{VanDeun1990,
+ Author = {Van Deun, Peter},
+ Date = {1990},
+ Journaltitle = {Analecta Bollandiana},
+ Number = {108},
+ Pages = {323-335},
+ Shortjournal = {AB},
+ Subtitle = {Édition et traduction},
+ Title = {Un mémoire anonyme sur saint Barnabé (BHG 226e)}}
+@article{James1905,
+ Author = {Montague Rhodes James},
+ Date = {1905},
+ Journaltitle = {The Journal of Theological Studies},
+ Number = {24},
+ Pages = {549-556},
+ Shortjournal = {JThS},
+ Title = {The Acts of Titus and the Acts of Paul},
+ Volume = {6}
+}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.pdf
new file mode 100644
index 0000000000..7f51e47701
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.tex b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.tex
new file mode 100644
index 0000000000..adc30df126
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/biblatex-shortfields.tex
@@ -0,0 +1,114 @@
+\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}
+\usepackage{csquotes}
+
+\setminted{breaklines}
+\hypersetup{citecolor=black}
+% Usefull commands
+\newcommand{\biblatex}{biblatex\xspace}
+\pretocmd{\bibfield}{\sloppy}{}{}
+\pretocmd{\bibtype}{\sloppy}{}{}
+\newcommand{\namebibstyle}[1]{\texttt{#1}}
+% Meta-datas
+\titlepage{%
+ title={Biblatex-shortfields},
+ subtitle={Using short version of fields},
+ email={maieul <at> maieul <dot> net},
+ author={Maïeul Rouquette},
+ revision={1.0.1},
+ date={2017/11/19},
+ url={https://git.framasoft.org/maieul/biblatex-shortfields}}
+
+% biblatex
+
+
+\begin{document}
+
+\printtitlepage
+\tableofcontents
+
+
+\section{Aim of the package}
+
+The \biblatex\ package provide \bibfield{shortseries} and \bibfield{shortjournal} field, but default styles didn't use them.
+
+It also provides a mechanism to print the equivalence between short forms of fields and long fields (\cs{printbiblist}), but this mechanism does not allow to mix between different type of short fields, for example, between short forms of journal title and short forms of series title.\footnote{Cf.~\url{https://github.com/plk/biblatex/issues/317}.}
+
+This package provides solution to these two problems:
+\begin{itemize}
+ \item If a \bibfield{shortjournal} field is defined, it prints it instead of the \cs{journal} field.
+ \item If a \bibfield{shortseries} field is defined, it prints it instead of the \cs{series} field.
+ \item It provides a \cs{printbibshortfields} command to print a list of the sort forms of the fields.
+ \item This list also includes the \emph{claves} defined with the \emph{biblatex-claves} package \textbf{v.~1.2 or later}.
+\end{itemize}
+
+\section{Use}
+
+You must load the package after the \biblatex\ package.
+\begin{minted}{latex}
+\usepackage[…]{biblatex}
+\usepackage{biblatex-shortfields}
+\end{minted}
+
+You just need to put \cs{printbibshortfields} when you need to print the shortlist. The command take an optional argument, which could contain options in the optional argument of \cs{printbibliography}, except \opt{check} and \cs{env} options.
+
+For example, to change the title of this list, use:
+
+\begin{minted}{latex}
+\printbibshortfields[title=List of shorthands]
+\end{minted}
+
+The equivalence between short and long form of field are determined by the entries.
+For example, if you want to tell that \enquote{Corpus Christianorum Series Apocryphorum} is abbreviated \enquote{CCSA}, your entries in this series must contains the following fields:
+\begin{minted}{latex}
+@entrytype{key,
+ Fields …,
+ Series = {Corpus Christianorum Series Apocryphorum},
+ Shortseries = {CCSA}
+}
+\end{minted}
+
+The only exception is for \emph{claves}, which abbreviations are determined by the mechanism used in the \emph{biblatex-claves} package.
+
+
+See the \href{./example-biblatex-shortfields.tex}{example file}.
+
+\section{Customization}
+
+You can change the width devoted to the abbreviations by redefining the \cs{shortfieldswidth} length, using \cs{setlength}. Default value is 4~em.
+
+For more customization, contact us. If your need is generic, we will add it in the package.
+
+\section{Credits}
+
+
+
+This package was created for Maïeul Rouquette's for Hélène Wiener's needs.\footnote{\url{http://geekographie.maieul.net/144\#forum1736}.} The original idea of the code is explained in Maïeul Rouquette's website.\footnote{\url{http://geekographie.maieul.net/99}.}
+
+
+All issues can be submitted, in French or English, in the Framasoft's issues page\footnote{\url{https://git.framasoft.org/maieul/biblatex-shortfields/issues}.}.
+
+
+\section{Change history}
+
+
+\begin{changelog}
+
+\begin{release}{1.0.1}{2017-11-19}
+ \item Compatibility with \biblatex~3.8.
+\end{release}
+\begin{release}{1.0.0}{2017-04-02}
+ \item First public release.
+\end{release}
+
+\end{changelog}
+\end{document}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/latexmkrc b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/latexmkrc
new file mode 100644
index 0000000000..d6cfc714fa
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/latexmkrc
@@ -0,0 +1,2 @@
+$pdflatex = "xelatex --shell-escape %S";
+$pdf_mode = "1";
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/makefile b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/makefile
new file mode 100644
index 0000000000..831057ac16
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/documentation/makefile
@@ -0,0 +1,5 @@
+all: *tex *bib
+ latexmk biblatex-shortfields.tex
+ latexmk biblatex-shortfields-example.tex
+
+
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/makefile b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/makefile
new file mode 100644
index 0000000000..465cdd1a99
--- /dev/null
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-shortfields/makefile
@@ -0,0 +1,17 @@
+dist: all
+ rm -rf biblatex-shortfields
+ mkdir biblatex-shortfields
+ ln README.md biblatex-shortfields/README
+ ln makefile *sty biblatex-shortfields
+ mkdir biblatex-shortfields/documentation
+ ln documentation/*tex documentation/*bib documentation/*pdf documentation/latexmkrc documentation/makefile biblatex-shortfields/documentation
+ $(RM) ../biblatex-shortfields.zip
+ zip -r ../biblatex-shortfields.zip biblatex-shortfields
+
+
+clean:
+ $(MAKE) -C documentation clean
+ @$(RM) *.pdf *.toc *.aux *.out *.fdb_latexmk *.log *.bbl *.bcf *.blg *run.xml *.synctex.gz*
+
+all: documentation/biblatex-shortfields-example.tex documentation/biblatex-shortfields.tex documentation/biblatex-shortfields.bib documentation/latexmkrc
+ $(MAKE) -C documentation all