diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/doclicense/doclicense.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/doclicense/doclicense.sty | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/doclicense/doclicense.sty b/Master/texmf-dist/tex/latex/doclicense/doclicense.sty index e63c59e191c..70b4b74eeb9 100644 --- a/Master/texmf-dist/tex/latex/doclicense/doclicense.sty +++ b/Master/texmf-dist/tex/latex/doclicense/doclicense.sty @@ -1,7 +1,7 @@ %% See file 'doclicense.dtx' for copyright and license. \NeedsTeXFormat{LaTeX2e}[1998/12/01] \ProvidesPackage{doclicense} - [2015/02/06 v0.8 Set and print the license of a document] + [2015/02/07 v0.9 Set and print the license of a document] %% Dependencies {{{ \RequirePackage{kvoptions} @@ -23,6 +23,7 @@ \DeclareStringOption[by-sa]{modifier} \DeclareStringOption{version} \DeclareStringOption{lang} +\DeclareStringOption{imagemodifier} \DeclareStringOption[10em]{imagewidth} %% }}} @@ -34,7 +35,8 @@ \newboolean{doclicense@licenseKnown} \newlength{\doclicense@hsize} \newcommand{\doclicense@longName}{% - \csname doclicense@lang@lic@\doclicense@type @\doclicense@modifier @\doclicense@versionUsed\endcsname + \csname doclicense@lang@lic@\doclicense@type @\doclicense@modifier% + @\doclicense@versionUsed\endcsname } \newcommand{\doclicense@icon}{% \PackageError{doclicense}{Icon not defined} @@ -47,7 +49,8 @@ \newcommand{\doclicenseLongType}{} \newcommand{\doclicenseModifier}{\MakeUppercase{\doclicense@modifier}\xspace} \newcommand{\doclicenseVersion}{\doclicense@versionUsed\xspace} -\newcommand{\doclicenseName}{\doclicense@type~\doclicense@modifier~\doclicense@versionUsed\xspace} +\newcommand{\doclicenseName}{% + \doclicense@type~\doclicense@modifier~\doclicense@versionUsed\xspace} \newcommand{\doclicenseNameRef}{\href{\doclicenseURL}{\doclicenseName}\xspace} \newcommand{\doclicenseLongName}{\doclicenseLongType\space\doclicense@longName\xspace} \newcommand{\doclicenseLongNameRef}{\href{\doclicenseURL}{\doclicenseLongName}} @@ -65,11 +68,12 @@ \setkeys{doclicense}{#1} \href{\doclicenseURL}{% \includegraphics[width=\doclicense@imagewidth]% - {doclicense-\doclicense@type-\doclicense@modifier}% + {doclicense-\doclicense@type-\doclicense@modifier\doclicense@imagemodifier}% } } -\newcommand{\doclicenseLicense}{ +\newcommand{\doclicenseLicense}{\doclicenseThis} %% legacy support +\newcommand{\doclicenseThis}{ \setlength{\doclicense@hsize}{\textwidth-\doclicense@imagewidth-2em} \ifthenelse{\lengthtest{\hsize > \vsize}}{%% landscape \setlength{\doclicense@hsize}{\doclicense@hsize-10em} @@ -92,7 +96,9 @@ \IfFileExists{doclicense-\doclicense@lang.ldf}{% \input{doclicense-\doclicense@lang.ldf} }{% - \PackageWarning{doclicense}{No language definition for \doclicense@lang not found. Please add one and submit a patch. Using English as fallback.} + \PackageWarning{doclicense}{% + No language definition for \doclicense@lang not found. + Please add one and submit a patch. Using English as fallback.} \renewcommand{\doclicense@lang}{english} \input{doclicense-\doclicense@lang.ldf} } @@ -126,18 +132,25 @@ licenses/% \doclicense@modifier/% \doclicense@versionUsed\doclicense@UrlLangPart} - \ifthenelse{\equal{\doclicense@modifier}{by-sa}} - {\renewcommand{\doclicense@icon}{\ccbysa}}{} - \ifthenelse{\equal{\doclicense@modifier}{by-nd}} - {\renewcommand{\doclicense@icon}{\ccbynd}}{} - \ifthenelse{\equal{\doclicense@modifier}{by-nc}} - {\renewcommand{\doclicense@icon}{\ccbync}}{} + \ifthenelse{\equal{\doclicense@modifier}{by-sa}}{% + \renewcommand{\doclicense@icon}{\ccbysa} + \renewcommand{\doclicense@imagemodifier}{} + }{} + \ifthenelse{\equal{\doclicense@modifier}{by-nd}}{% + \renewcommand{\doclicense@icon}{\ccbynd} + \renewcommand{\doclicense@imagemodifier}{} + }{} + \ifthenelse{\equal{\doclicense@modifier}{by-nc}}{% + \renewcommand{\doclicense@icon}{\ccbync} + \renewcommand{\doclicense@imagemodifier}{} + }{} \ifthenelse{\equal{\doclicense@modifier}{by-nc-sa}} {\renewcommand{\doclicense@icon}{\ccbync}}{} \ifthenelse{\equal{\doclicense@modifier}{by-nc-nd}} {\renewcommand{\doclicense@icon}{\ccbync}}{} \ifthenelse{\equal{\doclicense@modifier}{zero}}{% \renewcommand{\doclicense@icon}{\cczero} + \renewcommand{\doclicense@imagemodifier}{} \doclicense@setVersion[1.0] \edef\doclicenseURL{% \doclicense@baseUrlCC/% @@ -147,6 +160,7 @@ }{} \ifthenelse{\equal{\doclicense@modifier}{pd}}{ \renewcommand{\doclicense@icon}{\ccpd} + \renewcommand{\doclicense@imagemodifier}{} \doclicense@setVersion[1.0] \edef\doclicenseURL{% \doclicense@baseUrlCC/% |