Debian Codegraph @

texmf-dist/source/latex/doclicense/doclicense.dtx

raw
1 % \iffalse meta-comment
2 %
3 % SPDX-FileCopyrightText: 2015-2023 Robin Schneider <[email protected]>
4 %
5 % SPDX-License-Identifier: LPPL-1.3c
6 %
7 % This work consists of all files listed in manifest.txt.
8 % For more details about the licensing, refer to the README.md file.
9 %
10 % \fi
11 %
12 % \iffalse
13 %<*driver>
14 \ProvidesFile{doclicense.dtx}
15 %</driver>
16 %<package>% SPDX-FileCopyrightText: 2015-2022 Robin Schneider <[email protected]>
17 %<package>%
18 %<package>% SPDX-License-Identifier: LPPL-1.3c
19 %<package>%
20 %<package>% This work consists of all files listed in manifest.txt.
21 %<package>% For more details about the licensing, refer to the README.md file.
22 %<package>% If you don't have those files, you can find them at: https://ctan.org/pkg/doclicense
23 %<package>
24 %<package>\NeedsTeXFormat{LaTeX2e}[1998/12/01]
25 %<package>\ProvidesPackage{doclicense}
26 %<*package>
27 [2023/10/01 v3.3.0 Support for putting documents under a license]
28 %</package>
29 %
30 %<*driver>
31 \documentclass[english]{ltxdoc}
32 \setlength{\parindent}{0pt}
33 \newcommand{\PackageURL}{https://github.com/ypid/latex-packages/tree/master/doclicense}
34 \newcommand{\PackageCTANURL}{https://www.ctan.org/pkg/doclicense}
35 \newcommand{\PackageAuthor}{Robin Schneider}
36 \newcommand{\PackageAuthorEmail}{[email protected]}
37 \newcommand{\PackageName}{\PrintPackage{doclicense}}
38 \newcommand{\PrintPackage}[1]{\textsf{#1}}
39 \newcommand{\PrintOptionF}[1]{\emph{#1}} % ^^A This macro is used for
40 % ^^A explaining any parameter when they first come up in the manual.
41 \newcommand{\DescribePara}[1]{\marginpar{\raggedleft\strut\MacroFont\string#1}}
42 \usepackage[
43 hyphens,
44 obeyspaces,
45 spaces,
46 ]{url}
47 \usepackage[table,svgnames]{xcolor}
48 \usepackage{%
49 babel,
50 csquotes,
51 hypdoc,
52 nameref,
53 eqlist,
54 tabu,
55 tabularray,
56 }
57 \usepackage[iso]{isodate}
58 % ^^A https://tex.stackexchange.com/a/95893/32320
59 \setlength\IndexMin{100pt}
60 \usepackage[
61 type={CC},
62 modifier={by-sa},
63 version={4.0},
64 % imagemodifier={-80x15},% chktex 29
65 hyphenation={RaggedRight},
66 ]{doclicense}
67 \GetFileInfo{doclicense.dtx}
68 \hypersetup{%
69 pdftitle={A manual for \PackageName},
70 pdfauthor={\PackageAuthor{} <\PackageAuthorEmail>},
71 pdfsubject={\fileinfo},
72 baseurl={\PackageURL},
73 pdfkeywords={This document corresponds to \PackageName\nobreakspace\fileversion,
74 dated \filedate},
75 }
76
77 \title{The \PackageName{} package\thanks{This document
78 corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filedate}.}}
79
80 \author{\PackageAuthor\\
81 \texttt{\href{mailto:\PackageAuthorEmail?subject=LaTeX package doclicense%
82 \&body=Hey Robin,}%
83 {\PackageAuthorEmail}%
84 }%
85 }
86
87 \EnableCrossrefs%
88 \CodelineIndex%
89 \RecordChanges%
90 \begin{document}
91 \DocInput{doclicense.dtx}
92 \PrintChanges%
93 \PrintIndex%
94 \end{document}
95 %</driver>
96 % \fi
97 %
98 % ^^A \CheckSum{0}
99 % ^^A I use version control and so on which has much better checksums :)
100 %
101 % \CharacterTable
102 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
103 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
104 % Digits \0\1\2\3\4\5\6\7\8\9
105 % Exclamation \! Double quote \" Hash (number) \#
106 % Dollar \$ Percent \% Ampersand \&
107 % Acute accent \' Left paren \( Right paren \)
108 % Asterisk \* Plus \+ Comma \,
109 % Minus \- Point \. Solidus \/
110 % Colon \: Semicolon \; Less than \<
111 % Equals \= Greater than \> Question mark \?
112 % Commercial at \@ Left bracket \[ Backslash \\
113 % Right bracket \] Circumflex \^ Underscore \_
114 % Grave accent \` Left brace \{ Vertical bar \|
115 % Right brace \} Tilde \~}
116 %
117 % \changes{0.07}{2015/02/05}{Initial version.}
118 % \changes{0.08}{2015/02/06}{Added support for CC-zero and CC-pd and small improvements}
119 % \changes{0.09}{2015/02/07}{Added list of supported licenses to docu and added option imagemodifier.
120 % Also renamed macro \cmd{\doclicenseLicense} to \cmd{\doclicenseThis}.}
121 % \changes{0.10}{2015/02/13}{Added support for hyperxmp.}
122 % \changes{1.0}{2015/03/30}{Removed space before quotes (Example: \enquote{CC } $\rightarrow$ \enquote{CC}).}
123 % \changes{1.1}{2015/04/06}{Added support for Creative Commons 4.0 and added \cmd{\doclicenseImageFileName}.}
124 % \changes{1.2}{2015/04/06}{Allow \cmd{\doclicenseModifier} to be used with hyperref. Fixed \cmd{\doclicenseIcon} macro, added missing image and wrote test framework. Added notes about how to add translations. Added Spanish translation.}
125 % \changes{1.4.0}{2015/12/13}{Added \cmd{\doclicensePlainFullText} and \cmd{\doclicenseFullText} macros. Thanks to \href{https://github.com/siefkenj}{siefkenj} for the help.}
126 % \changes{1.4.1}{2016/04/10}{Translation fixes for: fr, en-gb. Included missing CC-by-nc-nd icon (US dollar).}
127 % \changes{1.5.0}{2016/04/24}{Allow to change the way text is typeset by \cmd{\doclicenseThis}.}
128 % \changes{1.6.0}{2017/10/07}{Added Russian and Italian translation. Added `imageposition` and `imagedistance` parameters.}
129 % \changes{1.7.0}{2018/02/17}{Update Russian and Spanish translation. Fix issue with unescaped newline causing two spaces between license name and 'license' word.}
130 % \changes{1.7.1}{2018/04/24}{Include .eps versions of the images to allow using `latex` with dvi output. Thanks to robertpetry for reporting.}
131 % \changes{1.8.0}{2018/06/10}{Added Polish translation.}
132 % \changes{1.9.0}{2019/04/07}{Added Catalan, Galician, Chinese and Portuguese translation. Detect and give hint when enquote macro is already defined. Fix LaTeX Error: Too deeply nested.}
133 % \changes{1.10.0}{2019/06/05}{Added Brazilian translation. Update Chinese and Portuguese translation. Do not use enumitem for list label customization (beamer compatibility).}
134 % \changes{1.10.1}{2020/04/12}{Fix image for CC-BY-NC EU. Fix URL for CC-PDDC. Improve wording for catalan language.}
135 % \changes{2.0.0}{2020/05/27}{Add 80x15 version of CC images which can be used with the imagemodifier option. Fix slight color offset for all CC images caused by bad image conversion. Thanks to rodrigoalcarazdelaosa for reporting. Fix \cmd{\doclicenseThis} support for twocolumn layouts. Thanks to Nao Pross. Soft require package options "type", "modifier" and "version" now. Defaults are deprecated. This will become a package error in an upcoming major version of the package, with the earliest release in 2021-07 to give people time to migrate. Remove Creative Commons PD which has been replaced by CC-zero as of 2010-10-11. Update example license used for examples in manual to CC-BY-SA-4.0.}
136 % \changes{2.0.1}{2020/06/26}{Fix backwards compatibility by still accepting imagemodifier={-eu} and imagemodifier={-us}. Thanks to Jürgen Spitzmüller for reporting. Fix ability to modify currency of \cmd{\doclicenseIcon} macro using imagemodifier to Japan currency JP without breaking \cmd{\doclicenseImage}.}
137 % \changes{2.1.0}{2020/07/26}{Fix regression: Proper language default image variants (Euro variants for example) was broken and the US variant was always used. This bug was introduced in v2.0.0. Documentation fixes. Added Marathi translation.}
138 % \changes{2.2.0}{2020/09/18}{Add Japanese and Bulgarian translations. Add hint how to use Chinese to docs. Load hyperxmp by default when it is installed. Before, doclicense just suggested to load it and made use of the package when the user did.}
139 % \changes{2.2.1}{2020/09/25}{Fix compatibility issue with newer versions of hyperxmp (bug confirmed with Tex Live 2020) resulting in an compile error by loading hyperxmp and hyperref in the order the packages expect it.}
140 % \changes{2.3.0}{2021/03/13}{Add option to disable the use of hyperxmp and add compatibility for pdfx. Use \url{https://reuse.software/} for the doclicense source code itself.}
141 % \changes{3.0.0}{2021/07/11}{Breaking change: Hard require package options "type", "modifier" and "version" now after one year in soft require migration period. Add Croatian translation. Add sections to docs about choosing a license and the REUSE specification. Update Spanish translation to match Creative Commons website. Add note to README that CC license texts and images are licensed themselves under CC0-1.0. Load csquotes after hyperref to avoid hyperref warning. Do not load the hyperxmp package if the silence package is loaded to avoid an endless loop. Improve warning messages generated by the package. Add "Dependency packages and load order" section to docs.}
142 % \changes{3.1.0}{2022/04/27}{Add macro \cmd{\doclicenseLongTextForHyperref} and use it inside \cmd{\hypersetup} to replace the fagile code that was previously used. Add Traditional Chinese (Taiwan), Swedish and Esperanto translations.}
143 % \changes{3.2.0}{2022/05/18}{Add Ukrainian translation.}
144 % \changes{3.3.0}{2023/10/01}{Add Austrian, Greek and Swiss German translations. Document available CC modifiers because it was not clear that to select CC0 the "zero" modifier must be used. Fix typo in Brazilian translation.}
145 %
146 %
147 %
148 % ^^A nag warned about the center environment and it really messes up spacing.
149 %
150 % \DoNotIndex{\RequirePackage, \DeclareOption, \ProcessOptions}
151 % \DoNotIndex{\PackageWarning, \MessageBreak}
152 % \DoNotIndex{\DeclareRobustCommand, \newcommand, \renewcommand, \def, \edef}
153 % \DoNotIndex{\DeclareStringOption, \ProcessLocalKeyvalOptions}
154 % \DoNotIndex{\ProcessKeyvalOptions, \SetupKeyvalOptions, \DeclareBoolOption}
155 % \DoNotIndex{\newenvironment}
156 % \DoNotIndex{\if, \else, \fi, \ifcase, \or, \ifthenelse, \AND, \OR, \value, \relax}
157 % \DoNotIndex{\loop, \repeat, \the, \ifnum}
158 % \DoNotIndex{\equal, \boolean, \@currname, \newcounter, \setcounter}
159 % \DoNotIndex{\stepcounter, \addtocounter}
160 % \DoNotIndex{\endinput, \begin, \end}
161 % \DoNotIndex{\not}
162 %
163 % \maketitle
164 %
165 % \phantomsection
166 % \addcontentsline{toc}{section}{\abstractname}
167 % \begin{abstract}
168 % Support for putting documents under a license. \\
169 % Information site on CTAN: \url{\PackageCTANURL} \\
170 % Example on Stackexchange: \url{https://tex.stackexchange.com/a/226788/32320} \\
171 % Fork me on GitHub: \url{\PackageURL} \end{abstract}
172 %
173 % \tableofcontents
174 %
175 % \section{Introduction}
176 % The \PackageName{} package allows you to put your document under a
177 % license and include a link to read about the license or include an icon or
178 % image of the license. Currently, only \doclicenseLongType is supported but this
179 % package is designed to handle all kinds of licenses. See \nameref{sec:contributing}.
180 %
181 % \section{Usage}
182 % The package can be used like in this mini working example:
183 %
184 % \begin{quote}
185 % |\documentclass[english]{article}| \\
186 % |\usepackage[| \\
187 % | type={CC},| \\
188 % | modifier={by-sa},| \\
189 % | version={4.0},| \\
190 % |]{doclicense}| \\
191 % |\begin{document}| \\
192 % |\doclicenseThis%| \\
193 % |\end{document}|
194 % \end{quote}
195 %
196 % This will explicitly set the license to \doclicenseNameRef.
197 %
198 % With the default settings and if the \PrintPackage{hyperxmp} package is
199 % installed, it will be loaded and the options \PrintOptionF{pdflicenseurl}
200 % and \PrintOptionF{pdfcopyright} will be set by \PackageName{} to the
201 % corresponding values (\enquote{\url{\doclicenseURL}} and
202 % \enquote{\doclicenseLongTextForHyperref{}}). This embeds license metadata
203 % into the PDF which proper PDF readers can show. For example Evince shows it
204 % in the \enquote{Document License} tab under \enquote{Properties}. You may
205 % check this manual for how your PDF reader handles such metadata.
206 %
207 % In case you are using other packages to manipulate the metadata which is
208 % incompatible to the use of hyperxmp, e.\,g. \PrintPackage{pdfx} you can use
209 % the \PrintOptionF{hyperxmp=false} option to disable this automatism. If
210 % \PrintPackage{pdfx} is loaded before \PrintPackage{doclicense} or if
211 % \PrintPackage{hyperxmp} is not installed this automatism is disabled.
212 % In these cases a warning is emitted to inform you about the reason.
213 % The warning will not show up if \PrintOptionF{hyperxmp} is set to
214 % \PrintOptionF{false}.
215 %
216 % Also note that \PrintPackage{hyperxmp} is not loaded when
217 % \PrintPackage{silence} was loaded. This is because when both of those
218 % packages are loaded, compilation runs into an endless loop.
219 %
220 % \section{Dependency packages and load order}
221 %
222 % \PackageName{} will ensure that the following packages are loaded by default.
223 % You don't need to do anything extra as long as you are fine with the default options
224 % of those packages:
225 %
226 % \begin{eqlist}
227 % \item[\PrintPackage{ccicons}] To typeset icon versions of the Creative Commons licenses.
228 % \item[\PrintPackage{graphicx}] To include images/buttons of the Creative Commons licenses.
229 % \item[\PrintPackage{hyperxmp}] To write license information into the metadata section of the generated PDF.
230 % \item[\PrintPackage{hyperref}] To typeset hyperlinks/URLs that are clickable.
231 % \item[\PrintPackage{csquotes}] To offload localization of quotes depending on document language.
232 % \end{eqlist}
233 %
234 % Load order is important for some of those packages.
235 % Here are the constraints that you will need to consider when you decide to
236 % load the packages yourself or other packages that you use load them:
237 %
238 % \begin{itemize}
239 % \item \PrintPackage{hyperxmp} should be loaded before the setup of \PrintPackage{hyperref} is called.
240 % \item \PrintPackage{csquotes} should be loaded before
241 % \PrintPackage{biblatex} because otherwise \PrintPackage{biblatex} will
242 % define the \cmd{\enquote} in a way that is not compatible with
243 % \PackageName{}.
244 % \item The position of loading \PackageName{} is decoupled from the load
245 % order because interaction and loading of dependency packages is done via a
246 % hook at the end of the preamble.
247 % \end{itemize}
248 %
249 %
250 % \section{Package options}
251 %
252 % Sets the license type. \DescribePara{type}
253 % Like in the previous example, the type can be
254 % \enquote{CC} to cover all the \doclicenseLongType licenses.
255 % Please make sure that the type is all uppercase. See the \nameref{sec:supported-licenses} section for a complete list.
256 % This is a required option since v2.0.0.
257 %
258 % Allows to \DescribePara{modifier}
259 % select different subclasses of a license. In the
260 % example it is \enquote{by-sa}.
261 % Please make sure that the type is all lowercase. See the \nameref{sec:supported-licenses} section for a complete list.
262 % This is a required option since v2.0.0.
263 %
264 % As \DescribePara{version} there can be more than one version of a license, the version also needs to be set.
265 % This is a required option since v2.0.0.
266 %
267 % This package can output some texts like the long license name.
268 % \DescribePara{lang}
269 % Because of this, there needs to be a way to specify the language to use.
270 % If this parameter is omitted, then this package will default to
271 % \cmd{\languagename} which is normally set by packages like
272 % \PrintPackage{babel} or \PrintPackage{polyglossia}.
273 %
274 % Supported languages:
275 % ^^A Sorted alphabetically.
276 % \begin{itemize}
277 % \item Austrian
278 % \item Brazilian
279 % \item Bulgarian
280 % \item Catalan
281 % \item Chinese: Note that you might need to pass \verb+lang={chinese-utf8}+ \verb+lang={chinese-tw}+, or \verb+chinese-gbk+.
282 % \item Croatian
283 % \item English
284 % \item Esperanto
285 % \item French
286 % \item Galician
287 % \item German
288 % \item Greek
289 % \item Italian
290 % \item Japanese
291 % \item Marathi: Note that Niranjan also translated the images which are considered unofficial by the package. Creative Commons has no plans to support additional currencies.
292 % \item Polish
293 % \item Portuguese
294 % \item Russian
295 % \item Spanish
296 % \item Swedish
297 % \item Swiss German
298 % \item Ukrainian
299 % \end{itemize}
300 %
301 % Image position for \cmd{\doclicenseThis}: right (default) or left.
302 % \DescribePara{imageposition}
303 %
304 % Default image width for the license image.
305 % \DescribePara{imagewidth}
306 % Defaults to 10em.
307 %
308 % Distance between text and image in \cmd{\doclicenseThis}.
309 % \DescribePara{imagedistance}
310 % Defaults to 2em.
311
312 % Select different variations of license images.
313 % \DescribePara{imagemodifier}
314 % For example, Creative Commons provides more than one image for one version.
315 % See the \href{https://creativecommons.org/about/downloads}{download page}.
316 % You will note that there are by-nc.eu and by-nc which only differ in the currency.
317 % Based on the loaded language, the currency is set to a suitable default. You can change this with:
318 % \begin{quote}
319 % |\usepackage[| \\
320 % | type={CC},| \\
321 % | modifier={by-nc},| \\
322 % | version={4.0},| \\
323 % | imagemodifier={-eu-88x31},| \\
324 % |]{doclicense}|
325 % \end{quote}
326 %
327 % Also, there is 80x15 which uses letters instead of icons for the modifiers in the image.
328 % \begin{quote}
329 % |\usepackage[| \\
330 % | type={CC},| \\
331 % | modifier={by-nc},| \\
332 % | version={4.0},| \\
333 % | imagemodifier={-eu-80x15},| \\
334 % |]{doclicense}|
335 % \end{quote}
336 %
337 % If this is not given, we default to 88x31.
338 %
339 % Note that imagemodifier needs to assemble into a valid filename. Check
340 % what files the package ships with to understand what combinations can be
341 % used.
342 %
343 % For backwards compatibility, \enquote{-eu} is interpreted as \enquote{-eu-88x31}.
344 %
345 % This option allows you to specify
346 % \DescribePara{hyphenation}
347 % a macro name which is going to be expanded
348 % in the minipage environment of \cmd{\doclicenseThis}.
349 % That allows you to change the behaviour how \cmd{\doclicenseLongText} is
350 % typeset. By default, this option is not enabled.
351 %
352 % One possible use case is to set the option to \enquote{RaggedRight}.
353 % This will use the \cmd{\RaggedRight} macro provided by the
354 % \PrintPackage{ragged2e} package\footnote{The \PrintPackage{ragged2e} package will be loaded when it is required.}) with the intention of limiting the number of
355 % hyphenations while still allowing a hyphenation by typesetting
356 % \cmd{\doclicenseLongText} as ragged text.
357 %
358 % The idea of using ragged text is that the \cmd{\doclicenseLongText} is
359 % usually one or two full line and one half full line so avoiding hyphenations
360 % might look better compared to justified text.
361 %
362 % \enquote{RaggedRight} is also the setting used for this manual.
363 % \cmd{\doclicenseThis} did not produce a hyphenation in case of this
364 % manual but \TeX{} did fill up the first text line to it’s full width
365 % by adding additional space between words. This has been be avoided by setting
366 % the following option for this document:
367 %
368 % \begin{quote}
369 % |\usepackage[| \\
370 % | hyphenation={RaggedRight},| \\
371 % |]{doclicense}|
372 % \end{quote}
373 %
374 % Another option which can make sense is the \cmd{\raggedright} macro which
375 % more drastically limits the number of hyphenations. This can be set as shown
376 % below:
377 %
378 % \begin{quote}
379 % |\usepackage[| \\
380 % | hyphenation={raggedright},| \\
381 % |]{doclicense}|
382 % \end{quote}
383 %
384 % This option allows to disable the automatic loading of \PrintPackage{hyperxmp}.
385 % \DescribePara{hyperxmp}
386 % It's initialized to true. This might also be used to suppress the warning if
387 % \PrintPackage{hyperxmp} is not available or \PrintPackage{pdfx} was loaded before
388 % \PrintPackage{doclicense}.
389 %
390 % \section{Macros}
391 % \DescribeMacro{\doclicenseType}
392 % Expands to the type as set in the package options. Example: \enquote{\doclicenseType{}}
393 %
394 % \DescribeMacro{\doclicenseLongType}
395 % Same as \cmd{\doclicenseType} except that it expands to the long license
396 % type. Example: \enquote{\doclicenseLongType{}}
397 %
398 % \DescribeMacro{\doclicenseModifier}
399 % Expands to the modifier as set in the package options. Example: \enquote{\doclicenseModifier{}}
400 %
401 % \DescribeMacro{\doclicenseVersion}
402 % Expands to the version as set in the package options. Example: \enquote{\doclicenseVersion{}}
403 %
404 % \DescribeMacro{\doclicenseURL}
405 % Expands to the official URL about the license. Note that it expands to the
406 % raw URL string without the use of \cmd{\href} or similar. If you want the
407 % link to be clickable then you can use \cmd{\href} or \cmd{\url} from the
408 % \PrintPackage{hyperref} package or just read on because the following macros
409 % can also do this for your. Example:
410 % \enquote{\doclicenseURL{}}
411 %
412 % \DescribeMacro{\doclicenseName}
413 % Expands to the short name of the license. Example: \enquote{\doclicenseName{}}
414 %
415 % \DescribeMacro{\doclicenseLongName}
416 % Expands to the long name of the license. Example: \enquote{\doclicenseLongName{}}
417 %
418 % \DescribeMacro{\doclicenseNameRef}
419 % Same as \cmd{\doclicenseName} except that it links to the URL of the license.
420 % Example: \enquote{\doclicenseNameRef{}}
421 %
422 % \DescribeMacro{\doclicenseLongNameRef}
423 % Same as \cmd{\doclicenseLongName} except that it links to the URL of the
424 % license. Example:
425 % \enquote{\doclicenseLongNameRef{}}
426 %
427 % \DescribeMacro{\doclicenseText}
428 % Expands to a localized text which states that this document is licensed under
429 % the license. Example:
430 % \enquote{\doclicenseText{}}
431 %
432 % \DescribeMacro{\doclicenseLongText}
433 % Same as \cmd{\doclicenseText} except that it uses the long name of the license.
434 % Example: \enquote{\doclicenseLongText{}}
435 %
436 % \DescribeMacro{\doclicenseLongTextForHyperref}
437 % \hspace{2.5em}Same as \cmd{\doclicenseLongText} except that it does not contain \cmd{\href}
438 % and other complex macros. The purpose of this macro is to be used as value inside of \cmd{\hypersetup}.
439 % Example: \enquote{\doclicenseLongTextForHyperref{}}
440 %
441 % \DescribeMacro{\doclicensePlainFullText}
442 % Verbatim prints the full license text.
443 %
444 % ^^A Don’t ask why I inserted that line break … (LaTeX made the \doclicensePlainFullText red).
445 %
446 % An example can be found in the \nameref{sec:plain_license_text} section.
447 %
448 % \DescribeMacro{\doclicensePlainFullTextFileName}
449 % \hspace{2.5em}Expands to the file name which the \cmd{\doclicensePlainFullTextFileName} macro uses to \cmd{\verbatiminput} the license text file.
450 % Example: \enquote{\doclicensePlainFullTextFileName{}}
451 %
452 % \DescribeMacro{\doclicenseFullText}
453 % Pretty prints the full license text.
454 %
455 % ^^A Don’t ask why I inserted that line break … (LaTeX made the \doclicenseFullText red).
456 %
457 % An example can be found in the \nameref{sec:pretty_license_text} section.
458 %
459 % \DescribeMacro{\doclicenseFullTextFileName}
460 % Expands to the file name which the \cmd{\doclicenseFullText} macro uses to \cmd{\input} the license text file.
461 % Example: \enquote{\doclicenseFullTextFileName}
462 %
463 % \DescribeMacro{\doclicenseTypeIcon}
464 % Expands to an icon of the license type. Example:
465 % \enquote{\doclicenseTypeIcon{}}. This macro is based on the
466 % \PrintPackage{ccicons} package.
467 %
468 % \DescribeMacro{\doclicenseIcon}
469 % Expands to an icon of the license. Example:
470 % \enquote{\doclicenseIcon{}}. This macro is based on the
471 % \PrintPackage{ccicons} package.
472 %
473 % \DescribeMacro{\doclicenseImage}
474 % This is kind of similar to \cmd{\doclicenseIcon} but it will typeset an
475 % bigger pictogram of the license. Example:
476 % \enquote{\doclicenseImage}
477 %
478 % Note that you can change the image size with the \oarg{imagewidth} parameter
479 % like this:
480 % \enquote{\doclicenseImage[imagewidth=2em]}
481 %
482 % \begin{quote}
483 % |\doclicenseImage[imagewidth=2em]|
484 % \end{quote}
485 %
486 % The images are bundled with the \PackageName{} package as vector graphics.
487 %
488 % \DescribeMacro{\doclicenseImageFileName}
489 % This macro expands to the file name of the image which the
490 % \cmd{\doclicenseImage} typesets. You can use this file name with
491 % \cmd{\includegraphics} if you need more flexibility over how the image is
492 % typeset.
493 %
494 % The current file name is: \enquote{\doclicenseImageFileName}
495 %
496 % You do not have to worry about the file path. Normally your \LaTeX{} environment
497 % will find the image for you.
498 %
499 % The file extension is omitted which is good practice together with
500 % \cmd{\includegraphics} as it will pick the proper one itself.
501 %
502 % \DescribeMacro{\doclicenseThis}
503 % And last but not least there is the \cmd{\doclicenseThis} macro which will
504 % typeset the \cmd{\doclicenseText} next to the \cmd{\doclicenseImage} in a
505 % \enquote{minipage} environment.
506 % This will look like the following:
507 %
508 % \doclicenseThis
509 %
510 % \makeatletter
511 % \renewcommand{\doclicense@imagemodifier}{-80x15}
512 % And here is how it looks with the imagemodifier option set to \enquote{\doclicense@imagemodifier}:
513 %
514 % \doclicenseThis
515 % \renewcommand{\doclicense@imagemodifier}{-88x31}
516 % \makeatother
517 %
518 % \section{Supported licenses}
519 % \label{sec:supported-licenses}
520 %
521 % Currently only Creative Commons is supported.
522 % The license type, modifier and version should be based on
523 % \href{https://spdx.org/licenses/}{SPDX license identifiers}. Direct support
524 % for SPDX license identifiers should be considered when supporting new
525 % licenses.
526 %
527 % \subsection{CC (Creative Commons)}
528 %
529 % \makeatletter
530 % \begin{longtblr}[
531 % caption = {Supported Creative Commons licenses},
532 % label = {tblr:cc},
533 % ]{
534 % colspec = {lrX},
535 % rowhead = 1,
536 % row{odd} = {bg=azure8},
537 % row{1} = {bg=azure3, fg=white, font=\sffamily},
538 % }
539 % modifier & version & name\\
540 %
541 % ^^A Sorted alphabetically.
542 % by & 3.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
543 % by & 4.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
544 % by-nc & 3.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
545 % by-nc & 4.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
546 % by-nc-nd & 3.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
547 % by-nc-nd & 4.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
548 % by-nc-sa & 3.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
549 % by-nc-sa & 4.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
550 % by-nd & 3.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
551 % by-nd & 4.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
552 % by-sa & 3.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
553 % by-sa & 4.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
554 % zero & 1.0 & \@nameuse{doclicense@lang@lic@CC@[email protected]}\\
555 % \end{longtblr}
556 % \makeatother
557 %
558 % \section{Retired licenses}
559 %
560 % Licenses get updated and sometimes fully replaced.
561 % This section clarifies how \PackageName{} handles this.
562 %
563 % If there is consensus that the old license has no valid use case anymore and
564 % it is possible and allowed for everyone compiling a document to update the
565 % license, then the old license will be removed from \PackageName{} in the next
566 % major version.
567 %
568 % Otherwise, \PackageName{} will keep supporting it to ensure that documents
569 % using those licenses can still be compiled in the future.
570 %
571 % List of retired licenses:
572 %
573 % \makeatletter
574 % ^^A Sorted alphabetically.
575 % \begin{eqlist}
576 % \item[CC-PDDC] Copyright-Only Dedication
577 % \end{eqlist}
578 % \makeatother
579 %
580 % \section{What license to choose for the document?}
581 %
582 % The list of available licenses is long (see
583 % \href{https://spdx.org/licenses/}{SPDX License List}). Only a (small) subset
584 % of them are a good choice for documentation. The \doclicenseLongType family
585 % seem to be a common choice as contributions to this package have shown. This
586 % package was translated to 15+ languages but no other license families have
587 % been added yet. With that, a link to
588 % \href{https://creativecommons.org/choose/}{Creative Commons: Choose a
589 % License} is probably justified if you have not done that already.
590 %
591 % \section{REUSE Specification}
592 %
593 % That clarifies the question under which license you want to put the document
594 % under, but in practice it might not be as easy as that.
595 % Under what license are the artifacts (images/figures/tables/source code
596 % listings) you are including? It would probably be useful to track such
597 % metadata along with the files. For this, the \href{REUSE
598 % Specification}{https://reuse.software/} can be used.
599 %
600 % The REUSE Specification is independent of \LaTeXe{} and more \enquote{low
601 % level} than this package.
602 % \PackageName{} might integrate with the REUSE Specification at a later point.
603 % Refer to \url{https://github.com/ypid/latex-packages/issues/72} for
604 % discussion how such an integration could look like.
605 %
606 % \section{Contributing}
607 % \label{sec:contributing}
608 % This package is being developed on GitHub: \url{\PackageURL}. When you want
609 % to modify the .sty file, make sure that you make your changes in the .dtx
610 % file instead, as the .sty file is automatically generated.
611 %
612 % In case you want to add a translation for your language then just copy the
613 % file \path{doclicense-english.ldf} and replace the \enquote{english} in
614 % the filename with your language code (same as the language code used by
615 % \PrintPackage{babel}) and translate the file.
616 % If there are multiple language
617 % codes which should map to the same translation then have a look at the file
618 % \path{doclicense-american.ldf}.
619 %
620 % When you are done and have tested your translation by modifying
621 % \path{test-package-option-matrix} and then running
622 % \enquote{./test-package-option-matrix mynewlanguage}), then please send me
623 % the translated file(s) either via Email or preferably by opening a pull
624 % request on GitHub so that I can include them in the next release.
625 %
626 % Note that the following development conventions are used for the package:
627 %
628 % \begin{itemize}
629 % \item \href{https://reuse.software/spec/}{REUSE Specification 3.0}
630 % \item \href{https://www.conventionalcommits.org/en/v1.0.0/}{Conventional Commits 1.0.0}
631 % \item \href{https://semver.org/spec/v2.0.0.html}{Semantic Versioning 2.0.0}
632 % \item CI tests using GitHub Actions
633 % \end{itemize}
634 %
635 % \section{Plaintext license text}
636 % \label{sec:plain_license_text}
637 %
638 % The following is an example output of the \cmd{\doclicensePlainFullText} macro.
639 %
640 % \doclicensePlainFullText
641 %
642 % \section{Pretty license text}
643 % \label{sec:pretty_license_text}
644 %
645 % The following is an example output of the \cmd{\doclicenseFullText} macro.
646 %
647 % \doclicenseFullText
648 %
649 % \StopEventually{}
650 %
651 % \newpage
652 % \section{Implementation}
653 % \iffalse
654 %<*package>
655 % \fi
656 % \subsection{Declaring the options}
657 % \begin{macrocode}
658 % Parameters (((
659 \RequirePackage{kvoptions}
660 \DeclareStringOption{type}
661 \DeclareStringOption{modifier}
662 \DeclareStringOption{version}
663 \DeclareStringOption{lang}
664 \DeclareStringOption[-88x31]{imagemodifier}% chktex 29
665 \DeclareStringOption[right]{imageposition}
666 \DeclareStringOption[10em]{imagewidth}
667 \DeclareStringOption[2em]{imagedistance}
668 \DeclareStringOption{hyphenation}
669 \DeclareBoolOption[true]{hyperxmp}
670 % )))
671
672 % \end{macrocode}
673 % To test if all parameters are valid the macro |\ProcessLocalKeyvalOptions*|
674 % is expanded to ensure this before leaving the preamble. This is the only
675 % purpose for the |\ProcessLocalKeyvalOptions*| macro in this case.
676 % \begin{macrocode}
677 \ProcessLocalKeyvalOptions*
678
679 % \end{macrocode}
680 % \subsection{Dependencies}
681 % \begin{macrocode}
682 % Dependencies (((
683 \RequirePackage{xifthen}
684 \RequirePackage{xstring}
685 \RequirePackage{etoolbox} % \ifcsdef
686 \RequirePackage{xspace}
687 \RequirePackage{verbatim}
688
689 % Custom enumerate list with adjusted labels
690 % that match the license text conventions
691 \newenvironment{doclicense@enumerate}{%
692 \begin{enumerate}
693 \renewcommand{\labelenumi}{(\alph{enumi})}%
694 \renewcommand{\labelenumii}{(\arabic{enumii})}%
695 \renewcommand{\labelenumiii}{(\Alph{enumiii})}%
696 \renewcommand{\labelenumiv}{(\roman{enumiv})}%
697 }{\end{enumerate}}
698
699 \ifthenelse{%
700 \equal{\doclicense@hyphenation}{}
701 }{}{%
702 \RequirePackage{ragged2e}
703
704 \ifthenelse{\isnamedefined{\doclicense@hyphenation}}{}{%
705 \PackageError{doclicense}{Hyphenation macro not defined}
706 {The macro name given via the hyphenation option is not defined.}%
707 }
708 }
709 \AtEndPreamble{%
710 \@ifpackageloaded{ccicons}{}{\RequirePackage{ccicons}}
711 % For \doclicenseIcon
712 \@ifpackageloaded{graphicx}{}{\RequirePackage{graphicx}}
713 % For \doclicenseImage
714 \@ifpackageloaded{hyperref}{}{\RequirePackage{hyperref}}
715 \@ifpackageloaded{csquotes}{%
716 % csquotes has already been loaded so we are fine.
717 }{%
718 \ifcsdef{enquote}{%
719 % \enquote is defined but not by csquotes.
720 \@ifpackageloaded{biblatex}{%
721 \PackageError{doclicense}{The enquote macro is defined by biblatex}
722 {This package assumes that the enquote macro is defined by the
723 csquotes package. Please load csquotes before you load biblatex so
724 that biblatex does not define enquote instead.}%
725 }{%
726 \PackageError{doclicense}{The enquote macro is defined by an unknown package}
727 {This package assumes that the enquote macro is defined by the
728 csquotes package. Please check why enquote is defined without
729 csquotes being loaded. Maybe try loading csquotes early so that it
730 can define the enquote macro instead.}%
731 }
732 }{%
733 \RequirePackage{csquotes}
734 }
735 }
736 \@ifpackageloaded{hyperxmp}{%
737 % The following options are only defined when the hyperxmp package was loaded.
738 \hypersetup{%
739 pdfcopyright = {\doclicenseLongTextForHyperref},
740 pdflicenseurl = {\doclicenseURL},
741 }
742 }{}
743 }
744 \ifdoclicense@hyperxmp
745 \@ifpackageloaded{pdfx}{%
746 \PackageWarning{doclicense}{%
747 The pdfx package was detected. Therefore the mechanism to add license
748 metadata won't work. Ensure to setup \string\Copyright\space%
749 and corresponding settings to your xmpdata-file.
750 }
751 }{%
752 \@ifpackageloaded{silence}{%
753 \PackageWarning{doclicense}{%
754 The silence package was detected. hyperxmp and silence are not% chktex 12
755 compatible with each other so doclicense will not load hyperxmp as long
756 as you load silence. Therefore the mechanism to add license metadata
757 won't work. Consider to compile the final version of your document
758 without silence so that you can benefit from hyperxmp while still being
759 able to filter log messages for your draft versions.
760 }
761 \@ifpackageloaded{hyperxmp}{%
762 \PackageError{doclicense}{silence and hyperxmp were manually loaded together}{%
763 Error out because those packages together result in an endless loop.
764 }%
765 }{}
766 }{%
767 \IfFileExists{hyperxmp.sty}{%
768 \@ifpackageloaded{hyperxmp}{}{\RequirePackage{hyperxmp}}
769 }{%
770 \PackageWarning{doclicense}{%
771 The hyperxmp package is missing so no license metadata can be embedded
772 into the PDF. Consider installing hyperxmp.% chktex 13
773 }
774 }
775 }
776 }
777 \fi
778 % )))
779
780 % \end{macrocode}
781 % \subsection{Deprecation handling}
782 % \begin{macrocode}
783 % Deprecation handling (((
784 \ifthenelse{%
785 \equal{\doclicense@type}{}
786 }{%
787 \PackageError{doclicense}{"type" package option missing}{% chktex 18
788 This option is now required and the fallback to "CC" is deprecated. % chktex 18
789 In an upcoming major version of doclicense, this will be a package error.
790 Please explicitly pick a license of your choosing.
791 }
792 }{}
793
794 \ifthenelse{%
795 \equal{\doclicense@modifier}{}
796 }{%
797 \PackageError{doclicense}{"modifier" package option missing}{% chktex 18
798 This option is now required and the fallback to "by-sa" is deprecated. % chktex 18
799 In an upcoming major version of doclicense, this will be a package error.
800 Please explicitly pick a license of your choosing.
801 }
802 }{}
803
804 \ifthenelse{%
805 \equal{\doclicense@version}{}
806 }{%
807 \PackageError{doclicense}{"version" package option missing}{% chktex 18
808 This option is now required and the fallback is deprecated. % chktex 18
809 In an upcoming major version of doclicense, this will be a package error.
810 Please explicitly pick a license of your choosing.
811 }
812 }{}
813 % )))
814
815 % \end{macrocode}
816 % \subsection{Declare variables and macros}
817 % \begin{macrocode}
818 % Declare variables (((
819 \@namedef{doclicense@lang@lic@CC}{Creative Commons}%
820 \newcommand{\doclicense@baseUrlCC}{https://creativecommons.org}
821 \newcommand{\doclicense@versionFallback}{}
822 \newcommand{\doclicense@versionUsed}{}
823 \newboolean{doclicense@licenseKnown}
824 \newlength{\doclicense@hsize}
825 \newcommand{\doclicense@longName}{%
826 \@nameuse{doclicense@lang@lic@\doclicense@type @\doclicense@modifier%
827 @\doclicense@versionUsed}%
828 }
829 \newcommand{\doclicense@icon}{%
830 \PackageError{doclicense}{Icon not defined}
831 {Please check the manual of doclicense to see what you can do about it.}%
832 }
833 \newcommand{\doclicense@modifier@uppercase}{\texorpdfstring{%
834 \MakeUppercase{\doclicense@modifier}%
835 }{%
836 \doclicense@modifier}%
837 }
838 % )))
839
840 % \end{macrocode}
841 % \subsection{User macros}
842 % \begin{macrocode}
843 % User macros (((
844 \newcommand{\doclicenseType}{\doclicense@type\xspace}
845 \newcommand{\doclicenseLongType}{}
846 \newcommand{\doclicenseModifier}{\doclicense@modifier@uppercase\xspace}
847 \newcommand{\doclicenseVersion}{\doclicense@versionUsed\xspace}
848 \newcommand{\doclicenseName}{%
849 \doclicense@type\nobreakspace\doclicense@modifier@uppercase\nobreakspace%
850 \doclicense@versionUsed\xspace%
851 }
852 \newcommand{\doclicenseNameRef}{\href{\doclicenseURL}{\doclicenseName}\xspace}
853 \newcommand{\doclicenseLongName}{\doclicenseLongType\space%
854 \doclicense@longName\xspace}
855 \newcommand{\doclicenseLongNameRef}{\href{\doclicenseURL}{\doclicenseLongName}}
856 \newcommand{\doclicenseText}{%
857 \doclicense@lang@thisDoc\space
858 \href{\doclicenseURL}{\enquote{\doclicenseName{}}}%
859 \doclicense@lang@word@license.\xspace%
860 }
861 \newcommand{\doclicenseLongText}{%
862 \doclicense@lang@thisDoc\space
863 \href{\doclicenseURL}{\doclicenseLongType\space\enquote{\doclicense@longName}}%
864 \doclicense@lang@word@license.\xspace%
865 }
866 \newcommand{\doclicenseLongTextForHyperref}{%
867 \doclicense@lang@thisDoc\space
868 \doclicenseLongType\space"\doclicense@longName"% chktex 18
869 \doclicense@lang@word@license.%
870 }
871 \newcommand{\doclicenseIcon}{\doclicense@icon\xspace}
872 \newcommand{\doclicenseTypeIcon}{\doclicenseType}
873 % \newcommand{\doclicenseModifierIcon}{} % Not directly provided by ccicons.
874 \newcommand{\doclicenseImageFileName}{%
875 doclicense-\doclicense@type-\doclicense@modifier\doclicense@imagemodifier}
876 \newcommand{\doclicenseImage}[1][]{%
877 \setkeys{doclicense}{#1}
878 \href{\doclicenseURL}{%
879 \includegraphics[
880 width=\doclicense@imagewidth%
881 ]{\doclicenseImageFileName}%
882 }
883 }
884 \newcommand{\doclicensePlainFullTextFileName}{%
885 doclicense-\doclicense@type-\doclicense@modifier%
886 -\doclicense@versionUsed-plaintext%
887 }
888 \newcommand{\doclicensePlainFullText}{%
889 \verbatiminput{\doclicensePlainFullTextFileName}
890 }
891 \newcommand{\doclicenseFullTextFileName}{%
892 doclicense-\doclicense@type-\doclicense@modifier-\doclicense@versionUsed-latex}
893 \newcommand{\doclicenseFullText}{\input{\doclicenseFullTextFileName}}% chktex 27
894
895 \newcommand{\doclicenseLicense}{\doclicenseThis} % legacy support
896 \newcommand{\doclicenseThis}{%
897 \setlength{\doclicense@hsize}{\linewidth-\doclicense@imagewidth-\doclicense@imagedistance}%
898 \ifthenelse{\equal{\doclicense@imageposition}{left}}{%
899 \begin{center}
900 \begin{minipage}{\doclicense@imagewidth}
901 \doclicenseImage%
902 \end{minipage}
903 \hfill
904 \begin{minipage}{\doclicense@hsize}
905 \ifthenelse{\isempty{\doclicense@hyphenation}}{}{%
906 \@nameuse{\doclicense@hyphenation}%
907 }%
908 \doclicenseLongText%
909 \end{minipage}
910 \end{center}
911 }{%
912 % \ifthenelse{\isnamedefined{iflandscape}}{%
913 % \iflandscape{%
914 % \setlength{\doclicense@hsize}{\doclicense@hsize-10em}%
915 % }{}%
916 % }{}%
917 % {%
918 \begin{center}
919 \begin{minipage}{\doclicense@hsize}
920 \ifthenelse{\isempty{\doclicense@hyphenation}}{}{%
921 \@nameuse{\doclicense@hyphenation}%
922 }%
923 \doclicenseLongText%
924 \end{minipage}
925 \hfill
926 \begin{minipage}{\doclicense@imagewidth}
927 \doclicenseImage%
928 \end{minipage}
929 \end{center}
930 % }
931 }
932 }
933 % )))
934
935 % \end{macrocode}
936 % \subsection{Language selection}
937 % The following lines include the ldf file. All language dependent things
938 % should be stored and changed there. Note that one could also redefine
939 % macros like \cmd{\doclicenseLongText} if necessary.
940 % \begin{macrocode}
941 % Language support (((
942 \ifthenelse{\equal{\doclicense@lang}{}}{%
943 \renewcommand{\doclicense@lang}{\languagename}}{}
944 \IfFileExists{doclicense-\[email protected]}{%
945 \input{doclicense-\[email protected]}% chktex 27
946 }{%
947 \ifthenelse{\equal{\doclicense@lang}{nil}}{%
948 \PackageWarning{doclicense}{%
949 The language of your document is not defined. Please refer to the babel or polyglossia
950 package to see how to define it. Using English as fallback.
951 }
952 }{%
953 \PackageWarning{doclicense}{%
954 No language definition for \doclicense@lang\space
955 found. Consider adding one and submit it to doclicense. Using English as fallback.
956 }
957 }
958 \renewcommand{\doclicense@lang}{english}
959 \input{doclicense-\[email protected]}% chktex 27
960 }
961 \ifthenelse{\equal{\doclicense@imagemodifier}{-us}}{%
962 \@namedef{doclicense@imagemodifier}{-88x31}% chktex 29
963 }{}
964
965 % )))
966
967 % \end{macrocode}
968 % \subsection{Internals}
969 % \begin{macrocode}
970 % Set license (((
971 \newcommand{\doclicense@setVersion}[1][]{%
972 \ifthenelse{\equal{#1}{}}{}{%
973 \renewcommand{\doclicense@versionFallback}{#1}
974 }
975 \ifthenelse{\equal{\doclicense@version}{}}{%
976 \renewcommand{\doclicense@versionUsed}{\doclicense@versionFallback}
977 }{%
978 \renewcommand{\doclicense@versionUsed}{\doclicense@version}
979 }
980 }
981 \newcommand{\doclicense@set}{%
982 % CC (((
983 \ifthenelse{\equal{\doclicense@type}{CC}}{%
984 \renewcommand{\doclicenseLongType}{\doclicense@lang@lic@CC\xspace}
985 \renewcommand{\doclicenseTypeIcon}{\ccLogo\xspace}
986
987 \doclicense@setVersion[3.0]
988
989 % Allow to predefine the following macros in ldf files.
990 \ifcsdef{doclicense@UrlLangPart}{}{%
991 \ifthenelse{\equal{\doclicense@lang@lic@CC@code}{}}{%
992 \edef\doclicense@UrlLangPart{}
993 }{%
994 \edef\doclicense@UrlLangPart{/deed.\doclicense@lang@lic@CC@code}
995 }
996 }
997 \ifcsdef{doclicenseURL}{}{%
998 \edef\doclicenseURL{%
999 \doclicense@baseUrlCC/%
1000 licenses/%
1001 \doclicense@modifier/%
1002 \doclicense@versionUsed\doclicense@UrlLangPart%
1003 }
1004 }
1005 \ifthenelse{\equal{\doclicense@modifier}{by}}{%
1006 \renewcommand{\doclicense@icon}{\ccby}
1007 }{}
1008 \ifthenelse{\equal{\doclicense@modifier}{by-sa}}{%
1009 \renewcommand{\doclicense@icon}{\ccbysa}
1010 }{}
1011 \ifthenelse{\equal{\doclicense@modifier}{by-nd}}{%
1012 \renewcommand{\doclicense@icon}{\ccbynd}
1013 }{}
1014 \ifthenelse{\equal{\doclicense@modifier}{by-nc}}{%
1015 \renewcommand{\doclicense@icon}{\ccbync}
1016 \IfBeginWith{\doclicense@imagemodifier}{-eu}{%
1017 \renewcommand{\doclicense@icon}{\ccbynceu}
1018 }{}
1019 \IfBeginWith{\doclicense@imagemodifier}{-jp}{%
1020 \renewcommand{\doclicense@icon}{\ccbyncjp}
1021 \renewcommand{\doclicense@imagemodifier}{-88x31}% chktex 29
1022 }{}
1023 }{}
1024 \ifthenelse{\equal{\doclicense@modifier}{by-nc-sa}}{%
1025 \renewcommand{\doclicense@icon}{\ccbyncsa}
1026 \IfBeginWith{\doclicense@imagemodifier}{-eu}{%
1027 \renewcommand{\doclicense@icon}{\ccbyncsaeu}
1028 }{}
1029 \IfBeginWith{\doclicense@imagemodifier}{-jp}{%
1030 \renewcommand{\doclicense@icon}{\ccbyncsajp}
1031 \renewcommand{\doclicense@imagemodifier}{-88x31}% chktex 29
1032 }{}
1033 }{}
1034 \ifthenelse{\equal{\doclicense@modifier}{by-nc-nd}}{%
1035 \renewcommand{\doclicense@icon}{\ccbyncnd}
1036 \IfBeginWith{\doclicense@imagemodifier}{-jp}{%
1037 \renewcommand{\doclicense@icon}{\ccbyncndjp}
1038 \renewcommand{\doclicense@imagemodifier}{-88x31}% chktex 29
1039 }{}
1040 }{}
1041 \ifthenelse{\equal{\doclicense@modifier}{zero}}{%
1042 \renewcommand{\doclicense@icon}{\cczero}
1043 \doclicense@setVersion[1.0]
1044 \edef\doclicenseURL{%
1045 \doclicense@baseUrlCC/%
1046 publicdomain/%
1047 \doclicense@modifier/%
1048 \doclicense@versionUsed\doclicense@UrlLangPart}
1049 }{}
1050 \ifthenelse{\equal{\doclicense@modifier}{pd}}{%
1051 \PackageError{doclicense}{CC PD license removed as of version 2.0.0}{%
1052 Creative Commons PD has been replaced by CC-zero.
1053 Please update your license choice.
1054 }%
1055 }{}
1056 \IfSubStr{\doclicense@modifier}{nc}{}{%
1057 % eu (Euro) does only exist for nc (non commercial) so if not nc then reset -eu.
1058 \IfBeginWith{\doclicense@imagemodifier}{-eu}{%
1059 \renewcommand{\doclicense@imagemodifier}{-88x31}% chktex 29
1060 }{}
1061 }
1062 \ifthenelse{\equal{\doclicense@imagemodifier}{-eu}}{%
1063 \renewcommand{\doclicense@imagemodifier}{-eu-88x31}% chktex 29
1064 }{}
1065
1066 \ifcsdef{doclicense@lang@lic@\doclicense@type%
1067 @\doclicense@modifier @\doclicense@versionUsed}{}{%
1068
1069 \PackageError{doclicense}{License long name not defined}{%
1070 Please check the manual of doclicense
1071 to see what you can do about it.%
1072 }%
1073 }
1074
1075 \setboolean{doclicense@licenseKnown}{true}
1076 }{}% )))
1077 \ifthenelse{\not\boolean{doclicense@licenseKnown}}{%
1078 \PackageError{doclicense}{License unknown}{%
1079 Please check the manual of doclicense
1080 to see what you can do about it.%
1081 }%
1082 }{}%
1083 }
1084 % )))
1085
1086 \doclicense@set%
1087 % \end{macrocode}
1088 % That's it.
1089 % \begin{macrocode}
1090 \endinput
1091 % \end{macrocode}
1092 %
1093 % \iffalse
1094 %</package>
1095 % \fi
1096 %
1097 % \Finale
1098 \endinput