summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/doclicense/doclicense.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/doclicense/doclicense.dtx')
-rw-r--r--macros/latex/contrib/doclicense/doclicense.dtx70
1 files changed, 38 insertions, 32 deletions
diff --git a/macros/latex/contrib/doclicense/doclicense.dtx b/macros/latex/contrib/doclicense/doclicense.dtx
index a223cb981a..c03b64f472 100644
--- a/macros/latex/contrib/doclicense/doclicense.dtx
+++ b/macros/latex/contrib/doclicense/doclicense.dtx
@@ -27,7 +27,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1998/12/01]
%<package>\ProvidesPackage{doclicense}
%<*package>
- [2020/06/26 v2.0.1 Support for putting documents under a license]
+ [2020/07/26 v2.1.0 Support for putting documents under a license]
%</package>
%
%<*driver>
@@ -125,7 +125,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% \changes{1.0}{2015/03/30}{Removed space before quotes (Example: \enquote{CC } $\rightarrow$ \enquote{CC})}
% \changes{1.1}{2015/04/06}{Added support for Creative Commons 4.0 and added \cmd{\doclicenseImageFileName}}
% \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.}
-% \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.}
+% \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.}
% \changes{1.4.1}{2016/04/10}{Translation fixes for: fr, en-gb. Included missing CC-by-nc-nd icon (US dollar).}
% \changes{1.5.0}{2016/04/24}{Allow to change the way text is typeset by \cmd{\doclicenseThis}.}
% \changes{1.6.0}{2017/10/07}{Added Russian and Italian translation. Added `imageposition` and `imagedistance` parameters.}
@@ -136,7 +136,8 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% \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).}
% \changes{1.10.1}{2020/04/12}{Fix image for CC-BY-NC EU. Fix URL for CC-PDDC. Improve wording for catalan language.}
% \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.}
-% \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 money unit of \cmd{\doclicenseIcon} macro using imagemodifier to Japan currency JP without breaking \cmd{\doclicenseImage}.}
+% \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}.}
+% \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.}
%
%
@@ -175,12 +176,12 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% package is designed to handle all kinds of licenses. See \nameref{sec:contributing}.
%
% \section{Usage}
-% Just load the package
+% Just load the package by placing something like this:
+%
% \begin{quote}
% |\usepackage{| \\
-% |% babel,| \\
-% |% hyperref,| \\
-% |% hyperxmp,| \\
+% | babel,| \\
+% | hyperxmp,| \\
% |}| \\
% |\usepackage[| \\
% | type={CC},| \\
@@ -205,12 +206,12 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% \enquote{CC} to cover all the \doclicenseLongType licenses.
% Please make sure that the type is all uppercase. See the \nameref{sec:supported-licenses} section for a complete list.
%
-% Allows to
+% Allows to \DescribePara{modifier}
% select different subclasses of a license. In the
% example it is \enquote{by-sa}.
% Please make sure that the type is all lowercase. See the \nameref{sec:supported-licenses} section for a complete list.
%
-% As \DescribePara{version} there can be more than one version of a license, the version can also be set.
+% As \DescribePara{version} there can be more than one version of a license, the version also needs to be set.
%
% This package can output some texts like the long license name.
% \DescribePara{lang}
@@ -225,19 +226,16 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% \item[Brazilian] Added by \href{https://github.com/iagows}{Iago}.
% \item[Catalan] Added by \href{https://github.com/elancha98}{Ernesto Lanchares}.
% \item[Chinese] Added by \href{https://github.com/sd44}{sd44}.
-% \item[English] Added by \href{https://github.com/ypid}{Robin Schneider}.
+% \item[English] Added by \href{https://me.ypid.de/}{Robin Schneider}.
% \item[French] Added by \href{https://github.com/ericguirbal}{\'Eric Guirbal}.
% \item[Galician] Submitted by Email.
-% \item[German] Added by \href{https://github.com/ypid}{Robin Schneider}.
+% \item[German] Added by \href{https://me.ypid.de/}{Robin Schneider}.
% \item[Italian] Added by \href{https://github.com/rig8f}{Filippo Rigotto}.
+% \item[Marathi] Added by \href{https://github.com/NiranjanTambe}{Niranjan}. Note that Niranjan also translated the images which are considered unofficial by the package. Creative Commons has no plans to support additional currencies.
% \item[Polish] Added by \href{https://github.com/jsbien}{jsbien}.
% \item[Portuguese] Added by \href{https://github.com/alexandre1985}{Daniel Alexandre Cerqueira Santos}.
% \item[Russian] Added by \href{https://github.com/bergentroll}{Anton Karmanov}.
% \item[Spanish] Added by \href{https://github.com/elsudano}{Carlos}. Updated by \href{https://github.com/IgnacioFDM}{IgnacioFDM}.
-%
-%
-%
-%
% \end{eqlist}
%
% Image position for \cmd{\doclicenseThis}: right (default) or left.
@@ -245,16 +243,18 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
%
% Default image width for the license image.
% \DescribePara{imagewidth}
+% Defaults to 10em.
%
% Distance between text and image in \cmd{\doclicenseThis}.
% \DescribePara{imagedistance}
+% Defaults to 2em.
% Select different variations of license images.
% \DescribePara{imagemodifier}
% For example, Creative Commons provides more than one image for one version.
% See the \href{https://creativecommons.org/about/downloads}{download page}.
-% You will note that there are by-nc.eu and by-nc which only differ in the money unit.
-% Based on the loaded language, the money unit is set to a suitable default. You can change this with:
+% You will note that there are by-nc.eu and by-nc which only differ in the currency.
+% Based on the loaded language, the currency is set to a suitable default. You can change this with:
% \begin{quote}
% |\usepackage[| \\
% | type={CC},| \\
@@ -370,34 +370,35 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% \DescribeMacro{\doclicensePlainFullText}
% Verbatim prints the full license text.
%
-% ^^A Don’t ask why I inserted that line break … (LaTeX made the \doclicensePlainFullText red)
+% ^^A Don’t ask why I inserted that line break … (LaTeX made the \doclicensePlainFullText red).
%
% An example can be found in the \nameref{sec:plain_license_text} section.
%
% \DescribeMacro{\doclicensePlainFullTextFileName}
-% \hspace{2.5em}Expands to the file name which the \cmd{\doclicensePlainFullTextFileName} macro uses to \cmd{\input} the license text file.
+% \hspace{2.5em}Expands to the file name which the \cmd{\doclicensePlainFullTextFileName} macro uses to \cmd{\verbatiminput} the license text file.
+% Example: \enquote{\doclicensePlainFullTextFileName{}}
%
% \DescribeMacro{\doclicenseFullText}
-% Nicely prints the full license text.
+% Pretty prints the full license text.
%
-% ^^A Don’t ask why I inserted that line break … (LaTeX made the \doclicenseFullText red)
+% ^^A Don’t ask why I inserted that line break … (LaTeX made the \doclicenseFullText red).
%
% An example can be found in the \nameref{sec:pretty_license_text} section.
%
% \DescribeMacro{\doclicenseFullTextFileName}
% Expands to the file name which the \cmd{\doclicenseFullText} macro uses to \cmd{\input} the license text file.
+% Example: \enquote{\doclicenseFullTextFileName}
%
+% \DescribeMacro{\doclicenseTypeIcon}
+% Expands to an icon of the license type. Example:
+% \enquote{\doclicenseTypeIcon{}}. This macro is based on the
+% \PrintPackage{ccicons} package.
%
% \DescribeMacro{\doclicenseIcon}
-% Expands to a icon of the license. Example:
+% Expands to an icon of the license. Example:
% \enquote{\doclicenseIcon{}}. This macro is based on the
% \PrintPackage{ccicons} package.
%
-% \DescribeMacro{\doclicenseTypeIcon}
-% Expands to a icon of the license type. Example:
-% \enquote{\doclicenseTypeIcon{}}. This macro is based on the
-% \PrintPackage{ccicons} package.
-%
% \DescribeMacro{\doclicenseImage}
% This is kind of similar to \cmd{\doclicenseIcon} but it will typeset an
% bigger pictogram of the license. Example:
@@ -424,10 +425,14 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% You do not have to worry about the file path. Normally your \LaTeX{} environment
% will find the image for you.
%
+% The file extension is omitted which is good practice together with
+% \cmd{\includegraphics} as it will pick the proper one itself.
+%
% \DescribeMacro{\doclicenseThis}
% And last but not least there is the \cmd{\doclicenseThis} macro which will
% typeset the \cmd{\doclicenseText} next to the \cmd{\doclicenseImage} in a
-% \enquote{minipage} environment. This will look like the following:
+% \enquote{minipage} environment.
+% This will look like the following:
%
% \doclicenseThis
%
@@ -664,6 +669,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% \subsection{Declare variables and macros}
% \begin{macrocode}
%% Declare variables (((
+\@namedef{doclicense@lang@lic@CC}{Creative Commons}%
\newcommand{\doclicense@baseUrlCC}{https://creativecommons.org}
\newcommand{\doclicense@versionFallback}{}
\newcommand{\doclicense@versionUsed}{}
@@ -725,7 +731,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}
\newcommand{\doclicensePlainFullTextFileName}{%
doclicense-\doclicense@type-\doclicense@modifier%
- -\doclicense@versionUsed-plaintext
+ -\doclicense@versionUsed-plaintext%
}
\newcommand{\doclicensePlainFullText}{%
\verbatiminput{\doclicensePlainFullTextFileName}
@@ -816,7 +822,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
\newcommand{\doclicense@set}{%
%% CC (((
\ifthenelse{\equal{\doclicense@type}{CC}}{%
- \renewcommand{\doclicenseLongType}{Creative Commons\xspace}
+ \renewcommand{\doclicenseLongType}{\doclicense@lang@lic@CC\xspace}
\renewcommand{\doclicenseTypeIcon}{\ccLogo\xspace}
\doclicense@setVersion[3.0]
@@ -890,8 +896,8 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}{}
\IfSubStr{\doclicense@modifier}{nc}{}{
%% eu (Euro) does only exist for nc (non commercial) so if not nc then reset -eu.
- \ifthenelse{\equal{\doclicense@imagemodifier}{-eu}}{%
- \renewcommand{\doclicense@imagemodifier}{}
+ \IfBeginWith{\doclicense@imagemodifier}{-eu}{%
+ \renewcommand{\doclicense@imagemodifier}{-88x31}% chktex 29
}{}
}
\ifthenelse{\equal{\doclicense@imagemodifier}{-eu}}{%