summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/doclicense/doclicense.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-24 22:06:36 +0000
committerKarl Berry <karl@freefriends.org>2016-04-24 22:06:36 +0000
commit7e0ac46d48cf38a13141f3969aa465c80e495cd6 (patch)
tree43bd359878f70fecf281da46f09d10ca28e8a6c8 /Master/texmf-dist/tex/latex/doclicense/doclicense.sty
parentc08f665b75f94669941f1657423ac3e51a0697e4 (diff)
doclicense (24apr16)
git-svn-id: svn://tug.org/texlive/trunk@40723 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/doclicense/doclicense.sty')
-rw-r--r--Master/texmf-dist/tex/latex/doclicense/doclicense.sty53
1 files changed, 33 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/doclicense/doclicense.sty b/Master/texmf-dist/tex/latex/doclicense/doclicense.sty
index ff3518d3726..380fd9c36a0 100644
--- a/Master/texmf-dist/tex/latex/doclicense/doclicense.sty
+++ b/Master/texmf-dist/tex/latex/doclicense/doclicense.sty
@@ -1,15 +1,36 @@
%% See file 'doclicense.dtx' for copyright and license.
\NeedsTeXFormat{LaTeX2e}[1998/12/01]
\ProvidesPackage{doclicense}
- [2015/12/13 v1.4.0 Support for putting documents under a license]
+ [2016/04/24 v1.5.0 Support for putting documents under a license]
%% ^^A nag warned about the center environment and it really messes up spacing.
+%% Parameters (((
+\RequirePackage{kvoptions}
+\DeclareStringOption[CC]{type}
+\DeclareStringOption[by-sa]{modifier}
+\DeclareStringOption{version}
+\DeclareStringOption{lang}
+\DeclareStringOption{imagemodifier}
+\DeclareStringOption[10em]{imagewidth}
+\DeclareStringOption{hyphenation}
+%% )))
+
+\ProcessLocalKeyvalOptions*
%% Dependencies (((
-\RequirePackage{kvoptions}
\RequirePackage{xifthen}
\RequirePackage{etoolbox} %% \ifcsdef
\RequirePackage{xspace}
\RequirePackage{verbatim}
+\ifthenelse{
+ \equal{\doclicense@hyphenation}{}
+}{}{%
+ \RequirePackage{ragged2e}
+
+ \ifthenelse{\isnamedefined{\doclicense@hyphenation}}{}{%
+ \PackageError{doclicense}{Hyphenation macro not defined}
+ {The macro name given via the hyphenation option is not defined.}%
+ }
+}
\AtEndPreamble{%
\@ifpackageloaded{csquotes}{}{\RequirePackage{csquotes}}
\@ifpackageloaded{ccicons}{}{\RequirePackage{ccicons}}
@@ -27,16 +48,6 @@
}
%% )))
-%% Parameters (((
-\DeclareStringOption[CC]{type}
-\DeclareStringOption[by-sa]{modifier}
-\DeclareStringOption{version}
-\DeclareStringOption{lang}
-\DeclareStringOption{imagemodifier}
-\DeclareStringOption[10em]{imagewidth}
-%% )))
-
-\ProcessLocalKeyvalOptions*
%% Declare variables (((
\newcommand{\doclicense@baseUrlCC}{https://creativecommons.org}
\newcommand{\doclicense@versionFallback}{}
@@ -64,7 +75,7 @@
\newcommand{\doclicenseModifier}{\doclicense@modifier@uppercase\xspace}
\newcommand{\doclicenseVersion}{\doclicense@versionUsed\xspace}
\newcommand{\doclicenseName}{%
- \doclicense@type~\doclicense@modifier@uppercase~%
+ \doclicense@type\nobreakspace\doclicense@modifier@uppercase\nobreakspace%
\doclicense@versionUsed\xspace%
}
\newcommand{\doclicenseNameRef}{\href{\doclicenseURL}{\doclicenseName}\xspace}
@@ -78,7 +89,7 @@
}
\newcommand{\doclicenseLongText}{%
\doclicense@lang@thisDoc\space
- \href{\doclicenseURL}{\doclicenseLongType\space\enquote{\doclicense@longName}}
+ \href{\doclicenseURL}{\doclicenseLongType\space\enquote{\doclicense@longName}}%
\doclicense@lang@word@license.\xspace%
}
\newcommand{\doclicenseIcon}{\doclicense@icon\xspace}
@@ -107,15 +118,17 @@
\newcommand{\doclicenseLicense}{\doclicenseThis} %% legacy support
\newcommand{\doclicenseThis}{%
\setlength{\doclicense@hsize}{\textwidth-\doclicense@imagewidth-2em}%
- \ifthenelse{\isnamedefined{iflandscape}}{%
- \iflandscape{%
- % \setlength{\doclicense@hsize}{\doclicense@hsize-10em}%
- }{}%
- }{}%
+ % \ifthenelse{\isnamedefined{iflandscape}}{%
+ % \iflandscape{%
+ % \setlength{\doclicense@hsize}{\doclicense@hsize-10em}%
+ % }{}%
+ % }{}%
% {%
- % \centering%
\begin{center}
\begin{minipage}{\doclicense@hsize}
+ \ifthenelse{\isempty{\doclicense@hyphenation}}{}{%
+ \@nameuse{\doclicense@hyphenation}%
+ }%
\doclicenseLongText%
\end{minipage}
\hfill