| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 2011-2017 by Michael Ummels <[email protected]> |
| 4 |
% |
| 5 |
% This work may be distributed and/or modified under the |
| 6 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 7 |
% of this license or (at your option) any later version. |
| 8 |
% The latest version of this license is in |
| 9 |
% http://www.latex-project.org/lppl.txt |
| 10 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 11 |
% version 2005/12/01 or later. |
| 12 |
% |
| 13 |
% This work has the LPPL maintenance status `maintained'. |
| 14 |
% |
| 15 |
% The Current Maintainer of this work is Michael Ummels. |
| 16 |
% |
| 17 |
% This work consists of the files ccicons.dtx, ccicons.ins |
| 18 |
% and the derived files ccicons.pdf and ccicons.sty. |
| 19 |
% |
| 20 |
% \fi |
| 21 |
% |
| 22 |
% \iffalse |
| 23 |
%<*driver> |
| 24 |
\ProvidesFile{ccicons.dtx}[2017/10/30 v1.6 LaTeX support for Creative Commons icons] |
| 25 |
%</driver> |
| 26 |
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
| 27 |
%<package>\ProvidesPackage{ccicons}[2017/10/30 v1.6 LaTeX support for Creative Commons icons] |
| 28 |
%<*driver> |
| 29 |
\documentclass{ltxdoc} |
| 30 |
|
| 31 |
\usepackage[T1]{fontenc} |
| 32 |
\usepackage{charter} |
| 33 |
\usepackage[scaled=1.05]{inconsolata} |
| 34 |
\usepackage{ccicons} |
| 35 |
\usepackage{longtable} |
| 36 |
\usepackage{hypdoc} |
| 37 |
\usepackage{microtype} |
| 38 |
|
| 39 |
\hypersetup{ |
| 40 |
bookmarksnumbered, |
| 41 |
colorlinks=false, |
| 42 |
pdfborder={0 0 0}, |
| 43 |
pdftitle={The ccicons package}, |
| 44 |
pdfauthor={Michael Ummels} |
| 45 |
} |
| 46 |
|
| 47 |
\newcommand{\pkg}[1]{\mbox{#1}} |
| 48 |
\newcommand{\typesetcc}[1]% |
| 49 |
{#1\,{\large #1}\,{\Large #1}\,{\LARGE #1}\,{\huge #1}\,{\Huge #1}} |
| 50 |
|
| 51 |
\EnableCrossrefs |
| 52 |
\CodelineIndex |
| 53 |
\RecordChanges |
| 54 |
|
| 55 |
\begin{document} |
| 56 |
\DocInput{ccicons.dtx} |
| 57 |
\end{document} |
| 58 |
%</driver> |
| 59 |
% \fi |
| 60 |
% |
| 61 |
% \CheckSum{249} |
| 62 |
% \CharacterTable |
| 63 |
% {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 |
| 64 |
% 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 |
| 65 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
| 66 |
% Exclamation \! Double quote \" Hash (number) \# |
| 67 |
% Dollar \$ Percent \% Ampersand \& |
| 68 |
% Acute accent \' Left paren \( Right paren \) |
| 69 |
% Asterisk \* Plus \+ Comma \, |
| 70 |
% Minus \- Point \. Solidus \/ |
| 71 |
% Colon \: Semicolon \; Less than \< |
| 72 |
% Equals \= Greater than \> Question mark \? |
| 73 |
% Commercial at \@ Left bracket \[ Backslash \\ |
| 74 |
% Right bracket \] Circumflex \^ Underscore \_ |
| 75 |
% Grave accent \` Left brace \{ Vertical bar \| |
| 76 |
% Right brace \} Tilde \~} |
| 77 |
% |
| 78 |
% \GetFileInfo{ccicons.dtx} |
| 79 |
% |
| 80 |
% \DoNotIndex{\newcommand} |
| 81 |
% |
| 82 |
% \title{\LaTeX\ support for Creative Commons Icons} |
| 83 |
% \author{Michael Ummels \\ \texttt{[email protected]}} |
| 84 |
% \date{\fileversion\ -- \filedate} |
| 85 |
% \maketitle |
| 86 |
% |
| 87 |
% \begin{abstract} |
| 88 |
% \noindent |
| 89 |
% This package offers authors who want to publish their documents under a |
| 90 |
% Creative Commons license an easy way to include the relevant icons |
| 91 |
% in their documents. |
| 92 |
% \end{abstract} |
| 93 |
% |
| 94 |
% \section{Introduction} |
| 95 |
% |
| 96 |
% Creative Commons (\url{http://creativecommons.org}) licenses have become |
| 97 |
% increasingly popular for authors who want to retain their copyright but give |
| 98 |
% other people the possibility to share and build upon their work. For each |
| 99 |
% of the licenses that Creative Commons offers, there exists a set of icons |
| 100 |
% that can be used to identify the respective license. This package defines |
| 101 |
% several commands that allow to typeset these icons. Since the icons are |
| 102 |
% stored in a PostScript Type 1 font, they can be scaled freely without |
| 103 |
% diminishing their visual appearance. |
| 104 |
% |
| 105 |
% Please note that all icons that can be typeset using this package are |
| 106 |
% trademarks of Creative Commons and are subject to the Creative Commons |
| 107 |
% trademark policy (see \url{http://creativecommons.org/policies}). |
| 108 |
% |
| 109 |
% \section{Usage} |
| 110 |
% |
| 111 |
% To use this package in your \LaTeX\ document, add |
| 112 |
% \begin{quote} |
| 113 |
% |\usepackage|\oarg{options}|{ccicons}| |
| 114 |
% \end{quote} |
| 115 |
% to the preamble of your document. For the available options see |
| 116 |
% Section~\ref{sec:options}. |
| 117 |
% |
| 118 |
% After the package has been loaded, the following commands can |
| 119 |
% be used to typeset the icons provided by CreativecCommons. |
| 120 |
% |
| 121 |
% \begin{longtable}[l]{ll} |
| 122 |
% |\ccLogo| & \typesetcc{\ccLogo} \\[1ex] |
| 123 |
% |\ccAttribution| & \typesetcc{\ccAttribution} \\[1ex] |
| 124 |
% |\ccShareAlike| & \typesetcc{\ccShareAlike} \\[1ex] |
| 125 |
% |\ccNoDerivatives| & \typesetcc{\ccNoDerivatives} \\[1ex] |
| 126 |
% |\ccNonCommercial| & \typesetcc{\ccNonCommercial} \\[1ex] |
| 127 |
% |\ccNonCommercialEU| & \typesetcc{\ccNonCommercialEU} \\[1ex] |
| 128 |
% |\ccNonCommercialJP| & \typesetcc{\ccNonCommercialJP} \\[1ex] |
| 129 |
% |\ccZero| & \typesetcc{\ccZero} \\[1ex] |
| 130 |
% |\ccPublicDomain| & \typesetcc{\ccPublicDomain} \\[1ex] |
| 131 |
% |\ccPublicDomainAlt| & \typesetcc{\ccPublicDomainAlt} \\[1ex] |
| 132 |
% |\ccSampling| & \typesetcc{\ccSampling} \\[1ex] |
| 133 |
% |\ccShare| & \typesetcc{\ccShare} \\[1ex] |
| 134 |
% |\ccRemix| & \typesetcc{\ccRemix} \\[1ex] |
| 135 |
% |\ccCopy| & \typesetcc{\ccCopy} |
| 136 |
% \end{longtable} |
| 137 |
% |
| 138 |
% \noindent |
| 139 |
% Additionally, for each of the common Creative Commons licenses there is a |
| 140 |
% command to typeset the CC logo together with the icons applicable for that |
| 141 |
% license (see \url{http://creativecommons.org/licenses}): |
| 142 |
% |
| 143 |
% \medskip\noindent |
| 144 |
% \begin{tabular}{ll} |
| 145 |
% |\ccby| & \ccby \\ |
| 146 |
% |\ccbysa| & \ccbysa \\ |
| 147 |
% |\ccbynd| & \ccbynd \\ |
| 148 |
% |\ccbync| & \ccbync \\ |
| 149 |
% |\ccbynceu| & \ccbynceu \\ |
| 150 |
% |\ccbyncjp| & \ccbyncjp \\ |
| 151 |
% |\ccbyncsa| & \ccbyncsa \\ |
| 152 |
% |\ccbyncsaeu| & \ccbyncsaeu \\ |
| 153 |
% |\ccbyncsajp| & \ccbyncsajp \\ |
| 154 |
% |\ccbyncnd| & \ccbyncnd \\ |
| 155 |
% |\ccbyncndeu| & \ccbyncndeu \\ |
| 156 |
% |\ccbyncndjp| & \ccbyncndjp \\ |
| 157 |
% |\cczero| & \cczero \\ |
| 158 |
% |\ccpd| & \ccpd |
| 159 |
% \end{tabular} |
| 160 |
% |
| 161 |
% \section{Options}\label{sec:options} |
| 162 |
% |
| 163 |
% Currently, the \pkg{ccicons} package supports two options. |
| 164 |
% First, the |scale=|\meta{factor} option allows to scale all |
| 165 |
% icons by an arbitrary factor. For example, to typeset the icons |
| 166 |
% at 90\% of their original size, load the package with the |
| 167 |
% option |scale=0.9|. Second, if the |copyright| option is |
| 168 |
% enabled, the command |\textcopyright| is redefined so that |
| 169 |
% it behaves like |\ccCopy|. |
| 170 |
% |
| 171 |
% \StopEventually{} |
| 172 |
% |
| 173 |
% \section{Implementation} |
| 174 |
% |
| 175 |
% \iffalse |
| 176 |
%<*package> |
| 177 |
% \fi |
| 178 |
% |
| 179 |
% We use \pkg{xkeyval}'s key mechanism to declare all options. |
| 180 |
% The first option controls whether |\textcopyright| is redefined. |
| 181 |
% \begin{macrocode} |
| 182 |
\RequirePackage{xkeyval} |
| 183 |
\define@boolkey{ccicons.sty}[ccicons@]{copyright}[true]{} |
| 184 |
% \end{macrocode} |
| 185 |
% The next option allows to scale the font by an arbitrary factor. |
| 186 |
% \begin{macrocode} |
| 187 |
\newcommand{\ccicons@scale}{1.0} |
| 188 |
\define@key{ccicons.sty}{scale}{\renewcommand\ccicons@scale{#1}} |
| 189 |
% \end{macrocode} |
| 190 |
% Process all options. |
| 191 |
% \begin{macrocode} |
| 192 |
\ProcessOptionsX |
| 193 |
% \end{macrocode} |
| 194 |
% We just declare one font family with one shape. |
| 195 |
% \begin{macrocode} |
| 196 |
\DeclareFontFamily{U}{ccicons}{} |
| 197 |
\DeclareFontShape{U}{ccicons}{m}{n}{ |
| 198 |
<-> s * [\ccicons@scale] ccicons |
| 199 |
}{} |
| 200 |
% \end{macrocode} |
| 201 |
% We provide internal commands to access the characters of the font |
| 202 |
% directly. |
| 203 |
% \begin{macrocode} |
| 204 |
\newcommand{\ccicons@font}{\usefont{U}{ccicons}{m}{n}} |
| 205 |
\newcommand{\ccicons@logo}{\char0} |
| 206 |
\newcommand{\ccicons@by}{\char1} |
| 207 |
\newcommand{\ccicons@sa}{\char2} |
| 208 |
\newcommand{\ccicons@nd}{\char3} |
| 209 |
\newcommand{\ccicons@nc}{\char4} |
| 210 |
\newcommand{\ccicons@nceu}{\char5} |
| 211 |
\newcommand{\ccicons@ncjp}{\char6} |
| 212 |
\newcommand{\ccicons@pd}{\char7} |
| 213 |
\newcommand{\ccicons@zero}{\char8} |
| 214 |
\newcommand{\ccicons@sampling}{\char9} |
| 215 |
\newcommand{\ccicons@share}{\char10} |
| 216 |
\newcommand{\ccicons@remix}{\char11} |
| 217 |
\newcommand{\ccicons@copy}{\char12} |
| 218 |
\newcommand{\ccicons@pdalt}{\char13} |
| 219 |
% \end{macrocode} |
| 220 |
% The following commands provide high-level access to to the font. We |
| 221 |
% define a command for each character in the font. |
| 222 |
% \begin{macrocode} |
| 223 |
\newcommand{\ccLogo}{{\ccicons@font\ccicons@logo}} |
| 224 |
\newcommand{\ccAttribution}{{\ccicons@font\ccicons@by}} |
| 225 |
\newcommand{\ccShareAlike}{{\ccicons@font\ccicons@sa}} |
| 226 |
\newcommand{\ccNoDerivatives}{{\ccicons@font\ccicons@nd}} |
| 227 |
\newcommand{\ccNonCommercial}{{\ccicons@font\ccicons@nc}} |
| 228 |
\newcommand{\ccNonCommercialEU}{{\ccicons@font\ccicons@nceu}} |
| 229 |
\newcommand{\ccNonCommercialJP}{{\ccicons@font\ccicons@ncjp}} |
| 230 |
\newcommand{\ccPublicDomain}{{\ccicons@font\ccicons@pd}} |
| 231 |
\newcommand{\ccPublicDomainAlt}{{\ccicons@font\ccicons@pdalt}} |
| 232 |
\newcommand{\ccZero}{{\ccicons@font\ccicons@zero}} |
| 233 |
\newcommand{\ccSampling}{{\ccicons@font\ccicons@sampling}} |
| 234 |
\newcommand{\ccShare}{{\ccicons@font\ccicons@share}} |
| 235 |
\newcommand{\ccRemix}{{\ccicons@font\ccicons@remix}} |
| 236 |
\newcommand{\ccCopy}{{\ccicons@font\ccicons@copy}} |
| 237 |
% \end{macrocode} |
| 238 |
% If the copyright option has been set, we redefine |\textcopyright|. |
| 239 |
% \begin{macrocode} |
| 240 |
\ifccicons@copyright\renewcommand{\textcopyright}{\ccCopy}\fi |
| 241 |
% \end{macrocode} |
| 242 |
% Finally, for each CC license we define a command that prints the CC logo |
| 243 |
% together with the icons applicable for that license. |
| 244 |
% \begin{macrocode} |
| 245 |
\newcommand{\ccby}% |
| 246 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by}} |
| 247 |
\newcommand{\ccbysa}% |
| 248 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 249 |
\kern0.1em\ccicons@sa}} |
| 250 |
\newcommand{\ccbynd}% |
| 251 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 252 |
\kern0.1em\ccicons@nd}} |
| 253 |
\newcommand{\ccbync}% |
| 254 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 255 |
\kern0.1em\ccicons@nc}} |
| 256 |
\newcommand{\ccbynceu}% |
| 257 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 258 |
\kern0.1em\ccicons@nceu}} |
| 259 |
\newcommand{\ccbyncjp}% |
| 260 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 261 |
\kern0.1em\ccicons@ncjp}} |
| 262 |
\newcommand{\ccbyncsa}% |
| 263 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 264 |
\kern0.1em\ccicons@nc\kern0.1em\ccicons@sa}} |
| 265 |
\newcommand{\ccbyncsaeu}% |
| 266 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 267 |
\kern0.1em\ccicons@nceu\kern0.1em\ccicons@sa}} |
| 268 |
\newcommand{\ccbyncsajp}% |
| 269 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 270 |
\kern0.1em\ccicons@ncjp\kern0.1em\ccicons@sa}} |
| 271 |
\newcommand{\ccbyncnd}% |
| 272 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 273 |
\kern0.1em\ccicons@nc\kern0.1em\ccicons@nd}} |
| 274 |
\newcommand{\ccbyncndeu}% |
| 275 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 276 |
\kern0.1em\ccicons@nceu\kern0.1em\ccicons@nd}} |
| 277 |
\newcommand{\ccbyncndjp}% |
| 278 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@by% |
| 279 |
\kern0.1em\ccicons@ncjp\kern0.1em\ccicons@nd}} |
| 280 |
\newcommand{\cczero}% |
| 281 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@zero}} |
| 282 |
\newcommand{\ccpd}% |
| 283 |
{\mbox{\ccicons@font\ccicons@logo\kern0.1em\ccicons@pd}} |
| 284 |
% \end{macrocode} |
| 285 |
% |
| 286 |
% \iffalse |
| 287 |
%</package> |
| 288 |
% \fi |
| 289 |
% |
| 290 |
% \section{Version history} |
| 291 |
% |
| 292 |
% Version 1.0 (2009/11/29): Initial version \\ |
| 293 |
% Version 1.1 (2009/12/14): New font with additional glyphs \\ |
| 294 |
% Version 1.2 (2011/05/22): Optimised some glyphs \\ |
| 295 |
% Version 1.3 (2011/09/18): Merged font definitions into style file \\ |
| 296 |
% Version 1.4 (2012/05/22): Added copyright logo, adjusted vertical |
| 297 |
% alignment, and added scale option \\ |
| 298 |
% Version 1.5 (2013/04/16): Relicensed font components and included |
| 299 |
% OpenType font. \\ |
| 300 |
% Version 1.6 (2017/10/30): Incorporated new Public Domain icon |
| 301 |
% |
| 302 |
% |
| 303 |
% \Finale |
| 304 |
% \endinput |
| 305 |
% |
| 306 |
% \iffalse |
| 307 |
%<*test> |
| 308 |
% \fi |
| 309 |
% \begin{macrocode} |
| 310 |
\documentclass[a4paper]{article} |
| 311 |
|
| 312 |
\usepackage[copyright]{ccicons} |
| 313 |
|
| 314 |
\setlength{\parindent}{0pt} |
| 315 |
\pagestyle{empty} |
| 316 |
|
| 317 |
\begin{document} |
| 318 |
\ccLogo |
| 319 |
\ccAttribution |
| 320 |
\ccShareAlike |
| 321 |
\ccNoDerivatives |
| 322 |
\ccNonCommercial |
| 323 |
\ccNonCommercialJP |
| 324 |
\ccZero |
| 325 |
\ccPublicDomain |
| 326 |
\ccPublicDomainAlt |
| 327 |
\ccSampling |
| 328 |
\ccShare |
| 329 |
\ccRemix |
| 330 |
\ccCopy |
| 331 |
|
| 332 |
\textcopyright |
| 333 |
|
| 334 |
\ccby |
| 335 |
|
| 336 |
\ccbysa |
| 337 |
|
| 338 |
\ccbynd |
| 339 |
|
| 340 |
\ccbync |
| 341 |
|
| 342 |
\ccbynceu |
| 343 |
|
| 344 |
\ccbyncjp |
| 345 |
|
| 346 |
\ccbyncsa |
| 347 |
|
| 348 |
\ccbyncsaeu |
| 349 |
|
| 350 |
\ccbyncsajp |
| 351 |
|
| 352 |
\ccbyncnd |
| 353 |
|
| 354 |
\ccbyncndeu |
| 355 |
|
| 356 |
\ccbyncndjp |
| 357 |
|
| 358 |
\cczero |
| 359 |
|
| 360 |
\ccpd |
| 361 |
\end{document} |
| 362 |
% \end{macrocode} |
| 363 |
% |
| 364 |
% \iffalse |
| 365 |
%</test> |
| 366 |
% \fi |