summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-license/biblatex-license.tex
blob: a935baa628d705a6bc8df1c5ac2f87f2da0659be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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}
@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}},
}

@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@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}
@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},
}
\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}