texlive[58452] branches/branch2020.0/Master: biblatex-license

commits+karl at tug.org commits+karl at tug.org
Tue Mar 16 23:16:06 CET 2021


Revision: 58452
          http://tug.org/svn/texlive?view=revision&revision=58452
Author:   karl
Date:     2021-03-16 23:16:06 +0100 (Tue, 16 Mar 2021)
Log Message:
-----------
biblatex-license (16mar21) (branch)

Modified Paths:
--------------
    branches/branch2020.0/Master/tlpkg/tlpsrc/collection-bibtexextra.tlpsrc

Added Paths:
-----------
    branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/
    branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/README.md
    branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.pdf
    branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.tex
    branches/branch2020.0/Master/texmf-dist/tex/latex/biblatex-license/
    branches/branch2020.0/Master/texmf-dist/tex/latex/biblatex-license/biblatex-license.sty
    branches/branch2020.0/Master/tlpkg/tlpsrc/biblatex-license.tlpsrc

Added: branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/README.md
===================================================================
--- branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/README.md	                        (rev 0)
+++ branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/README.md	2021-03-16 22:16:06 UTC (rev 58452)
@@ -0,0 +1,102 @@
+# biblatex-license
+
+----
+Author:
+Anselm Wagner
+a.wagner1 at uni-wuppertal.de
+Bergische Universität Wuppertal
+v0.1
+
+License:
+This material is subject to the LaTeX Project Public License 1.3c.
+https://ctan.org/license/lppl1.3
+
+Requirements:
+This package requires the LaTeX-packages 'biblatex' and 'kvoptions' to be installed.
+----
+
+## Intro
+
+This package provides a modification to the biblatex standard styles for
+relating cited works to the license under which they were published.
+This is done via biblatex’ build in `related` mechanism and
+`relatedtype = license`. This package basically provides this new
+relatedtype, the bibmacros for typesetting these related entries and
+some additional styling options.
+
+## Loading the package
+
+The package is loaded via
+
+    \usepackage[options]{biblatex-license}
+
+and has to be loaded *after* the `biblatex` package. The package sets
+the `biblatex` option `related = true`.
+
+## Options
+
+* `license`  : Decides if and how the license is to be printed. Default: short
+* `url`      : Switch for deciding if the url of the license should be explicitly printed. Default: false
+* `link`     : When set to `true` and `url` is set to `off`, the title of the license becomes an `\href`, i.e. a hyperlink. Default: true
+* `introtext`: Makes it possible to replace the language specific intro text (e.g. “licensed under”) with custom text. Default: none
+
+## Usage
+
+Consider the following bibliography:
+
+    @Misc{CreativeCommons4.0,
+      author     = {{Creative Commons}},
+      title      = {{Attribution-NonCommercial-ShareAlike 4.0 International}},
+      date       = {2013-11-25},
+      url        = {https://creativecommons.org/licenses/by-nc-sa/4.0/},
+      urldate    = {2019-10-01},
+      shorttitle = {{CC BY-NC-SA 4.0}},
+    }
+
+    @book{Payne2019,
+      author = {Blakeley Hoffman Payne},
+      editor = {{MIT Media Lab Personal Robots Group} and Cynthia Breazeal},
+      title = {An Ethics of Artificial Intelligence Curriculum for Middle
+                School Students},
+      related = {CreativeCommons4.0},
+      relatedtype = {license},
+      url = {https://t1p.de/rwlp},
+      urldate = {2020-01-27},
+      date = {2019-08},
+    }
+
+Note, that `Payne2019` has the fields `related` and `relatedtype`
+defined. `related` is pointing via the label to the entry corresponding
+to the license under which `Payne2019` was published:
+`CreativeCommons4.0`. The `relatedtype = {license}` is necessary for
+`biblatex` to know how this relation should be handled. Please see the
+`biblatex` user guide (§3.4 *Related Entries*) for more information on
+related entries.
+
+## More on the options
+
+### `introtext`
+
+Note the text “Licensed under” in the bibliography. This text is, as of
+now, only translated to german but can be changed via the option
+`introtext` like so:
+
+    \usepackage[introtext={Some text}]{biblatex-license}
+
+### `link`
+
+Also note that in the example output above the title of the license is
+itself a link to where the `url`-field of the license entry inside the
+bib-file is pointing. This link is made via `\href`.
+
+### `url`
+
+It might be better to explicitly print the url of the license, which can
+be done via the `url=true` option. If printed this way, the option
+`link` has no effect on if this url is itself a hyperlink or not aus the
+url-field is handled by biblatex itself.
+
+### `shorttitle` of the license
+
+If a `shorttitle` is provided for the license inside the bib-file, the
+shorttitle will always be preferred.


Property changes on: branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.pdf
===================================================================
(Binary files differ)

Index: branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.pdf
===================================================================
--- branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.pdf	2021-03-16 22:15:42 UTC (rev 58451)
+++ branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.pdf	2021-03-16 22:16:06 UTC (rev 58452)

Property changes on: branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.tex
===================================================================
--- branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.tex	                        (rev 0)
+++ branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.tex	2021-03-16 22:16:06 UTC (rev 58452)
@@ -0,0 +1,150 @@
+\documentclass[11pt,oneside,notitlepage,a4paper,english,parskip=half*] {scrartcl}
+\usepackage{luainputenc}
+\usepackage[T1]{fontenc}
+\usepackage[english]{babel}
+\usepackage{color}                
+\usepackage{graphicx}
+%\usepackage{url}
+%\usepackage{hyperref}
+\usepackage{floatrow}
+\usepackage{booktabs}
+\usepackage{tabularx}
+\usepackage{csquotes}
+% !TeX spellcheck = en_US
+\usepackage[
+backend=biber
+,sortlocale=en_EN%.UTF-8
+,style=authoryear
+,bibencoding=UTF8 
+,block=space
+,autocite=inline
+]{biblatex}
+\begin{filecontents}{\jobname.bib}
+ at Misc{CreativeCommons4.0,
+  author     = {{Creative Commons}},
+  title      = {{Attribution-NonCommercial-ShareAlike 4.0}},
+  date       = {2013-11-25},
+  url        = {https://creativecommons.org/licenses/by-nc-sa/4.0/},
+  urldate    = {2019-10-01},
+  shorttitle = {{CC BY-NC-SA 4.0}},
+}
+
+ at book{Payne2019,
+  author = {Blakeley Hoffman Payne},
+  editor = {{MIT Media Lab Personal Robots Group} and Cynthia Breazeal},
+  title = {An Ethics of Artificial Intelligence Curriculum for Middle School Students},
+  related = {CreativeCommons4.0},
+  relatedtype = {license},
+  url = {https://t1p.de/rwlp},
+  urldate = {2020-01-27},
+  date = {2019-08},
+}
+\end{filecontents}
+\addbibresource{\jobname.bib}
+\usepackage[license=short,link=true,url=false,introtext={default}]{biblatex-license}
+
+\let\endtitlepage\relax
+\title{\texttt{biblatex-license}}
+\author{Anselm Wagner\\a.wagner1 at uni-wuppertal.de\\Bergische Universität Wuppertal\\v0.1}
+
+\begin{document}
+\maketitle
+\begin{abstract}
+This package provides a modification to the biblatex standard styles for relating cited works to the license under which they were published. This is done via biblatex' build in \texttt{related} mechanism and \texttt{relatedtype = license}. This package basically provides this new relatedtype, the bibmacros for typesetting these related entries and some additional styling options.
+\end{abstract}
+\tableofcontents
+\vspace{2em}
+
+The package is loaded via
+\begin{verbatim}
+\usepackage[options]{biblatex-license}
+\end{verbatim}
+and has to be loaded \emph{after} the \texttt{biblatex} package. The package sets the \texttt{biblatex} option \texttt{related = true}.
+
+\section{Options}
+
+\begin{tabularx}{\linewidth}{c|X|c|c}
+\toprule \textbf{Name} & \textbf{Function}  & \textbf{Possible Values} & \textbf{Default} \\
+\midrule \texttt{license} & Decides if and how the license is to be printed. & short, full, off & short \\
+\hline \texttt{url} & Switch for deciding if the url of the license should be explicitly printed. & true, false & false \\
+\hline \texttt{link} & When set to \texttt{true} and \texttt{url} is set to \texttt{off}, the title of the license becomes an \verb|\href|, i.e. a hyperlink. & true, false & true \\
+\hline \texttt{introtext} & Makes it possible to replace the language specific intro text (e.g. \enquote{licensed under}) with custom text. & any text & \\\bottomrule
+\end{tabularx}
+
+
+\section{Usage}
+
+Consider the following bibliography:
+\begin{verbatim}
+ at Misc{CreativeCommons4.0,
+  author     = {{Creative Commons}},
+  title      = {{Attribution-NonCommercial-ShareAlike 4.0 International}},
+  date       = {2013-11-25},
+  url        = {https://creativecommons.org/licenses/by-nc-sa/4.0/},
+  urldate    = {2019-10-01},
+  shorttitle = {{CC BY-NC-SA 4.0}},
+}
+
+ at book{Payne2019,
+  author = {Blakeley Hoffman Payne},
+  editor = {{MIT Media Lab Personal Robots Group} and Cynthia Breazeal},
+  title = {An Ethics of Artificial Intelligence Curriculum for Middle
+            School Students},
+  related = {CreativeCommons4.0},
+  relatedtype = {license},
+  url = {https://t1p.de/rwlp},
+  urldate = {2020-01-27},
+  date = {2019-08},
+}
+\end{verbatim}
+Note, that \texttt{Payne2019} has the fields \texttt{related} and \texttt{relatedtype} defined. \texttt{related} is pointing via the label to the entry corresponding to the license under which \texttt{Payne2019} was published: \texttt{CreativeCommons4.0}. The \texttt{relatedtype = \{license\}} is necessary for \texttt{biblatex} to know how this relation should be handled. Please see the \texttt{biblatex} user guide (§3.4 \emph{Related Entries}) for more information on related entries.
+
+Now if \texttt{biblatex} is loaded with the following options:
+\begin{verbatim}
+\usepackage[
+  backend=biber
+ ,sortlocale=en_EN%.UTF-8
+ ,style=authoryear
+ ,bibencoding=UTF8 
+ ,block=space
+]{biblatex}
+\end{verbatim}
+
+And \texttt{biblatex-license} is loaded the default way:
+\begin{verbatim}
+\usepackage{biblatex-license}
+\end{verbatim}
+
+The bibliopgraphic entry of \texttt{Payne2019} would look like this:
+\nocite{Payne2019}\printbibliography[heading=none]
+
+The default way of loading \texttt{biblatex-license} is equivalent to:
+\begin{verbatim}
+\usepackage[license=short,
+            url=false,
+            link=true,
+            introtext={default}]
+            {biblatex-license}
+\end{verbatim}
+
+\subsection{\texttt{introtext}}
+
+Note the text \enquote{Licensed under} in the bibliography. This text is, as of now, only translated to german but can be changed via the option \texttt{introtext} like so:
+\begin{verbatim}
+\usepackage[introtext={Some text}]{biblatex-license}
+\end{verbatim}
+
+\subsection{\texttt{link}}
+
+Also note that in the example output above the title of the license is itself a link to where the \texttt{url}-field of the license entry inside the bib-file is pointing. This link is made via \verb|\href|.
+
+\subsection{\texttt{url}}
+
+It might be better to explicitly print the url of the license, which can be done via the \texttt{url=true} option. If printed this way, the option \texttt{link} has no effect on if this url is itself a hyperlink or not aus the url-field is handled by biblatex itself.
+
+\subsection{\texttt{shorttitle} of the license}
+
+If a \texttt{shorttitle} is provided for the license inside the bib-file, the shorttitle will always be preferred. 
+
+\end{document}
+


Property changes on: branches/branch2020.0/Master/texmf-dist/doc/latex/biblatex-license/biblatex-license.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/branch2020.0/Master/texmf-dist/tex/latex/biblatex-license/biblatex-license.sty
===================================================================
--- branches/branch2020.0/Master/texmf-dist/tex/latex/biblatex-license/biblatex-license.sty	                        (rev 0)
+++ branches/branch2020.0/Master/texmf-dist/tex/latex/biblatex-license/biblatex-license.sty	2021-03-16 22:16:06 UTC (rev 58452)
@@ -0,0 +1,125 @@
+% This package serves the purpose of providing a way
+% for relating entries in the bibliography to the license
+% under which those entries where licensed. For this end
+% it uses the build in biblatex 'related' mechanism to
+% link works to their license. It therefor defines a new
+% 'relatedtype', which is 'license'.
+% 
+% Anselm Wagner (a.wagner1 at uni-wuppertal.de)
+%
+% This material is subject to the LaTeX Project Public License 1.3c.
+% https://ctan.org/license/lppl1.3
+% 
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+\ProvidesPackage{biblatex-license}
+  [2020/01/30 v1.0 biblatex-license]
+\RequirePackage{biblatex}
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{
+  family=biblicense,
+  prefix=biblicense@}
+\DeclareStringOption[short]{license} % how should the licenses be printed in
+                                     % bib? Options: short, full, off
+\DeclareBoolOption[false]{url} % should the url of the license be printed
+                               % as well?
+\DeclareBoolOption[true]{link} % should the lincense be a weblink?
+\DeclareStringOption[default]{introtext} % alternative introtext for licenses
+                                         % in the bibliography. Arbitrary text.
+\ProcessKeyvalOptions*
+
+\ifbiblicense at link % link=true
+  \RequirePackage{hyperref}
+\fi
+
+% set related=true otherwise this package has no functionality
+\ExecuteBibliographyOptions{related=true}
+
+% Common definitions:
+\NewBibliographyString{licensedunder}
+\DefineBibliographyStrings{english}{%
+  licensedunder = {licensed under},
+}
+\DefineBibliographyStrings{german}{%
+  licensedunder = {Lizenziert unter},
+}
+
+\newbibmacro*{shortIfShorttitleExists}{%
+    \iffieldundef{shorttitle}
+    {\printfield{title}}
+    {\printfield{shorttitle}}
+}
+
+\newbibmacro*{licenseAsLink}{\printfield[licenseAsLink]{url}}
+
+\DeclareFieldFormat{licenseAsLink}{\href{#1}{\usebibmacro{shortIfShorttitleExists}\unspace}}
+
+% test if alternative introtext was entered and change accordingly
+\ifnum\pdf at strcmp{\biblicense at introtext}{default}=0%
+    \newcommand{\biblicenseintrotext}{\biblstring{licensedunder}}
+\else
+    \newcommand{\biblicenseintrotext}{\biblicense at introtext}
+\fi
+
+
+\ifnum\pdf at strcmp{\biblicense at license}{off}=0% Package has no functionality.
+  \newbibmacro*{related:license}[1]{}
+\else % license is to be printed
+  \ifnum\pdf at strcmp{\biblicense at license}{short}=0% short license to be printed
+    \ifbiblicense at url % url=true
+      \newbibmacro*{related:license}[1]{%
+        \entrydata{#1}{%
+          \printtext{\biblicenseintrotext}%
+          \setunit{\addspace}%
+          \usebibmacro{shortIfShorttitleExists}%
+          \iffieldundef{url}
+          {}
+          {\setunit{\addspace}\usebibmacro{url}}}%
+      }
+    \else % url=false
+      \ifbiblicense at link % link=true
+        \newbibmacro*{related:license}[1]{%
+          \entrydata{#1}{%
+            \printtext{\biblicenseintrotext}%
+            \setunit{\addspace}%
+            \iffieldundef{url}
+            {\usebibmacro{shortIfShorttitleExists}}
+            {\usebibmacro{licenseAsLink}}%
+          }
+        }
+      \else % link=false
+        \newbibmacro*{related:license}[1]{%
+          \entrydata{#1}{%
+            \printtext{\biblicenseintrotext}%
+            \setunit{\addspace}%
+            {\usebibmacro{shortIfShorttitleExists}}%
+          }
+        }
+      \fi % link = ?
+    \fi % url = ?
+  \else % license=full -- full license to be printed
+      \newbibmacro*{related:license}[1]{%
+          \entrydata{#1}{%
+              \printtext{\biblicenseintrotext}%
+              \setunit{\addspace}%
+              \usedriver
+              {\ifnameundef{savedauthor}
+                  {\ifnameundef{savededitor}
+                      {}
+                      {\ifnamesequal{editor}{savededitor}
+                      {\clearname{editor}}
+                      {}}}
+                  {\ifnamesequal{author}{savedauthor}
+                      {\clearname{author}}
+                      {}}%
+              \renewbibmacro*{related:init}{}%
+              \DeclareNameAlias{sortname}{default}%
+              \ifbibmacroundef{date+extradate}
+                  {}
+                  {\renewbibmacro*{date+extradate}{}%
+                  \renewbibmacro*{date}{\printdate}}%
+              \renewbibmacro*{pageref}{}}
+              {\thefield{entrytype}}
+          }
+      }
+  \fi
+\fi


Property changes on: branches/branch2020.0/Master/texmf-dist/tex/latex/biblatex-license/biblatex-license.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/branch2020.0/Master/tlpkg/tlpsrc/biblatex-license.tlpsrc
===================================================================
Modified: branches/branch2020.0/Master/tlpkg/tlpsrc/collection-bibtexextra.tlpsrc
===================================================================
--- branches/branch2020.0/Master/tlpkg/tlpsrc/collection-bibtexextra.tlpsrc	2021-03-16 22:15:42 UTC (rev 58451)
+++ branches/branch2020.0/Master/tlpkg/tlpsrc/collection-bibtexextra.tlpsrc	2021-03-16 22:16:06 UTC (rev 58452)
@@ -51,6 +51,7 @@
 depend biblatex-iso690
 depend biblatex-jura2
 depend biblatex-juradiss
+depend biblatex-license
 depend biblatex-lni
 depend biblatex-luh-ipw
 depend biblatex-manuscripts-philology



More information about the tex-live-commits mailing list.