summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/doclicense
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-12-14 22:15:54 +0000
committerKarl Berry <karl@freefriends.org>2015-12-14 22:15:54 +0000
commit8ddd6b4ba63f067dc85acbac4f16803d0f80b83a (patch)
tree27ac56b7cb5466fc8537887be27de858b582b33d /Master/texmf-dist/source/latex/doclicense
parent07baf77b14843abe466fcf370ce5637ee6964fcf (diff)
doclicense (14dec15)
git-svn-id: svn://tug.org/texlive/trunk@39107 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/doclicense')
-rw-r--r--Master/texmf-dist/source/latex/doclicense/doclicense.dtx86
1 files changed, 74 insertions, 12 deletions
diff --git a/Master/texmf-dist/source/latex/doclicense/doclicense.dtx b/Master/texmf-dist/source/latex/doclicense/doclicense.dtx
index 6d80ce8cfa1..91670cf3526 100644
--- a/Master/texmf-dist/source/latex/doclicense/doclicense.dtx
+++ b/Master/texmf-dist/source/latex/doclicense/doclicense.dtx
@@ -27,7 +27,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1998/12/01]
%<package>\ProvidesPackage{doclicense}
%<*package>
- [2015/08/04 v1.3 Support for putting documents under a license]
+ [2015/12/13 v1.4.0 Support for putting documents under a license]
%</package>
%
%<*driver>
@@ -57,6 +57,8 @@
xspace,
eqlist,
}
+%% ^^A https://tex.stackexchange.com/a/95893/32320
+\setlength\IndexMin{100pt}
\usepackage{doclicense}
\GetFileInfo{doclicense.dtx}
\hypersetup{
@@ -115,9 +117,9 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
% \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.3}{2015/08/04}{Added \cmd{\doclicenseTypeIcon} macro. Added French translation. Added note about target images/ subtree.}
+% \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.}
%
-% %% nag warned about the center environment and it really messes up spacing.
+%% ^^A nag warned about the center environment and it really messes up spacing.
%
% \DoNotIndex{\RequirePackage, \DeclareOption, \ProcessOptions}
% \DoNotIndex{\PackageWarning, \MessageBreak}
@@ -280,6 +282,27 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
% Same as \cmd{\doclicenseText} except that it uses the long name of the license.
% Example: \enquote{\doclicenseLongText{}}
%
+% \DescribeMacro{\doclicensePlainFullText}
+% Verbatim prints the full license text.
+%
+% ^^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.
+%
+% \DescribeMacro{\doclicenseFullText}
+% Nicely prints the full license text.
+%
+% ^^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.
+%
+%
% \DescribeMacro{\doclicenseIcon}
% Expands to a icon of the license. Example:
% \enquote{\doclicenseIcon{}}. This macro is based on the
@@ -291,7 +314,7 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
% \PrintPackage{ccicons} package.
%
% \DescribeMacro{\doclicenseImage}
-% This is kind of similar with \cmd{\doclicenseIcon} but it will typeset an
+% This is kind of similar to \cmd{\doclicenseIcon} but it will typeset an
% bigger pictogram of the license. Example:
% \enquote{\doclicenseImage}
%
@@ -303,7 +326,7 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
% |\doclicenseImage[imagewidth=2em]|
% \end{quote}
%
-% The images are bundled with the \PackageName package.
+% The images are bundled with the \PackageName package as vector graphics.
%
% \DescribeMacro{\doclicenseImageFileName}
% This macro expands to the file name of the image which the
@@ -365,6 +388,20 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
% via Email or preferably by opening a pull request on GitHub so that I can
% include them in the next release.
%
+% \section{Plaintext license text}
+% \label{sec:plain_license_text}
+%
+% The following is an example output of the \cmd{\doclicensePlainFullText} macro.
+%
+% \doclicensePlainFullText
+%
+% \section{Pretty license text}
+% \label{sec:pretty_license_text}
+%
+% The following is an example output of the \cmd{\doclicenseFullText} macro.
+%
+% \doclicenseFullText
+%
% \StopEventually{}
%
% \newpage
@@ -381,6 +418,7 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
\RequirePackage{xifthen}
\RequirePackage{etoolbox} %% \ifcsdef
\RequirePackage{xspace}
+\RequirePackage{verbatim}
\AtEndPreamble{%
\@ifpackageloaded{csquotes}{}{\RequirePackage{csquotes}}
\@ifpackageloaded{ccicons}{}{\RequirePackage{ccicons}}
@@ -433,7 +471,11 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
\PackageError{doclicense}{Icon not defined}
{Please check the documentation of doclicense to see what you can do about it.}%
}
-\newcommand{\doclicense@modifier@uppercase}{\texorpdfstring{\MakeUppercase{\doclicense@modifier}}{\doclicense@modifier}}
+\newcommand{\doclicense@modifier@uppercase}{\texorpdfstring{%
+ \MakeUppercase{\doclicense@modifier}%
+ }{%
+ \doclicense@modifier}%
+}
%% )))
% \end{macrocode}
@@ -445,14 +487,17 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
\newcommand{\doclicenseModifier}{\doclicense@modifier@uppercase\xspace}
\newcommand{\doclicenseVersion}{\doclicense@versionUsed\xspace}
\newcommand{\doclicenseName}{%
- \doclicense@type~\doclicense@modifier@uppercase~\doclicense@versionUsed\xspace%
+ \doclicense@type~\doclicense@modifier@uppercase~%
+ \doclicense@versionUsed\xspace%
}
\newcommand{\doclicenseNameRef}{\href{\doclicenseURL}{\doclicenseName}\xspace}
-\newcommand{\doclicenseLongName}{\doclicenseLongType\space\doclicense@longName\xspace}
+\newcommand{\doclicenseLongName}{\doclicenseLongType\space%
+ \doclicense@longName\xspace}
\newcommand{\doclicenseLongNameRef}{\href{\doclicenseURL}{\doclicenseLongName}}
\newcommand{\doclicenseText}{%
\doclicense@lang@thisDoc\space
- \href{\doclicenseURL}{\enquote{\doclicenseName{}}} \doclicense@lang@word@license.\xspace%
+ \href{\doclicenseURL}{\enquote{\doclicenseName{}}}
+ \doclicense@lang@word@license.\xspace%
}
\newcommand{\doclicenseLongText}{%
\doclicense@lang@thisDoc\space
@@ -462,7 +507,8 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
\newcommand{\doclicenseIcon}{\doclicense@icon\xspace}
\newcommand{\doclicenseTypeIcon}{\doclicenseType}
% \newcommand{\doclicenseModifierIcon}{} %% Not directly provided by ccicons.
-\newcommand{\doclicenseImageFileName}{doclicense-\doclicense@type-\doclicense@modifier\doclicense@imagemodifier}
+\newcommand{\doclicenseImageFileName}{%
+ doclicense-\doclicense@type-\doclicense@modifier\doclicense@imagemodifier}
\newcommand{\doclicenseImage}[1][]{%
\setkeys{doclicense}{#1}
\href{\doclicenseURL}{%
@@ -471,6 +517,16 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
]{\doclicenseImageFileName}%
}
}
+\newcommand{\doclicensePlainFullTextFileName}{%
+ doclicense-\doclicense@type-\doclicense@modifier%
+ -\doclicense@versionUsed-plaintext
+}
+\newcommand{\doclicensePlainFullText}{%
+ \verbatiminput{\doclicensePlainFullTextFileName}
+}
+\newcommand{\doclicenseFullTextFileName}{%
+ doclicense-\doclicense@type-\doclicense@modifier-\doclicense@versionUsed-latex}
+\newcommand{\doclicenseFullText}{\input{\doclicenseFullTextFileName}}
\newcommand{\doclicenseLicense}{\doclicenseThis} %% legacy support
\newcommand{\doclicenseThis}{%
@@ -621,14 +677,20 @@ corresponds to \PackageName~\fileversion, dated \filedate.}}
@\doclicense@modifier @\doclicense@versionUsed}{}{%
\PackageError{doclicense}{License long name not defined}%
- {Please check the documentation of doclicense to see what you can do about it.}%
+ {%
+ Please check the documentation of doclicense
+ to see what you can do about it.%
+ }%
}
\setboolean{doclicense@licenseKnown}{true}
}{}%% )))
\ifthenelse{\not\boolean{doclicense@licenseKnown}}{%
\PackageError{doclicense}{License unknown}%
- {Please check the documentation of doclicense to see what you can do about it.}%
+ {%
+ Please check the documentation of doclicense
+ to see what you can do about it.%
+ }%
}{}%
}
%% )))