diff options
author | Karl Berry <karl@freefriends.org> | 2020-04-25 20:48:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-04-25 20:48:58 +0000 |
commit | 434c8d95fdef4e34e2211d798b0faef0a962fdea (patch) | |
tree | eb21c50790181a609a23080942499758478e1665 /Master/texmf-dist | |
parent | 1ef16d82e52f4296be46ce5bf5a74e213257b7e3 (diff) |
biblatex-software (25apr20)
git-svn-id: svn://tug.org/texlive/trunk@54875 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
19 files changed, 1499 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/biblatex-software/LICENSE b/Master/texmf-dist/doc/latex/biblatex-software/LICENSE new file mode 100644 index 00000000000..387307b03e9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/LICENSE @@ -0,0 +1,35 @@ +%% software extension for biblatex styles +%% Copyright 2020 Roberto Di Cosmo <roberto@dicosmo.org> +% +% 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 Roberto Di Cosmo. +% +% This work consists of the files: +% +% LICENSE +% Makefile +% README.md +% biblio.bib +% english-software.lbx +% french-software.lbx +% manual.bib +% mkbiblatexstubs.sh +% sample-use-sty.tex +% sample.tex +% software-biblatex.pdf (generated) +% software-biblatex.sty +% software-biblatex.tex +% software.bbx +% software.dbx +% stublist +% swentries.tex + diff --git a/Master/texmf-dist/doc/latex/biblatex-software/README.md b/Master/texmf-dist/doc/latex/biblatex-software/README.md new file mode 100644 index 00000000000..766e85a1259 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/README.md @@ -0,0 +1,68 @@ +# biblatex software style + +This directory contains the reference `biblatex` implementation of a +bibliography style extension that includes software-specific BibTeX entries. + +## Relevant files + +The key files are the following: + + - `software.bbx` for the bibliography style extension + - `software.dbx` for the data model extension to support the new entries + - `english-software.lbx` and `french-software.lbx` for the localization + - `software-biblatex.sty` the LaTeX package to include for using the style as an extension + +The distribution contains other material, for demonstration purposes, and for +more advanced use. + +## Documentation + +Full documentation of the style, with a description of the new entries and +fields and detailed examples, is in `software-biblatex.tex`; a compiled PDF +version is included as `software-biblatex.pdf` for ease of reference. + +We recall briefly here the two main approaches available for using this style extension. + +### Using the software biblatex style as an extension + +The simplest way to use this style is to follow the example given +in the file `sample-use-sty.tex` that shows how one can *extend* any +existing `biblatex` style by simply doing the following: + + - pass the `model=software` option to the `biblatex` package + - load the software biblatex style with `\usepackage{software-biblatex}` + - set software specific bibliography options using the macro `\ExecuteBibliographyOptions`; + the options with their default values are as in + `\ExecuteBibliographyOptions{halid=true,swhid=true,swlabels=true,vcs=true,license=true}` + +This approach is extremely simple: it only requires that you include the relevant files +mentioned above in the directory where your LaTeX file is located. + +### Generating biblatex styles that include the software entries + +It may be useful to generate a new biblatex style that includes support for the +software entries right away. + +A simple mechanism is provided for this use case: + + - add to the `stublist` file the names of all the existing styles one needs to extend + - run `make biblatex-styles` to produce new style files, with an added `+sw` suffix, + for each of the existing style + - install the newly generated files in the standard path where `biblatex` files are found + +The stock `stublist` file contains the names of all the standard `biblatex` +styles. If this approach is followed, then one can load directly the extended +file, and the software specific bibliography options become available when +loading the `biblatex` package directly. See the `sample.tex` file for a +concrete example. + +# License + +This material is subject to the LATEX Project Public License version 1.3 or (at +your option) any later version. + +# Contact author + +This style is maintained by Roberto Di Cosmo <roberto@dicosmo.org> + + diff --git a/Master/texmf-dist/doc/latex/biblatex-software/biblio.bib b/Master/texmf-dist/doc/latex/biblatex-software/biblio.bib new file mode 100644 index 00000000000..41f7c025329 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/biblio.bib @@ -0,0 +1,98 @@ +@softwareversion {delebecque:hal-02090402-condensed, + title = {Scilab}, + author = {Delebecque, Fran{\c c}ois and Gomez, Claude and Goursat, Maurice + and Nikoukhah, Ramine and Steer, Serge and Chancelier, Jean-Philippe}, + url = {https://www.scilab.org/}, + year = {1994}, + month = jan, + file = {https://hal.inria.fr/hal-02090402/file/scilab-1.1.tar.gz}, + institution = {Inria}, + license = {Scilab license}, + hal_id = {hal-02090402}, + hal_version = {v1}, + swhid = {swh:1:dir:1ba0b67b5d0c8f10961d878d91ae9d6e499d746a; + origin=https://hal.inria.fr/hal-02090402}, + version = {1.1}, + note = {First Scilab version. It was distributed by anonymous ftp.}, + repository= {https://github.com/scilab/scilab}, + abstract = {Software for Numerical Computation freely distributed.} +} +@software {delebecque:hal-02090402, + title = {Scilab}, + author = {Delebecque, Fran{\c c}ois and Gomez, Claude and Goursat, Maurice + and Nikoukhah, Ramine and Steer, Serge and Chancelier, Jean-Philippe}, + year = {1994}, + institution = {Inria}, + license = {Scilab license}, + hal_id = {hal-02090402}, + hal_version = {v1}, + url = {https://www.scilab.org/}, + abstract = {Software for Numerical Computation freely distributed.}, + repository= {https://github.com/scilab/scilab}, +} + +@softwareversion {delebecque:hal-02090402v1, + version = {1.1}, + year = {1994}, + month = jan, + file = {https://hal.inria.fr/hal-02090402/file/scilab-1.1.tar.gz}, + swhid = {swh:1:dir:1ba0b67b5d0c8f10961d878d91ae9d6e499d746a; + origin=https://hal.inria.fr/hal-02090402}, + note = {First Scilab version. It was distributed by anonymous ftp.}, + crossref = {delebecque:hal-02090402} +} + @software {cgal, + title = {The Computational Geometry Algorithms Library}, + author = {{The CGAL Project}}, + editor = {{CGAL Editorial Board}}, + year = 1996, + url = {https://cgal.org/} + } + + @softwareversion{cgal:5-0-2, + crossref = {cgal}, + version = {{5.0.2}}, + url = {https://docs.cgal.org/5.02}, + year = 2020, + swhid = {swh:1:rel:636541bbf6c77863908eae744610a3d91fa58855; + origin=https://github.com/CGAL/cgal/} + } + + @softwaremodule{cgal:lp-gi-20a, + crossref = {cgal:5-0-2}, + author = {Menelaos Karavelas}, + subtitle = {{2D} Voronoi Diagram Adaptor}, + license = {GPL}, + introducedin = {cgal:3-1}, + url = {https://doc.cgal.org/5.0.2/Manual/packages.html#PkgVoronoiDiagram2}, + } + @softwaremodule{cgal:lp-gi-20a-condensed, + title = {The Computational Geometry Algorithms Library}, + subtitle = {{2D} Voronoi Diagram Adaptor}, + author = {Menelaos Karavelas}, + editor = {{CGAL Editorial Board}}, + license = {GPL}, + version = {{5.0.2}}, + introducedin = {cgal:3-1}, + year = 2020, + swhid = {swh:1:rel:636541bbf6c77863908eae744610a3d91fa58855; + origin=https://github.com/CGAL/cgal/}, + url = {https://doc.cgal.org/5.0.2/Manual/packages.html#PkgVoronoiDiagram2}, + } +@software {parmap, + title = {The Parmap library}, + author = {Di Cosmo, Roberto and Marco Danelutto}, + year = {2020}, + version = {1.1.1}, + institution = {Inria}, + license = {LGPL-2.0}, + url = {https://rdicosmo.github.io/parmap/}, + repository= {https://github.com/rdicosmo/parmap}, +} + +@codefragment {simplemapper, + subtitle = {Core mapping routine}, + swhid = {swh:1:cnt:43a6b232768017b03da934ba22d9cc3f2726a6c5;lines=192-228; + origin=https://github.com/rdicosmo/parmap}, + crossref = {parmap} +} diff --git a/Master/texmf-dist/doc/latex/biblatex-software/history.tex b/Master/texmf-dist/doc/latex/biblatex-software/history.tex new file mode 100644 index 00000000000..e193b2d3197 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/history.tex @@ -0,0 +1,10 @@ +\begin{release}{bltx-v0.9}{2020-04-25} \item Preparing for public release: Licence, Readme, update documentation, handle suggestions from the Working Group \end{release} +\begin{release}{bltx-v0.8}{2020-04-09} \item Make the style usable as an extension, and keep possibility of generating extended styles \end{release} +\begin{release}{bltx-v0.7}{2020-04-09} \item Move to diff model approach to be more portable \end{release} +\begin{release}{bltx-v0.6}{2020-04-08} \item Standardise file names, make softwarebib.tex self contained, separate out sample.tex, update Makefile, use printdate macro \end{release} +\begin{release}{bltx-v0.5}{2020-04-08} \item Added standard list format for licenses \end{release} +\begin{release}{bltx-v0.4}{2020-04-07} \item Added repository and licence field \end{release} +\begin{release}{bltx-v0.3}{2020-04-05} \item Biblatex style with first complete example \end{release} +\begin{release}{bltx-v0.2}{2020-04-02} \item Biblatex style sent for review \end{release} +\begin{release}{bltx-v0.1}{2020-04-02} \item First version of the biblatex style \end{release} +\begin{release}{bltx-1.0}{2020-04-25} \item First public release \end{release} diff --git a/Master/texmf-dist/doc/latex/biblatex-software/manual.bib b/Master/texmf-dist/doc/latex/biblatex-software/manual.bib new file mode 100644 index 00000000000..44b37465340 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/manual.bib @@ -0,0 +1,79 @@ + +@manual {scilabdoc, + title = {The offical Scilab documentation}, + related = {delebecque:hal-02090402v1}, + relatedstring = "In the official distribution of " +} + +@Article{ swhcacm2018, + Author = {Abramatic, Jean-Fran\c{c}ois and Di Cosmo, Roberto and + Zacchiroli, Stefano}, + Title = {Building the Universal Archive of Source Code}, + Journal = {Commun. ACM}, + issue_date = {October 2018}, + Volume = {61}, + Number = {10}, + Month = sep, + Year = {2018}, + ISSN = {0001-0782}, + Pages = {29--31}, + numpages = {3}, + URL = {http://doi.acm.org/10.1145/3183558}, + DOI = {10.1145/3183558}, + acmid = {3183558}, + Publisher = {ACM}, + Address = {New York, NY, USA} +} + +@ARTICLE{2020GtCitation, + author={Pierre {Alliez} and Di Cosmo, Roberto and Benjamin {Guedj} and Alain {Girault} and Mohand-Said {Hacid} and Arnaud {Legrand} and Nicolas {Rougier}}, + journal={Computing in Science and Engineering}, + title={Attributing and Referencing (Research) Software: Best Practices and Outlook From Inria}, + year=2020, + volume=22, + number=1, + pages={39-52}, + abstract={Software is a fundamental pillar of modern scientific research, across all fields and disciplines. However, there is a lack of adequate means to cite and reference software due to the complexity of the problem in terms of authorship, roles, and credits. This complexity is further increased when it is considered over the lifetime of a software that can span up to several decades. Building upon the internal experience of Inria, the French research institute for digital sciences, we provide in this article a contribution to the ongoing efforts in order to develop proper guidelines and recommendations for software citation and reference. Namely, we recommend: first, a richer taxonomy for software contributions with a qualitative scale; second, to put humans at the heart of the evaluation; and third, to distinguish citation from reference.}, + keywords={Software packages;Complexity theory;Research and development;Libraries;Metadata;Best practices;Guidelines;Software citation;software reference;authorship;development process}, + doi={10.1109/MCSE.2019.2949413}, + ISSN={1558-366X}, + month={Jan}, + DMI-CATEGORY={jour}, + x-topic = "opensc", + note = {Available from \url{https://hal.archives-ouvertes.fr/hal-02135891}}, + urllocal = "http://www.dicosmo.org/Articles/2020-CiSE-AttributingReferencing.pdf" +} + +@Article{ cise-2020-doi, + Author = {Di Cosmo, Roberto and Gruenpeter, Morane and Stefano Zacchiroli}, + Title = {Referencing Source Code Artifacts: a Separate Concern in Software Citation}, + Abstract = {Among the entities involved in software citation, software + source code requires special attention, due to the role it + plays in ensuring scientific reproducibility. To reference + source code we need identifiers that are not only unique + and persistent, but also support integrity checking + intrinsically. Suitable iden- tifiers must guarantee that + denoted objects will always stay the same, without relying + on external third parties and administrative processes. We + analyze the role of identifiers for digital objects (IDOs), + whose properties are different from, and complementary to, + those of the various digital identifiers of objects (DIOs) + that are today popular building blocks of software and data + citation toolchains. We argue that both kinds of + identifiers are needed and detail the syntax, semantics, + and practical implementation of the persistent identifiers + (PIDs) adopted by the Software Heritage project to + reference billions of software source code artifacts such + as source code files, directories, and commits.}, + Publisher = {IEEE}, + Year = {2020}, + ISSN = {1521-9615}, + volume = 22, + number = 2, + pages = {33-43}, + DMI-CATEGORY={jour}, + x-topic = "opensc", + doi = {10.1109/MCSE.2019.2963148}, + urllocal = "http://www.dicosmo.org/Articles/2020-CiSE-swhid.pdf", + Journal = {Computing in Science and Engineering} +} diff --git a/Master/texmf-dist/doc/latex/biblatex-software/mkbiblatexstubs.sh b/Master/texmf-dist/doc/latex/biblatex-software/mkbiblatexstubs.sh new file mode 100755 index 00000000000..cb02d549b72 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/mkbiblatexstubs.sh @@ -0,0 +1,23 @@ +#!/bin/bash +while read NAME +do +# bbx +cat <<EOF > $NAME+sw.bbx +\ProvidesFile{$NAME+sw.bbx}[2020/04/02 $NAME style with software, Roberto Di Cosmo] +\RequireBibliographyStyle{$NAME} +\blx@inputonce{software.bbx}{biblatex style for software}{}{}{}{} +\endinput +EOF +# dbx +cat <<EOF > $NAME+sw.dbx +\ProvidesFile{$NAME+sw.dbx}[2020/04/02 biblatex-software data model, Roberto Di Cosmo] +\blx@inputonce{software.dbx}{biblatex data model extension for software}{}{}{}{} +\endinput +EOF +# cbx +cat <<EOF > $NAME+sw.cbx +\ProvidesFile{$NAME+sw.bbx}[2020/04/02 $NAME citation style with software, Roberto Di Cosmo] +\RequireCitationStyle{$NAME} +\endinput +EOF +done< stublist diff --git a/Master/texmf-dist/doc/latex/biblatex-software/sample-use-sty.pdf b/Master/texmf-dist/doc/latex/biblatex-software/sample-use-sty.pdf Binary files differnew file mode 100644 index 00000000000..31ee8ffde3b --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/sample-use-sty.pdf diff --git a/Master/texmf-dist/doc/latex/biblatex-software/sample-use-sty.tex b/Master/texmf-dist/doc/latex/biblatex-software/sample-use-sty.tex new file mode 100644 index 00000000000..93c502933b9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/sample-use-sty.tex @@ -0,0 +1,86 @@ +\documentclass[10pt]{article} +\usepackage{a4wide} +\usepackage{hyperref} +\usepackage[ + style=numeric, + datamodel=software, % extend the datamodel with entries for software + abbreviate=false, + natbib=true, + sorting=ydnt, + backend=biber, + bibencoding=utf8, + giveninits=true, + url=false, + doi=false, + defernumbers, + maxcitenames=10, + defernumbers=true, + maxbibnames=100]{biblatex} +% +% load the software biblatex style +% +\usepackage{software-biblatex} +% +% set software specific bibliography options +% +\ExecuteBibliographyOptions{ + halid=true, + swhid=true, + swlabels=true, + vcs=true, + license=false} +% +% Make title an hyperlink to the DOI or URL to make the result leaner (suggested by N. Rougier 4/4/2020) +% + +\newcommand{\doiorurl}{% + \iffieldundef{doi} + {\iffieldundef{url} + {} + {\strfield{url}}} + {http://dx.doi.org/\strfield{doi}}% +} +\newcommand{\myhref}[1]{% + \ifboolexpr{% + test {\ifhyperref} + and + not test {\iftoggle{bbx:url}} + and + not test {\iftoggle{bbx:doi}} + } + {\href{\doiorurl}{#1}} + {#1}% +} +\DeclareFieldFormat{title}{\myhref{\mkbibemph{#1}}} +\DeclareFieldFormat + [article,inbook,incollection,inproceedings,patent,thesis,unpublished] + {title}{\myhref{\mkbibquote{#1\isdot}}} + + +\addbibresource{biblio.bib} +\addbibresource{manual.bib} +\author{Inria Software Citation Working Group} +\date{\today} +\title{Test document for software entries} +\begin{document} + +\maketitle + +This is how the proposed entries are rendered with the standard BibLaTeX style +extended with the \texttt{software} module. + +\begin{itemize} +\item software entry CGAL \cite{cgal} and Scilab \cite{delebecque:hal-02090402} +\item softwareversion entry CGAL 5.0.2 \cite{cgal:5-0-2} +\item softwareversion Scilab 1.1.1 : from the chain of crossrefs \cite{delebecque:hal-02090402v1}, and from the condensed bibtem \cite{delebecque:hal-02090402-condensed} (they should be identical) +\item softwaremodule entry Voronoi: from the chain of crossrefs \cite{cgal:lp-gi-20a}, and the from the condensed bibtem \cite{cgal:lp-gi-20a-condensed} (they should be identical) +\item software entry Parmap \cite{parmap} +\item codefragment entry simplemapper \cite{simplemapper} +\item documentation in a software entry \cite{scilabdoc} +\end{itemize} + +\printbibheading +\printbibliography[heading=subbibliography,type=software,title={Software Projects}] +\printbibliography[heading=subbibliography,nottype=software,title={Software versions, modules, excerpts and manuals}] + +\end{document} diff --git a/Master/texmf-dist/doc/latex/biblatex-software/sample.tex b/Master/texmf-dist/doc/latex/biblatex-software/sample.tex new file mode 100644 index 00000000000..bb4ba7fdfb8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/sample.tex @@ -0,0 +1,78 @@ +\documentclass[10pt]{article} +\usepackage{a4wide} +\usepackage{hyperref} +\usepackage[ + style=numeric+sw, % numeric bibliography style with software + halid=true, % toggle typesetting of halid + swhid=true, % toggle typesetting of swhid + vcs=true, % toggle typesetting of repository + license=true, % toggle typesetting of software licenses + swlabels=true, % toggle typesetting of software type labels in the bibliography + abbreviate=false, + natbib=true, + sorting=ydnt, + backend=biber, + bibencoding=utf8, + giveninits=true, + url=false, + doi=false, + defernumbers, + maxcitenames=10, + defernumbers=true, + maxbibnames=100]{biblatex} + +% +% Make title an hyperlink to the DOI or URL to make the result leaner (suggested by N. Rougier 4/4/2020) +% + +\newcommand{\doiorurl}{% + \iffieldundef{doi} + {\iffieldundef{url} + {} + {\strfield{url}}} + {http://dx.doi.org/\strfield{doi}}% +} +\newcommand{\myhref}[1]{% + \ifboolexpr{% + test {\ifhyperref} + and + not test {\iftoggle{bbx:url}} + and + not test {\iftoggle{bbx:doi}} + } + {\href{\doiorurl}{#1}} + {#1}% +} +\DeclareFieldFormat{title}{\myhref{\mkbibemph{#1}}} +\DeclareFieldFormat + [article,inbook,incollection,inproceedings,patent,thesis,unpublished] + {title}{\myhref{\mkbibquote{#1\isdot}}} + + +\addbibresource{biblio.bib} +\addbibresource{manual.bib} +\author{Inria Software Citation Working Group} +\date{\today} +\title{Test document for software entries} +\begin{document} + +\maketitle + +This is how the proposed entries are rendered with the standard BibLaTeX style +extended with the \texttt{software} module. + +\begin{itemize} +\item software entry CGAL \cite{cgal} and Scilab \cite{delebecque:hal-02090402} +\item softwareversion entry CGAL 5.0.2 \cite{cgal:5-0-2} +\item softwareversion Scilab 1.1.1 : from the chain of crossrefs \cite{delebecque:hal-02090402v1}, and from the condensed bibtem \cite{delebecque:hal-02090402-condensed} (they should be identical) +\item softwaremodule entry Voronoi: from the chain of crossrefs \cite{cgal:lp-gi-20a}, and the from the condensed bibtem \cite{cgal:lp-gi-20a-condensed} (they should be identical) +\item software entry Parmap \cite{parmap} +\item codefragment entry simplemapper \cite{simplemapper} +\item documentation in a software entry \cite{scilabdoc} +\end{itemize} + +\printbibheading +\printbibliography[heading=subbibliography,type=software,title={Software Projects}] +\printbibliography[heading=subbibliography,nottype=software,title={Software versions, modules, excerpts and manuals}] + +\end{document} diff --git a/Master/texmf-dist/doc/latex/biblatex-software/software-biblatex.pdf b/Master/texmf-dist/doc/latex/biblatex-software/software-biblatex.pdf Binary files differnew file mode 100644 index 00000000000..d445d6ed783 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/software-biblatex.pdf diff --git a/Master/texmf-dist/doc/latex/biblatex-software/software-biblatex.tex b/Master/texmf-dist/doc/latex/biblatex-software/software-biblatex.tex new file mode 100644 index 00000000000..71aeac13506 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/software-biblatex.tex @@ -0,0 +1,241 @@ +\documentclass{ltxdockit} +\usepackage{a4wide} +\usepackage{hyperref} +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage{alltt} +\usepackage{listings} +\usepackage{shortvrb} +\MakeShortVerb{\|} + +\titlepage{% + title={Bib\LaTeX\ style extension for Software}, + subtitle={Citation and References macros for Bib\LaTeX}, + url={http://mirror.ctan.org/macros/latex/exptl/biblatex-contrib/biblatex-software/}, + author={Roberto Di Cosmo}, + email={roberto@dicosmo.org}, + revision={1.0}, + date={\today}} + +\hypersetup{% + pdftitle={Bib\LaTeX\ style extension for Software}, + pdfsubject={Style for Bib\LaTeX}, + pdfauthor={Roberto Di Cosmo}, + pdfkeywords={latex, biblatex, software, style}} + +\begin{document} + +\printtitlepage +\tableofcontents + +\section{Introduction}\label{sec:intro} + +\subsection{About} + +Software plays a significant role in modern research, and it must be properly +acknowledged and referenced in scholarly works. To this end, specific +bibliographic entries for describing \emph{software}, \emph{software versions}, +\emph{software modules} and \emph{code fragments} have been designed by a +dedicated task force at Inria in 2020 that brought together researchers from +Computer Science and Applied Mathematics to discuss best practices for archiving +and referencing software source code~\cite{2020GtCitation}.\\ + +This package is a Bib\LaTeX\ \emph{style extension} that adds support for these +four \emph{software entry types} to any other Bib\LaTeX\ style used in documents +typeset in \latex. It is made up of the following key components: a references +section style (\path{software.bbx}), a data model extension +(\path{software.dbx}) and string localisation files +(\path{<language>-software.lbx})\footnote{String localisations are provided for + some languages: localisations for other languages are welcome, feel free to + contribute them on the official repository, see Section \emph{Contributing} below.}.\\ + +The distribution contains other material, for demonstration purposes, and for +more advanced use. + +\subsection{License} + +Permission is granted to copy, distribute and/or modify this software under +the terms of the \latex Project Public License, version +1.3c\footnote{\url{http://www.latex-project.org/lppl.txt}}. The current +maintainer is Roberto Di Cosmo (\textcopyright\ 2020). + +\subsection{History} + +When I decided to start the Software Heritage initiative in 2015, software in +general and research software in particular was not yet a first class citizen in +the scholarly world. The absence of support for properly citing software in a +bibliography was just one of the many signs of this lack of recognition. + +In order to properly reference a software project, and ensure that these +references are stable enough to pass the test of time, it was necessary to build +a \emph{universal archive} for software source code, and to equip every software +artifact with \emph{intrinsic} identifiers. + +Now that \href{https://www.softwareheritage.org}{Software Heritage} is providing +the universal archive~\cite{swhcacm2018}, with Software Heritage \emph{intrinsic + identifiers} (SWH-IDs) widely available~\cite{cise-2020-doi}, it is finally +possible to propose proper bibliographic entries for software, at various levels +of granularity, down to the line of code. + +\subsection{Acknowledgments} + +Thanks to the Inria working group members for their precious feedback and +contribution to the desing of the software bibliography entries: Pierre Alliez, +Benjamin Guedj, Alain Girault, Morane Gruenpeter, Mohand-Said Hacid, Arnaud +Legrand, Xavier Leroy, Nicolas Rougier and Manuel Serrano. + +\section{Software entries} +\input{swentries} + +\section{Use}\label{ref:use} +\label{use} + +This package can be used as a standalone on the fly extension, or to produce +full bibliographic styles that extend pre-existing styles. + +\subsection{Use as an \emph{on the fly} extension} + +The simplest way to use this package is to follow the example given in the +\path{sample-use-sty.tex} that shows how one can \emph{extend on the fly} any +existing Bib\LaTeX\ style by just doing the following: + +\begin{itemize} +\item pass the \texttt{datamodel=software} option to the \texttt{biblatex} package as in + \begin{ltxcode} + \usepackage[datamodel=software]{biblatex} + \end{ltxcode} + \item load the software biblatex style using + \begin{ltxcode} + \usepackage{software-biblatex} + \end{ltxcode} + \item set software specific bibliography options using the macro |\ExecuteBibliographyOptions|; + the options with their default values are as in + \begin{ltxcode} + \ExecuteBibliographyOptions{ + halid=true, + swhid=true, + swlabels=true, + vcs=true, + license=true} + \end{ltxcode} +\end{itemize} + +This is quite handy to add support for software entries in a single article, as +it is enough to add \path{software.dbx}, \path{software.bbx}, +\path{<language>-software.lbx} and \path{software-biblatex.sty} to make it work. + +\subsection{Generate extended styles} + +When a more systematic use is foreseen, as for institution-wide reports, or +conference and journal proceedings, it is more appropriate to generate a new +biblatex style that includes support for the software entries right away. + +The following simple mechanism is provided for this use case: + +\begin{itemize} +\item add to the \path{stublist} file the names of all the existing styles that must be extended +\item run \texttt{make biblatex-styles} to produce new style files, with an added \texttt{+sw} suffix, + for each of the existing style +\item install the newly generated files in the standard path where Bib\LaTeX\ files are found +\end{itemize} + +The stock \path{stublist} file contains the names of all the standard Bib\LaTeX\ +styles. If this approach is followed, then one can load directly the extended +file, and the software specific bibliography options become available when +loading the Bib\LaTeX\ package directly. See the \path{sample.tex} file for a +working example. + +\subsection{Installation}\label{sec:install} + +This package may become available in standard distributions like \TeX Live as +|biblatex-software|. To install manually, you can download it from CTAN and +then, put the relevant files in your texmf tree, usually:\\ + +\noindent\path{<texmf>/tex/latex/biblatex-software/software-biblatex.sty}\\ +\path{<texmf>/tex/latex/biblatex-software/software.bbx}\\ +\path{<texmf>/tex/latex/biblatex-software/software.dbx}\\ +\path{<texmf>/tex/latex/biblatex-software/<language>-software.lbx}\\ + + +\subsection{Package options}\label{sec:options} + +The following options are available to control the typesetting of +software related entries. + +\begin{ltxcode} + swlabels=true|false +\end{ltxcode} + +\noindent Software is a special research output, distinct from +publications, hence software entries in a bibliography are +distinguished by a special label by default. +This behaviour can be disabled by setting this option to |false|. + +\begin{ltxcode} + license=true|false +\end{ltxcode} + +\noindent This option controls whether license information for +the software entry is typeset. The default is |true|. + +\begin{ltxcode} + halid=true|false +\end{ltxcode} + +\noindent This option controls the inclusion of the identifier on the HAL repository of the +metadata record for the software described in the entry. The default is |true|. + +\begin{ltxcode} + swhid=true|false +\end{ltxcode} + +\noindent This option controls the inclusion of the identifier on the Software Heritage archive +of the source code of the software described in the entry. The default is |true|. + +\begin{ltxcode} + vcs=true|false +\end{ltxcode} + +\noindent This option controls the inclusion of the url of the code hosting +platform where the software described in the enttry is developed. The default is |true|. + +\section{Details} + +The detailed information for this style is contained in the example document and +accompanying \path{.bib} files: +\begin{description} +\item[\path{software-biblatex.tex}] This document. +\item[\path{biblio.bib}] An example bibliography showcasing all the software entries. +\item[\path{sample-use-sty.tex}]\footnote{\path{sample-use-sty.pdf} is also + provided and is the typeset version of this \latex source file.} This document + exerces most useful feature of this style extension, using the + \path{biblio.bib} entries. +\item[\path{sample.tex}] This document produces the same output as + \path{sample-use-sty.tex}, but instead of extending on the fly and existing + style, it assumes that an extended bibliographic style \texttt{numeric+sw} has + been created starting from the standard \texttt{numeric} style. +\item[\path{software.bbx}] The |biblatex-software| references style. +\item[\path{software.dbx}] The |biblatex-software| data model additions. +\item[\path{*.lbx}] The |biblatex-software| localisation files. +\item[\path{software-biblatex.sty}] The |software-biblatex| \LaTeX\ package for extending on the fly any preloaded Bib \LaTeX\ style. +\end{description} + +\section{Contributing} + +This style extension is currently developed on a git-based repository at +\url{https://gitlab.inria.fr/gt-sw-citation/bibtex-sw-entry/}. +Contributions and bug reports are very welcome. In particular, translation +of the localization strings for other languages are needed. + +\section{Revision history}\label{rev} + +\begin{changelog} + +\input{history} + +\end{changelog} + +\bibliography{manual} +\bibliographystyle{abbrv} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/biblatex-software/stublist b/Master/texmf-dist/doc/latex/biblatex-software/stublist new file mode 100644 index 00000000000..72463d9e800 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/stublist @@ -0,0 +1,27 @@ +alphabetic +alphabetic-verb +authortitle +authortitle-comp +authortitle-ibid +authortitle-icomp +authortitle-tcomp +authortitle-terse +authortitle-ticomp +authoryear +authoryear-comp +authoryear-ibid +authoryear-icomp +debug +draft +numeric +numeric-comp +numeric-verb +reading +standard +verbose +verbose-ibid +verbose-inote +verbose-note +verbose-trad1 +verbose-trad2 +verbose-trad3 diff --git a/Master/texmf-dist/doc/latex/biblatex-software/swentries.tex b/Master/texmf-dist/doc/latex/biblatex-software/swentries.tex new file mode 100644 index 00000000000..14199707002 --- /dev/null +++ b/Master/texmf-dist/doc/latex/biblatex-software/swentries.tex @@ -0,0 +1,248 @@ + +There are four entry types, corresponding to different granularities +in the identification of the (part of) software artifacts that one +whishes to cite. They are listed below in order of granularity. + +\subsection{software} +Computer software. + +\emph{Required fields:} \texttt{author} / \texttt{editor}, \texttt{title}, \texttt{url}, \texttt{year} + +\emph{Optional fields:} \texttt{abstract}, \texttt{date}, \texttt{doi}, \texttt{file}, \texttt{hal\_id}, \texttt{hal\_version}, +\texttt{institution}, \texttt{license}, \texttt{month}, \texttt{note}, \texttt{organization}, \texttt{publisher}, +\texttt{related}, \texttt{relatedtype}, \texttt{relatedstring}, \texttt{repository}, \texttt{swhid}, \texttt{urldate}, \texttt{version} + +\subsection{softwareversion} +A specific version of a software. Inherits values of missing +fields from the entry mentioned in the \texttt{crossref} field. + +\emph{Required fields:} \texttt{author} / \texttt{editor}, \texttt{title}, \texttt{url}, \texttt{version}, \texttt{year} + +\emph{Optional fields:} \texttt{abstract}, \texttt{crossref}, \texttt{date}, \texttt{doi}, \texttt{file}, \texttt{hal\_id}, \texttt{hal\_version}, +\texttt{institution}, \texttt{introducedin}, \texttt{license}, \texttt{month}, \texttt{note}, \texttt{organization}, \texttt{publisher}, +\texttt{related}, \texttt{relatedtype}, \texttt{relatedstring}, \texttt{repository}, \texttt{swhid}, \texttt{subtitle}, \texttt{urldate} + +\subsection{softwaremodule} + +A specific module of a larger software project. Inherits values of missing +fields from the entry mentioned in the \texttt{crossref} field. + +\emph{Required fields:} \texttt{author}, \texttt{subtitle}, \texttt{url}, \texttt{year} + +\emph{Optional fields:} \texttt{abstract}, \texttt{crossref}, \texttt{date}, \texttt{doi}, \texttt{editor}, \texttt{file}, \texttt{hal\_id}, \texttt{hal\_version}, +\texttt{institution}, \texttt{introducedin}, \texttt{license}, \texttt{month}, \texttt{note}, \texttt{organization}, \texttt{publisher}, +\texttt{related}, \texttt{relatedtype}, \texttt{relatedstring}, \texttt{repository}, \texttt{swhid}, \texttt{title}, \texttt{urldate}, \texttt{version} + +\subsection{codefragment} + +A code fragment (e.g. a specific algorithm in a program or library). +Inherits values of missing fields from the entry mentioned in the \texttt{crossref} field. + +\emph{Required fields:} \texttt{url} + +\emph{Optional fields:} \texttt{author}, \texttt{abstract}, \texttt{crossref}, \texttt{date}, \texttt{doi}, \texttt{file}, \texttt{hal\_id}, \texttt{hal\_version}, +\texttt{institution}, \texttt{introducedin}, \texttt{license}, \texttt{month}, \texttt{note}, \texttt{organization}, \texttt{publisher}, +\texttt{related}, \texttt{relatedtype}, \texttt{relatedstring}, \texttt{repository}, \texttt{swhid}, \texttt{subtitle}, \texttt{title}, \texttt{urldate}, \texttt{version}, \texttt{year} + +The \textbf{softwareversion}, \textbf{softwaremodule} and \textbf{codefragment} entries can inherit +the missing fields from another entry designated by the \emph{crossref} field, which +is expected to be higher in the granularity hierarchy: \textbf{softwareversion} may +inherit from a \textbf{software} entry, \textbf{softwaremodule} may inherit from a +\textbf{softwareversion} or a \textbf{software} entry, and \textbf{codefragment} may inherit from all +other entries. + +\section{Field description} +The field description is based on the \href{http://mirrors.ibiblio.org/CTAN/macros/latex/exptl/biblatex/doc/biblatex.pdf}{biblatex documentation} +\subsection{Data fields} +\begin{description} +\item[{abstract}] field (literal). This field is intended for recording +abstracts in a bib file, to be printed by a special bibliography +style. It is not used by all standard bibliography styles. +\item[{author}] list (name). The authors of the title. +\item[{date [biblatex only]}] field (date). The date of creation or release in ISO format. +\item[{editor}] list (name). The coordinator(s) of large modular software projects. +\item[{file}] field (verbatim). A link to download a copy of the work. +\item[{doi}] field (verbatim). The Digital Object Identifier of the work. +\item[{\texttt{hal\_id} [not in biblatex standard styles]}] field (verbatim). A digital identifier for the +software record including its description and metadata on HAL. +\item[{\texttt{hal\_version} [not in biblatex standard styles]}] field (verbatim). The version of the HAL software record designated by \texttt{hal\_id}. +\item[{license [not in biblatex standard styles]}] list (literal). The license/s of the title +in SPDX format. +\item[{month}] field (literal). The month of creation or release. +In BibLaTeX, this must be an integer, not an ordinal or a string. +For compatibility with BibTeX, one can also use the three letter +abbreviations \emph{jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec}, +which must be given without any braces or quotes. +\item[{note}] field (literal). Release note of the cited version. +\item[{institution}] field (literal). The institution(s) that took part in the +software project. +\item[{introducedin [not in biblatex standard styles]}] field (literal). If this is a software module or fragment, +the version of the containing project where it has been first introduced. +\item[{organization}] field (literal). The organization(s) that took part in the +software project. +\item[{publisher}] list (literal). The name(s) of the publisher(s) of the software +record (we need to define the notion of a research software publisher, see issue \href{https://gitlab.inria.fr/gt-sw-citation/bibtex-sw-entry/issues/2}{\#2}). +\item[{related [biblatex only]}] field (separated values). Citation keys of other entries which have a relationship to this entry. +\item[{relatedtype [biblatex only]}] field (identifier). +\item[{relatedstring [biblatex only]}] field (literal). +\item[{repository [not in biblatex standard styles]}] field (uri). The url of the code repository (e.g on GitHub, GitLab). +\item[{swhid [not in biblatex standard styles]}] field (verbatim). The identifier of the digital +object (a.k.a the software artifact itself). The intrinsic identifier +of the item is an swh-id (swh:cnt for a content, swh:dir for a directory, swh:rev for +a revision, swh:rel for a release, etc.). See \href{https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html}{the SWH-ID specification}. +\item[{subtitle}] field (literal). The title of a component of the software artifact. +\item[{title}] field (literal). The title of the software artifact. +\item[{url}] field (uri). The url of a reference resource (e.g the project's official webpage). +\item[{urldate}] field (date). The access date of the address specified in the url field. +\item[{version}] field (literal). The revision number of a piece of software, a manual, etc. +\item[{year}] field (literal). The year of creation or release. +\end{description} +\subsection{Special fields} +\begin{description} +\item[{crossref}] field (entry key). This field holds an entry key for the +cross-referencing feature. Child entries with a crossref field inherit data +from the parent entry specified in the crossref field. +\end{description} + +\section{Examples} + +Here are a few example of use of the proposed entries. + +\subsection{software and softwareversion} + +This is an example description of a software release using a single \texttt{@softwareversion} entry. + +\begin{verbatim} +@softwareversion {delebecque:hal-02090402-condensed, + title = {Scilab}, + author = {Delebecque, Fran{\c c}ois and Gomez, Claude and Goursat, Maurice + and Nikoukhah, Ramine and Steer, Serge and Chancelier, Jean-Philippe}, + url = {https://www.scilab.org/}, + year = {1994}, + month = jan, + file = {https://hal.inria.fr/hal-02090402/file/scilab-1.1.tar.gz}, + institution = {Inria}, + license = {Scilab license}, + hal_id = {hal-02090402}, + hal_version = {v1}, + swhid = {swh:1:dir:1ba0b67b5d0c8f10961d878d91ae9d6e499d746a; + origin=https://hal.inria.fr/hal-02090402}, + version = {1.1}, + note = {First Scilab version. It was distributed by anonymous ftp.}, + repository= {https://github.com/scilab/scilab}, + abstract = {Software for Numerical Computation freely distributed.} +} +\end{verbatim} + +The same information can also be represented using a \texttt{@software} / \texttt{@softwareversion} +pair that factors out the general information in the \texttt{@software} entry, so for +other versions only the changes need to be added in a new \texttt{@softwareversion} entry: + +\begin{verbatim} +@software {delebecque:hal-02090402, + title = {Scilab}, + author = {Delebecque, Fran{\c c}ois and Gomez, Claude and Goursat, Maurice + and Nikoukhah, Ramine and Steer, Serge and Chancelier, Jean-Philippe}, + year = {1994}, + institution = {Inria}, + license = {Scilab license}, + hal_id = {hal-02090402}, + hal_version = {v1}, + url = {https://www.scilab.org/}, + abstract = {Software for Numerical Computation freely distributed.}, + repository= {https://github.com/scilab/scilab}, +} + +@softwareversion {delebecque:hal-02090402v1, + version = {1.1}, + year = {1994}, + month = jan, + file = {https://hal.inria.fr/hal-02090402/file/scilab-1.1.tar.gz}, + swhid = {swh:1:dir:1ba0b67b5d0c8f10961d878d91ae9d6e499d746a; + origin=https://hal.inria.fr/hal-02090402}, + note = {First Scilab version. It was distributed by anonymous ftp.}, + crossref = {delebecque:hal-02090402} +} +\end{verbatim} + +\subsection{softwaremodule} + +For highly modular software projects, like CGAL, one may need to +reference specifically a particular module, that has distinguished +authors, and may heve been introduced in the project at a later time. + + +The following example uses \href{https://doc.cgal.org/latest/Manual/how\_to\_cite\_cgal.bib}{the informations in the existing BibTeX entries for CGAL} +that currently refer to the user manual, to create the corresponding software entries. + +\begin{verbatim} +@software {cgal, + title = {The Computational Geometry Algorithms Library}, + author = {{The CGAL Project}}, + editor = {{CGAL Editorial Board}}, + year = 1996, + url = {https://cgal.org/} +} + +@softwareversion{cgal:5-0-2, + crossref = {cgal}, + version = {{5.0.2}}, + url = {https://docs.cgal.org/5.02}, + year = 2020, + swhid = {swh:1:rel:636541bbf6c77863908eae744610a3d91fa58855; + origin=https://github.com/CGAL/cgal/} +} + +@softwaremodule{cgal:lp-gi-20a, + crossref = {cgal:5-0-2}, + author = {Menelaos Karavelas}, + subtitle = {{2D} Voronoi Diagram Adaptor}, + license = {GPL}, + introducedin = {cgal:3-1}, + url = {https://doc.cgal.org/5.0.2/Manual/packages.html#PkgVoronoiDiagram2}, +} +\end{verbatim} + +Of course, it is always be possible to use only one entry to get an equivalent +result; here one would use just \texttt{@softwaremodule} with all the needed data +fields as follows: + +\begin{verbatim} +@softwaremodule{cgal:lp-gi-20a-condensed, + title = {The Computational Geometry Algorithms Library}, + subtitle = {{2D} Voronoi Diagram Adaptor}, + author = {Menelaos Karavelas}, + editor = {{CGAL Editorial Board}}, + license = {GPL}, + version = {{5.0.2}}, + introducedin = {cgal:3-1}, + year = 2020, + swhid = {swh:1:rel:636541bbf6c77863908eae744610a3d91fa58855; + origin=https://github.com/CGAL/cgal/}, + url = {https://doc.cgal.org/5.0.2/Manual/packages.html#PkgVoronoiDiagram2}, +} +\end{verbatim} + +\subsection{codefragment} + +Finally, if one wants to have a particular code fragment appear in the bibliography, +we can do this as follows: +\begin{verbatim} +@software {parmap, + title = {The Parmap library}, + author = {Di Cosmo, Roberto and Marco Danelutto}, + year = {2020}, + version = {1.1.1}, + institution = {Inria}, + license = {LGPL-2.0}, + url = {https://rdicosmo.github.io/parmap/}, + repository= {https://github.com/rdicosmo/parmap}, +} + +@codefragment {simplemapper, + subtitle = {Core mapping routine}, + swhid = {swh:1:cnt:43a6b232768017b03da934ba22d9cc3f2726a6c5;lines=192-228; + origin=https://github.com/rdicosmo/parmap}, + crossref = {parmap} +} +\end{verbatim} diff --git a/Master/texmf-dist/source/latex/biblatex-software/Makefile b/Master/texmf-dist/source/latex/biblatex-software/Makefile new file mode 100644 index 00000000000..9db14d0e6df --- /dev/null +++ b/Master/texmf-dist/source/latex/biblatex-software/Makefile @@ -0,0 +1,46 @@ +TEXS = $(wildcard *.tex) +MAIN = sample-use-sty + +all: $(MAIN).pdf + +biblatex-styles: stublist mkbiblatexstubs.sh + bash mkbiblatexstubs.sh < stublist + +swentries.tex: ../swentry.org + ../bin/export-org-to-latex $< + ../bin/extract-entries.pl < ../swentry.tex > $@ + +software-biblatex.pdf: software-biblatex.tex swentries.tex history.tex + pdflatex software-biblatex.tex + bibtex software-biblatex + pdflatex software-biblatex.tex + pdflatex software-biblatex.tex + +history.tex: + git for-each-ref --format="\begin{release}{%(refname:short)}{%(taggerdate:short)} \item %(subject) \end{release}" refs/tags | grep bltx | tac > history.tex + +sample.tex : biblatex-styles + +%.pdf: %.tex +ifeq (, $(shell PATH=$(PATH) which rubber)) + echo "No rubber in $(PATH), falling back to basic pdflatex calls" + pdflatex $< + biber $* + pdflatex $< +else + rubber -m pdftex $< +endif + +distrib: + # update history + rm history.tex + make software-biblatex.pdf + tar --transform 's,^\(.\),biblatex-software/\1,' -czhvf biblatex-software.tar.gz `git ls-files` + +clean: $(patsubst %,%/clean,$(TEXS)) + rm -f *+sw.bbx *+sw.dbx *+sw.cbx *+sw.lbx *~ + +%/clean: + if [ -f $* ]; then rubber -m pdftex --clean $* ; fi + +distclean: clean diff --git a/Master/texmf-dist/tex/latex/biblatex-software/english-software.lbx b/Master/texmf-dist/tex/latex/biblatex-software/english-software.lbx new file mode 100644 index 00000000000..3d3220e3524 --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-software/english-software.lbx @@ -0,0 +1,15 @@ + \ProvidesFile{english-software.lbx}[2020/04/02 english with additions for software] + \InheritBibliographyExtras{english} + \InheritBibliographyStrings{english} + \NewBibliographyString{software,edited,swmodule,swpartof,swversion,swexcerpt,swexc,refart,manual} + \DeclareBibliographyStrings{% + software = {{\sc [Software]}{\sc [SW]}}, + swmodule = {{\sc [Software Module]}{\sc [SW Mod\adddot]}}, + swpartof = {{part of}}{{part of}}, + swversion = {{\sc [Software Release]}{\sc [SW Rel\adddot]}}, + swexcerpt = {{\sc [Software excerpt]}{\sc [SW exc\adddot]}}, + swexc = {{from}}{{from}}, + edited = {{Coordinated by}{Coord\adddot by}}, + refart = {{Described in}{Descr\adddot in}}, + manual = {{Manual: }{Manual:}} + } diff --git a/Master/texmf-dist/tex/latex/biblatex-software/french-software.lbx b/Master/texmf-dist/tex/latex/biblatex-software/french-software.lbx new file mode 100644 index 00000000000..5a77fd3deef --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-software/french-software.lbx @@ -0,0 +1,15 @@ + \ProvidesFile{french-software.lbx}[2020/04/02 french with additions for software] + \InheritBibliographyExtras{french} + \InheritBibliographyStrings{french} + \NewBibliographyString{software,edited,swmodule,swpartof,swversion,swexcerpt,swexc,refart,manual} + \DeclareBibliographyStrings{% + software = {{[Logiciel]}{[Log\adddot]}}, + swmodule = {{[Module logiciel]}{[Mod\adddot log\adddot]}}, + swpartof = {{partie de}}{{partie de}}, + swversion = {{[Version de logiciel]}{[Ver\adddot log\adddot]}}, + swexcerpt = {{[Fragment logiciel]}{[Frag\adddot log\adddot]}}, + swexc = {{dans}}{{dans}}, + edited = {{Coordonn\'e par}{Coord\adddot par}}, + refart = {{D\'ecrit en}{D\'ecrit en}}, + manual = {{Manuel: }{Manuel: }} + } diff --git a/Master/texmf-dist/tex/latex/biblatex-software/software-biblatex.sty b/Master/texmf-dist/tex/latex/biblatex-software/software-biblatex.sty new file mode 100644 index 00000000000..486b3760ce9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-software/software-biblatex.sty @@ -0,0 +1,15 @@ +% +% Reference implementation of a BibLaTeX style for the software family of bibliographic entries +% +% 2020/04/02 Roberto Di Cosmo <roberto@dicosmo.org> +% +% +% style file wrapper to software.bbx to make software entries available on the fly +% +% use after loading biblatex with the datamodel=software option +% - special toggles may be controlled with the directive \ExecuteBibliographyOptions +% that defaults to +% \ExecuteBibliographyOptions{halid=true,swhid=true,swlabels=true,vcs=true,license=true} +% +\ProvidesPackage{software-biblatex}[Software entries for biblatex] +\blx@inputonce{software.bbx}{biblatex style for software}{}{}{}{} diff --git a/Master/texmf-dist/tex/latex/biblatex-software/software.bbx b/Master/texmf-dist/tex/latex/biblatex-software/software.bbx new file mode 100644 index 00000000000..3b7f8d07360 --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-software/software.bbx @@ -0,0 +1,231 @@ +% +% Reference implementation of a BibLaTeX style for the software family of bibliographic entries +% +% 2020/04/02 Roberto Di Cosmo <roberto@dicosmo.org> +% +\RequireBiber[3] +\RequirePackage{xurl} +% +% Toggles for typesetting additional ids and printing labels +% +\newtoggle{bbx:halid} +\newtoggle{bbx:swhid} +\newtoggle{bbx:vcs} +\newtoggle{bbx:swlabels} +\newtoggle{bbx:license} + +\DeclareBibliographyOption[boolean]{halid}[true]{% + \settoggle{bbx:halid}{#1}} +\DeclareBibliographyOption[boolean]{swhid}[true]{% + \settoggle{bbx:swhid}{#1}} +\DeclareBibliographyOption[boolean]{swlabels}[true]{% + \settoggle{bbx:swlabels}{#1}} +\DeclareBibliographyOption[boolean]{vcs}[true]{% + \settoggle{bbx:vcs}{#1}} +\DeclareBibliographyOption[boolean]{license}[true]{% + \settoggle{bbx:license}{#1}} + +\ExecuteBibliographyOptions{halid,swhid,swlabels,vcs,license} + +% +% Declare inheritance rules (valid only in LaTeX preamble!) +% +\DeclareDataInheritance{software}{softwareversion,softwaremodule,codefragment}{\inherit{*}{*}} +\DeclareDataInheritance{softwareversion}{softwaremodule,codefragment}{\inherit{*}{*}} +\DeclareDataInheritance{softwaremodule}{codefragment}{\inherit{*}{*}} + +% +% Localization +% +\DeclareLanguageMapping{english}{english-software} +\DeclareLanguageMapping{french}{french-software} + +% +% Formatting fields for the software entries +% + +\DeclareFieldFormat[softwaremodule,codefragment]{subtitle}{\mkbibquote{#1\isdot}} +\DeclareFieldFormat[software,softwareversion,softwaremodule,codefragment]{url}{ + \iftoggle{bbx:url}% + {\mkbibacro{URL}\addcolon\addspace% + \ifhyperref% + {\href{#1}{\nolinkurl{#1}}}% + {\nolinkurl{#1}}% + }% + {}% +} +\DeclareFieldFormat[software,softwareversion,softwaremodule,codefragment]{hal_id}{ + \iftoggle{bbx:halid}% + {\mkbibacro{HAL}\addcolon\addspace% + \ifhyperref% + {\href{https://hal.archives-ouvertes.fr/#1\thefield{hal_version}}{\(\langle\)\nolinkurl{#1\thefield{hal_version}}\(\rangle\)}}% + {\(\langle\)\nolinkurl{#1\thefield{hal_version}}\(\rangle\)}% + }% + {}% +} +\DeclareFieldFormat[software,softwareversion,softwaremodule,codefragment]{swhid}{% + \iftoggle{bbx:swhid}% + {\mkbibacro{SWHID}\addcolon\addspace% + \ifhyperref% + {\href{http://archive.softwareheritage.org/#1}{\(\langle\)\nolinkurl{#1}\(\rangle\)}}% + {\(\langle\)\nolinkurl{#1}\(\rangle\)}% + }% + {}% +} +\DeclareFieldFormat[software,softwareversion,softwaremodule,codefragment]{repository}{% + \iftoggle{bbx:vcs}% + {\mkbibacro{VCS}\addcolon\addspace% + \ifhyperref% + {\href{#1}{\nolinkurl{#1}}}% + {\nolinkurl{#1}}% + }% + {}% +} +\DeclareListFormat[software,softwareversion,softwaremodule,codefragment]{license}{% + \usebibmacro{list:delim}{#1}% + #1\isdot + \usebibmacro{list:andothers}} + +% +% Macros to format output +% +\newbibmacro*{swtitleauthoreditoryear}{% + \printnames{author}\addcomma% + \setunit{\addspace}% + \printfield{title}\addspace% + \printfield{version}\addspace% + \ifnameundef{editor}% + {}% + {\printtext[parens]{% + \bibstring{edited}\addspace% + \printnames{editor}}}% + \addcomma% + \addspace% + \printdate% +} + +% +\newbibmacro*{swsubtitleauthoreditoryear}{% + \printnames{author}\addcomma% + \setunit{\addspace}% + \iffieldundef{subtitle}% + {} + {\printfield{subtitle}\addcomma\addspace% + \bibstring{swpartof}\addspace + }% + \printfield{title}\addspace% + \printfield{version}\addspace% + \ifnameundef{editor}% + {} + {\printtext[parens]{% + \bibstring{edited}\addspace% + \printnames{editor}}}% + \addcomma% + \addspace% + \printdate% +} + +\newbibmacro*{codefragmenttitleauthoreditoryear}{% + \printnames{author}\addcomma% + \setunit{\addspace}% + \iffieldundef{subtitle}% + {} + {\printfield{subtitle}\addcomma\addspace% + \bibstring{swexc}\addspace + }% + \printfield{title}\addspace% + \printfield{version}\addspace% + \ifnameundef{editor}% + {} + {\printtext[parens]{% + \bibstring{edited}\addspace% + \printnames{editor}}}% + \setunit*{\addcomma\addspace}% + \printdate% +} + +\newbibmacro{licenses}{% + \iflistundef{license} + {} + {\iftoggle{bbx:license}% + {\newunitpunct + \mkbibacro{Lic}\addcolon + \printlist{license} + }% + {}% + } +} + +\newbibmacro*{swids}{% + \printfield{doi}% + \setunit*{\addcomma\addspace}% + \printfield{hal_id}% + \setunit*{\addcomma\addspace}% + \printfield{url}% + \setunit*{\addcomma\addspace}% + \printfield{repository}% + \setunit*{\addcomma\addspace}% + \printfield{swhid}% +} + +\newbibmacro*{swrelated}{% + \iffieldundef{related}% + {}% + {\usebibmacro{related}}% +} + +% +% Formatting the entries +% + +\DeclareBibliographyDriver{software}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \iftoggle{bbx:swlabels}{\bibstring{software}{\addspace}}{}% + \usebibmacro{swtitleauthoreditoryear}% + \newunit\newblock% + \usebibmacro{licenses}% + \newunit\newblock% + \usebibmacro{swids}% + \newunit\newblock% + \usebibmacro{swrelated}% + \usebibmacro{finentry}} + +\DeclareBibliographyDriver{softwareversion}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \iftoggle{bbx:swlabels}{\bibstring{swversion}\addspace}{}% + \usebibmacro{swsubtitleauthoreditoryear}% + \newunit\newblock% + \usebibmacro{licenses}% + \newunit\newblock% + \usebibmacro{swids}% + \newunit\newblock% + \usebibmacro{swrelated}% + \usebibmacro{finentry}} + +\DeclareBibliographyDriver{softwaremodule}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \iftoggle{bbx:swlabels}{\bibstring{swmodule}\addspace}{}% + \usebibmacro{swsubtitleauthoreditoryear}% + \newblock\newblock% + \usebibmacro{licenses}% + \newunit\newblock% + \usebibmacro{swids}% + \newunit\newblock% + \usebibmacro{swrelated}% + \usebibmacro{finentry}} + +\DeclareBibliographyDriver{codefragment}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \iftoggle{bbx:swlabels}{\bibstring{swexcerpt}\addspace}{}% + \usebibmacro{codefragmenttitleauthoreditoryear}% + \newunit\newblock% + \usebibmacro{licenses}% + \newunit\newblock% + \usebibmacro{swids}% + \newunit\newblock% + \usebibmacro{swrelated}% + \usebibmacro{finentry}} diff --git a/Master/texmf-dist/tex/latex/biblatex-software/software.dbx b/Master/texmf-dist/tex/latex/biblatex-software/software.dbx new file mode 100644 index 00000000000..05422738801 --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-software/software.dbx @@ -0,0 +1,184 @@ +\ProvidesFile{software.dbx}[2020/04/02 datamodel extension for software entries, Roberto Di Cosmo] +\RequireBiber[3] +% +% the software entry type family, with their fields +% +\DeclareDatamodelEntrytypes{software,softwareversion,softwaremodule,codefragment} +\DeclareDatamodelFields[type=field,datatype=literal]{ + introducedin, +} +\DeclareDatamodelFields[type=list,datatype=literal]{ + license, +} +\DeclareDatamodelFields[type=field,datatype=uri]{ + repository, +} +\DeclareDatamodelFields[type=field, datatype=verbatim]{ + hal_id, + hal_version, + swhid, +} + +% +% Fields for software entry +% +\DeclareDatamodelEntryfields[software]{ + abstract, + author, + date, + doi, + editor, + file, + hal_id, + hal_version, + institution, + license, + month, + note, + organization, + publisher, + related, + relatedstring, + repository, + swhid, + title, + url, + urldate, + version, + year, +} +\DeclareDatamodelConstraints[software]{ + \constraint[type=mandatory]{ + \constraintfieldsor{ + \constraintfield{author} + \constraintfield{editor} + } + \constraintfield{title} + \constraintfield{url} + \constraintfield{year} + } +} + +% +% Fields for softwareversion entry +% +\DeclareDatamodelEntryfields[softwareversion]{ + abstract, + author, + crossref, + date, + doi, + editor, + file, + hal_id, + hal_version, + institution, + introducedin, + license, + month, + note, + organization, + publisher, + related, + relatedstring, + relatedtype, + repository, + subtitle, + swhid, + title, + url, + urldate, + version, + year, +} +\DeclareDatamodelConstraints[softwareversion]{ + \constraint[type=mandatory]{ + \constraintfieldsor{ + \constraintfield{author} + \constraintfield{editor} + } + \constraintfield{title} + \constraintfield{url} + \constraintfield{version} + \constraintfield{year} + } +} + +% +% Fields for softwaremodule entry +% +\DeclareDatamodelEntryfields[softwaremodule]{ + abstract, + author, + crossref, + date, + doi, + editor, + file, + hal_id, + hal_version, + institution, + introducedin, + license, + month, + note, + organization, + publisher, + related, + relatedstring, + relatedtype, + repository, + subtitle, + swhid, + title, + url, + urldate, + version, + year, +} +\DeclareDatamodelConstraints[softwaremodule]{ + \constraint[type=mandatory]{ + \constraintfield{author} + \constraintfield{subtitle} + \constraintfield{url} + \constraintfield{year} + } +} + +% +% Fields for codefragment entry +% +\DeclareDatamodelEntryfields[codefragment]{ + abstract, + author, + crossref, + date, + doi, + file, + hal_id, + hal_version, + institution, + introducedin, + license, + month, + note, + organization, + publisher, + related, + relatedstring, + relatedtype, + repository, + subtitle, + swhid, + title, + url, + urldate, + version, + year, +} +\DeclareDatamodelConstraints[codefragment]{ + \constraint[type=mandatory]{ + \constraintfield{url} + } +} + |