| 1 |
% |
| 2 |
% \iffalse meta-comment |
| 3 |
% |
| 4 |
% metastr.dtx Copyright (C) 2020-2025 Niklas Beisert |
| 5 |
% |
| 6 |
% This work may be distributed and/or modified under the |
| 7 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 8 |
% of this license or (at your option) any later version. |
| 9 |
% The latest version of this license is in |
| 10 |
% https://www.latex-project.org/lppl.txt |
| 11 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 12 |
% version 2008 or later. |
| 13 |
% |
| 14 |
% This work has the LPPL maintenance status `maintained'. |
| 15 |
% |
| 16 |
% The Current Maintainer of this work is Niklas Beisert. |
| 17 |
% |
| 18 |
% This work consists of the files metastr.dtx and metastr.ins |
| 19 |
% and the derived files metastr.sty and metasamp.tex. |
| 20 |
% |
| 21 |
%<package|sample>\NeedsTeXFormat{LaTeX2e}[1996/12/01] |
| 22 |
%<package>\ProvidesPackage{metastr}[2025/03/25 v1.1.3 Metadata Strings Storage] |
| 23 |
%<sample>\ProvidesFile{metasamp.tex}[2025/03/25 v1.1.3 sample for metastr] |
| 24 |
%<*driver> |
| 25 |
\def\thedate#1{2025/03/25}\def\theversion#1{v1.1.3} |
| 26 |
\ProvidesFile{metastr.dtx}[\thedate{} \theversion{} metastr reference manual file] |
| 27 |
\PassOptionsToClass{10pt,a4paper}{article} |
| 28 |
\documentclass{ltxdoc} |
| 29 |
|
| 30 |
\usepackage[margin=35mm]{geometry} |
| 31 |
\usepackage[hyperindex=false]{hyperref} |
| 32 |
\usepackage{hyperxmp} |
| 33 |
\usepackage[usenames]{color} |
| 34 |
\usepackage[utf8]{inputenc} |
| 35 |
\usepackage{babel} |
| 36 |
\usepackage{graphicx} |
| 37 |
\usepackage{ccicons} |
| 38 |
\newcommand{\translate}[1]{\ignorespaces} |
| 39 |
|
| 40 |
\IfFileExists{doclicense.sty}{}{% |
| 41 |
\GenericWarning{please install package `doclicense'}} |
| 42 |
|
| 43 |
\AddToHook{begindocument/before}{\hypersetup{colorlinks=false}} |
| 44 |
\hypersetup{urlbordercolor={.5 1 1}} |
| 45 |
\hypersetup{linkbordercolor={1 .7 .7}} |
| 46 |
\AddToHook{begindocument/before}{\hypersetup{pdfstartview=FitH}} |
| 47 |
\hypersetup{keeppdfinfo=true} |
| 48 |
\hypersetup{pdfsource={}} |
| 49 |
\hypersetup{pdflang={en-UK}} |
| 50 |
\hypersetup{pdfurl={https://ctan.org/pkg/metastr}} |
| 51 |
\hypersetup{pdfcopyright={Copyright 2020-2025 Niklas Beisert. |
| 52 |
This work may be distributed and/or modified under the |
| 53 |
conditions of the LaTeX Project Public License, either version 1.3 |
| 54 |
of this license or (at your option) any later version.}} |
| 55 |
\hypersetup{pdflicenseurl={https://www.latex-project.org/lppl.txt}} |
| 56 |
\hypersetup{pdfcontactaddress={ETH Zurich, ITP, HIT K, |
| 57 |
Wolfgang-Pauli-Strasse 27}} |
| 58 |
\hypersetup{pdfcontactpostcode={8093}} |
| 59 |
\hypersetup{pdfcontactcity={Zurich}} |
| 60 |
\hypersetup{pdfcontactcountry={Switzerland}} |
| 61 |
\hypersetup{pdfcontactemail={[email protected]}} |
| 62 |
\hypersetup{pdfcontacturl={https://people.phys.ethz.ch/\xmptilde nbeisert/}} |
| 63 |
|
| 64 |
\newcommand{\markpkg}[1]{\textsf{#1}} |
| 65 |
\newcommand{\secref}[1]{\hyperref[#1]{section \ref*{#1}}} |
| 66 |
\newcommand{\ctanref}[2]{\href{https://ctan.org/#1}{#2}} |
| 67 |
\newcommand{\ctanpkg}[1]{\ctanref{pkg/#1}{\markpkg{#1}}} |
| 68 |
|
| 69 |
\def\textvert{\texttt{\char"7C}} |
| 70 |
|
| 71 |
\parskip1ex |
| 72 |
\parindent0pt |
| 73 |
\let\olditemize\itemize |
| 74 |
\def\itemize{\olditemize\parskip0pt} |
| 75 |
|
| 76 |
\begin{document} |
| 77 |
|
| 78 |
\title{The \markpkg{metastr} Package} |
| 79 |
\hypersetup{pdftitle={The metastr Package}} |
| 80 |
\author{Niklas Beisert\\[2ex] |
| 81 |
Institut f\"ur Theoretische Physik\\ |
| 82 |
Eidgen\"ossische Technische Hochschule Z\"urich\\ |
| 83 |
Wolfgang-Pauli-Strasse 27, 8093 Z\"urich, Switzerland\\[1ex] |
| 84 |
\href{mailto:[email protected]} |
| 85 |
{\texttt{[email protected]}}} |
| 86 |
\hypersetup{pdfauthor={Niklas Beisert}} |
| 87 |
\hypersetup{pdfsubject={Manual for the LaTeX2e Package metastr}} |
| 88 |
\date{\thedate{}, \theversion{}\\[1ex] |
| 89 |
\url{https://ctan.org/pkg/metastr}} |
| 90 |
\maketitle |
| 91 |
|
| 92 |
\begin{abstract}\noindent |
| 93 |
\markpkg{metastr} is a \LaTeXe{} package |
| 94 |
to store and compose strings in a structured way. |
| 95 |
This can serve several purposes such as: |
| 96 |
manage and write document metadata; |
| 97 |
use templates for formatting document data; |
| 98 |
assist in assembling and displaying document license information; |
| 99 |
facilitate basic internationalisation and localisation. |
| 100 |
\end{abstract} |
| 101 |
|
| 102 |
\begingroup |
| 103 |
\parskip0ex |
| 104 |
\tableofcontents |
| 105 |
\endgroup |
| 106 |
|
| 107 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 108 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 109 |
\section{Introduction} |
| 110 |
|
| 111 |
This package provides some basic functionality |
| 112 |
to store and compose strings. |
| 113 |
The main goal is to keep relevant information |
| 114 |
for the document in a structured way |
| 115 |
such that it can be accessed and used by conveniently |
| 116 |
using some standardised methods. |
| 117 |
|
| 118 |
The package has the following goals, tasks and features: |
| 119 |
% |
| 120 |
\begin{itemize} |
| 121 |
\item |
| 122 |
manage document metadata and write them to the PDF output file; |
| 123 |
\item |
| 124 |
set up and use templates for formatting document data, e.g.\ for title pages; |
| 125 |
\item |
| 126 |
assist in assembling and displaying document license information; |
| 127 |
\item |
| 128 |
facilitate basic internationalisation and localisation; |
| 129 |
\item |
| 130 |
provide preset texts and common license statements |
| 131 |
in different languages. |
| 132 |
\end{itemize} |
| 133 |
% |
| 134 |
Using the structures provided by the packages makes particular sense |
| 135 |
if you can rely on predefined text and formatting or if you have a couple |
| 136 |
of similar documents for which you can define suitable templates. |
| 137 |
|
| 138 |
|
| 139 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 140 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 141 |
\section{Usage} |
| 142 |
\label{sec:usage} |
| 143 |
|
| 144 |
To use the package \ctanpkg{metastr}, add the command |
| 145 |
% |
| 146 |
\begin{center} |
| 147 |
|\usepackage{metastr}| |
| 148 |
\end{center} |
| 149 |
% |
| 150 |
to the preamble of the \LaTeX{} document. |
| 151 |
|
| 152 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 153 |
\subsection{Defining Strings} |
| 154 |
\label{sec:def} |
| 155 |
|
| 156 |
\DescribeMacro{\metadef} |
| 157 |
\DescribeMacro{\metaset} |
| 158 |
The package supplies registers for storing data. |
| 159 |
Registers need to be declared before they can be filled or used |
| 160 |
(unless the package option |checkdef=false| is set, |
| 161 |
see \secref{sec:options}). |
| 162 |
A new register \textit{reg} is declared by the command: |
| 163 |
% |
| 164 |
\begin{center} |
| 165 |
|\metadef{|\textit{reg}|}| |
| 166 |
\end{center} |
| 167 |
% |
| 168 |
The register \textit{reg} can be filled |
| 169 |
with the value \textit{def} |
| 170 |
by the command: |
| 171 |
% |
| 172 |
\begin{center} |
| 173 |
|\metaset{|\textit{reg}|}{|\textit{def}|}| |
| 174 |
\end{center} |
| 175 |
% |
| 176 |
|
| 177 |
The package declares a couple of registers for storing standard metadata. |
| 178 |
The basic set of registers consists of: |
| 179 |
% |
| 180 |
\begin{center} |
| 181 |
\begin{tabular}{ll} |
| 182 |
|title| & document title |
| 183 |
\\ |
| 184 |
|subtitle| & document subtitle |
| 185 |
\\ |
| 186 |
|author| & document author |
| 187 |
\\ |
| 188 |
|location| & location associated to the document |
| 189 |
\\ |
| 190 |
|date| & document date |
| 191 |
\\ |
| 192 |
|subject| & `subject' of the document |
| 193 |
\\ |
| 194 |
|keywords| & (a list of) keywords describing the document |
| 195 |
\\ |
| 196 |
|titlematter| & composition register for title matter |
| 197 |
\\ |
| 198 |
|titletext| & composition register for title |
| 199 |
\\ |
| 200 |
|authortext| & composition register for author |
| 201 |
\\ |
| 202 |
|datatext| & composition register for location and date |
| 203 |
\end{tabular} |
| 204 |
\end{center} |
| 205 |
% |
| 206 |
|
| 207 |
The register |titletext| composes information |
| 208 |
for printing the title |
| 209 |
(such as |title|, |subtitle| but also |author|, |location| and |date|). |
| 210 |
It can serve a similar purpose as the \LaTeX{} command |\maketitle|. |
| 211 |
|
| 212 |
Finally, there are some auxiliary registers: |
| 213 |
% |
| 214 |
\begin{center} |
| 215 |
\begin{tabular}{ll} |
| 216 |
|language| & |
| 217 |
main language of the document |
| 218 |
\\ |
| 219 |
|url| & |
| 220 |
URL of the document or additional info on it |
| 221 |
\\ |
| 222 |
|urlmessage| & |
| 223 |
message to describe the document URL |
| 224 |
\\ |
| 225 |
|source| & |
| 226 |
name of the source file |
| 227 |
\\ |
| 228 |
|draft| & |
| 229 |
indicator of draft version |
| 230 |
\\ |
| 231 |
|linebreak| & |
| 232 |
expands to linebreak when printed or space otherwise |
| 233 |
\end{tabular} |
| 234 |
\end{center} |
| 235 |
% |
| 236 |
The register |language| specifies |
| 237 |
the main language used in the document. |
| 238 |
This should be a two-letter language code (\textit{ln}) |
| 239 |
potentially followed by two-letter country code |
| 240 |
(\textit{ln}|-|\textit{CN}) such as |en| or |en-GB|. |
| 241 |
The language has some impact on selecting |
| 242 |
register variants, see \secref{sec:variants} and \secref{sec:language}, |
| 243 |
it should therefore be set by the command: |
| 244 |
% |
| 245 |
\begin{center} |
| 246 |
|\metasetlang|[|*|]|{|\textit{ln-CN}|}| |
| 247 |
\end{center} |
| 248 |
% |
| 249 |
The starred version declares the language for PDF metadata |
| 250 |
rather than the document contents. |
| 251 |
|
| 252 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 253 |
\subsection{Working with Strings} |
| 254 |
\label{sec:work} |
| 255 |
|
| 256 |
\DescribeMacro{\metaget} |
| 257 |
A register \textit{reg} can be read out by the macro: |
| 258 |
% |
| 259 |
\begin{center} |
| 260 |
|\metaget[]{|\textit{reg}|}{|\textit{def}|}| |
| 261 |
\end{center} |
| 262 |
% |
| 263 |
Note that the (empty) argument in square brackets is mandatory, |
| 264 |
it cannot be left out, see \secref{sec:variants} |
| 265 |
for further details on its purpose. |
| 266 |
This is because |\metaget| must be robust so that its output |
| 267 |
can be processed for writing (optional arguments make a macro fragile). |
| 268 |
In case the register \textit{reg} has not been filled, |
| 269 |
|\metaget| returns nothing. |
| 270 |
|
| 271 |
\DescribeMacro{\metaif} |
| 272 |
Sometimes one may want to test whether a register is filled or not, |
| 273 |
e.g.\ in order to display a default value otherwise. |
| 274 |
This can be achieved by the conditional: |
| 275 |
% |
| 276 |
\begin{center} |
| 277 |
|\metaif[]{|\textit{reg}|}{|\textit{true}|}{|\textit{false}|}| |
| 278 |
\end{center} |
| 279 |
% |
| 280 |
If the register \textit{reg} is filled, return \textit{true} |
| 281 |
otherwise \textit{false}. |
| 282 |
Again, the argument in square brackets is mandatory. |
| 283 |
|
| 284 |
\DescribeMacro{\metaunset} |
| 285 |
The following command cleans a register \textit{reg} |
| 286 |
which has previously been filled: |
| 287 |
% |
| 288 |
\begin{center} |
| 289 |
|\metaunset{|\textit{reg}|}| |
| 290 |
\end{center} |
| 291 |
% |
| 292 |
Note that cleaning is different from filling an empty string |
| 293 |
when it comes to the conditional |\metaif| |
| 294 |
which evaluates true for an empty string but false for a clean register. |
| 295 |
|
| 296 |
\DescribeMacro{\metaappend} |
| 297 |
\DescribeMacro{\metaprepend} |
| 298 |
\DescribeMacro{\metaaddsep} |
| 299 |
The content of registers can be manipulated by some commands. |
| 300 |
To append or prepend a string to a register, |
| 301 |
use the commands: |
| 302 |
% |
| 303 |
\begin{center} |
| 304 |
\begin{tabular}{l} |
| 305 |
|\metaappend{|\textit{reg}|}{|\textit{def}|}|\\ |
| 306 |
|\metaprepend{|\textit{reg}|}{|\textit{def}|}|\\ |
| 307 |
|\metaaddsep{|\textit{reg}|}{|\textit{sep}|}{|\textit{def}|}| |
| 308 |
\end{tabular} |
| 309 |
\end{center} |
| 310 |
% |
| 311 |
The latter command |\metaaddsep| is designed to compose lists with separators, |
| 312 |
it appends the separator \textit{sep} |
| 313 |
and the value \textit{def} unless the register is clean, |
| 314 |
in which case it is set to \textit{def} without the separator \textit{sep}. |
| 315 |
|
| 316 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 317 |
\subsection{String Variants} |
| 318 |
\label{sec:variants} |
| 319 |
|
| 320 |
A versatile feature of the registers is that they can be provided |
| 321 |
in several variants. |
| 322 |
These variants can be used for producing different representations |
| 323 |
of the same register depending on the intended situation. |
| 324 |
For example, a title could be given in a fully formatted version |
| 325 |
|print| for printing, a bare version for metadata |
| 326 |
and a shortened version for headings. |
| 327 |
Similarly, translations to different languages |
| 328 |
could be stored as different versions of the same register, |
| 329 |
see \secref{sec:language}. |
| 330 |
Moreover, certain attributes related to the registers |
| 331 |
could be stored in additional variants. |
| 332 |
|
| 333 |
\DescribeMacro{titletext} |
| 334 |
For example, the register |titletext| exists in |
| 335 |
the default variant (mainly intended for writing out metadata) |
| 336 |
and the |print| variant |
| 337 |
(for printing out a combination of title data on the title page). |
| 338 |
The default variant expands to a combination |
| 339 |
of |draft|, |title| and |subtitle| |
| 340 |
(as far as filled): |
| 341 |
% |
| 342 |
\begin{center} |
| 343 |
[\textit{draft}: ]\textit{title}[ -- \textit{subtitle}] |
| 344 |
\end{center} |
| 345 |
% |
| 346 |
The |print| variant is accessed by the command: |
| 347 |
% |
| 348 |
\begin{center} |
| 349 |
|\metapick[print]{titletext}| |
| 350 |
\end{center} |
| 351 |
% |
| 352 |
It expands to two lines containing |title| and |subtitle| + |draft| |
| 353 |
(as far as filled): |
| 354 |
% |
| 355 |
\begin{center} |
| 356 |
\textit{title}\\ |
| 357 |
\textit{subtitle} |\par| \textit{draft} |
| 358 |
\end{center} |
| 359 |
% |
| 360 |
In fact, the legacy behaviour of |titletext| |
| 361 |
also adds two lines containing |author| and |location| + |date|, |
| 362 |
as in the new composition register |titlematter| to be explained below; |
| 363 |
this behaviour needs to be disabled explicitly |
| 364 |
for purposes of backwards compatibility |
| 365 |
by the package option |titlematter|. |
| 366 |
The formatting style of each line is given |
| 367 |
by the variant |style| of the first register on this line; |
| 368 |
the vertical space above each line is |
| 369 |
produced by the variant |skip|. |
| 370 |
Two items on a single line are separated by the variant |sep| |
| 371 |
of the second register; |
| 372 |
an unfilled |sep| variant puts the two items on individual lines |
| 373 |
(by default this applies to |subtitle| and |draft|). |
| 374 |
|
| 375 |
\DescribeMacro{titlematter} |
| 376 |
The composition register |titlematter| (in |print| variant): |
| 377 |
% |
| 378 |
\begin{center} |
| 379 |
|\metapick[print]{titlematter}| |
| 380 |
\end{center} |
| 381 |
% |
| 382 |
collects extended information |
| 383 |
on the documents for display on the title page |
| 384 |
(it substitutes the \LaTeX{} command |\maketitle| in the class \textsf{article} |
| 385 |
whose display it mimics): |
| 386 |
% |
| 387 |
\begin{center} |
| 388 |
\textit{title}\\ |
| 389 |
\textit{subtitle} |\par| \textit{draft}\\ |
| 390 |
\textit{author}\\ |
| 391 |
\textit{location}, \textit{date} |
| 392 |
\end{center} |
| 393 |
% |
| 394 |
By adjusting the definitions, |
| 395 |
the layout of the title display on the title page |
| 396 |
can be adjusted conveniently. |
| 397 |
|
| 398 |
Variants are always specified by an argument |[|\textit{var}|]| |
| 399 |
in square brackets preceding the register |{|\textit{reg}|}|. |
| 400 |
This argument is optional for commands |
| 401 |
which set registers and which can be fragile; |
| 402 |
it is however \emph{mandatory} for macros which read |
| 403 |
the register content and whose output needs to be expandable |
| 404 |
into the output stream |
| 405 |
(even though the register is not optional, |
| 406 |
it is more uniform to stick with square brackets to specify the variant). |
| 407 |
The main declaration involving variants is: |
| 408 |
% |
| 409 |
\begin{center} |
| 410 |
|\metaset[|\textit{var}|]{|\textit{reg}|}{|\textit{def}|}| |
| 411 |
\end{center} |
| 412 |
% |
| 413 |
This command defines the register \textit{reg} in variant \textit{var} |
| 414 |
as \textit{def}. |
| 415 |
The default variant is the empty string, |
| 416 |
while the variant |print| is intended for printed output. |
| 417 |
The variant string is obtained by: |
| 418 |
% |
| 419 |
\begin{center} |
| 420 |
|\metaget[|\textit{var}|]{|\textit{reg}|}| |
| 421 |
\end{center} |
| 422 |
|
| 423 |
\DescribeMacro{\metapick} |
| 424 |
The variant mechanism can become powerful |
| 425 |
through macros which fall back to default variants |
| 426 |
if the desired variant has not been filled explicitly: |
| 427 |
% |
| 428 |
\begin{center} |
| 429 |
|\metapick[|\textit{var}|]{|\textit{reg}|}| |
| 430 |
\end{center} |
| 431 |
% |
| 432 |
This macro tests whether the variant \textit{var}, |
| 433 |
the language variant \textit{ln} |
| 434 |
specified through |\metasetlang{|\textit{ln}|}|, |
| 435 |
the generic (empty) variant |
| 436 |
or a fallback language variant have been specified. |
| 437 |
If so, their value is returned (in this order of preference). |
| 438 |
Importantly, the intended variant \textit{var} is passed along |
| 439 |
to the evaluation of \textit{reg} as the argument `|#1|' in |
| 440 |
the definition string \textit{def} of |\metaset|. |
| 441 |
This allows to define a register in one generic variant |
| 442 |
which composes other registers in more specific variants. |
| 443 |
To that end reference registers should be accessed by the construct: |
| 444 |
% |
| 445 |
\begin{center} |
| 446 |
|\metaset{|\textit{reg1}|}{|\ldots|\metapick[#1]{|\textit{reg2}|}|\ldots|}| |
| 447 |
\end{center} |
| 448 |
% |
| 449 |
When this register is accessed by |
| 450 |
|\metapick[|\textit{var}|]{|\textit{reg1}|}|, |
| 451 |
it will read the default variant of \textit{reg1} |
| 452 |
which will pass on to \textit{reg2} in \textit{var} |
| 453 |
(rather than in the default variant). |
| 454 |
A useful application within title declarations |
| 455 |
is |\metapick[#1]{linebreak}| which expands to a line break |
| 456 |
when the title is displayed and to a space when the title is used elsewhere. |
| 457 |
|
| 458 |
\DescribeMacro{\metaifpick} |
| 459 |
\DescribeMacro{\metacompose} |
| 460 |
There also exist a corresponding conditional: |
| 461 |
% |
| 462 |
\begin{center} |
| 463 |
|\metaifpick[|\textit{var}|]{|\textit{reg}|}|% |
| 464 |
|{|\textit{true}|}{|\textit{false}|}| |
| 465 |
\end{center} |
| 466 |
% |
| 467 |
This command tests whether any of the above variants \textit{var} |
| 468 |
have been filled. |
| 469 |
Another convenient macro to more efficiently compose strings is: |
| 470 |
% |
| 471 |
\begin{center} |
| 472 |
|\metacompose[|\textit{var}|]{|\textit{reg}|}|% |
| 473 |
|{|\textit{prefix}|}{|\textit{postfix}|}{|\textit{empty}|}| |
| 474 |
\end{center} |
| 475 |
% |
| 476 |
It returns the intended register value with prefix string \textit{prefix} |
| 477 |
and suffix string \textit{suffix} if any of the above variants |
| 478 |
have been filled; otherwise it returns \textit{empty}. |
| 479 |
For example, the prefix and/or suffix could be separators for |
| 480 |
displaying the content of an optional register. |
| 481 |
|
| 482 |
In dealing with variants, |
| 483 |
the following commands specify the variant \textit{var} |
| 484 |
as an optional argument |[|\textit{var}|]|: |
| 485 |
% |
| 486 |
\begin{center} |
| 487 |
\begin{tabular}{l} |
| 488 |
|\metaset[|\textit{var}|]{|\textit{reg}|}{|\textit{def}|}|\\ |
| 489 |
|\metaunset[|\textit{var}|]{|\textit{reg}|}|\\ |
| 490 |
|\metaappend[|\textit{var}|]{|\textit{reg}|}{|\textit{def}|}|\\ |
| 491 |
|\metaprepend[|\textit{var}|]{|\textit{reg}|}{|\textit{def}|}|\\ |
| 492 |
|\metaaddsep[|\textit{var}|]{|\textit{reg}|}{|\textit{sep}|}{|\textit{def}|}| |
| 493 |
\end{tabular} |
| 494 |
\end{center} |
| 495 |
% |
| 496 |
For the following macros, specifying the variant \textit{var} |
| 497 |
as |[|\textit{var}|]| is \emph{mandatory}: |
| 498 |
% |
| 499 |
\begin{center} |
| 500 |
|\metaget[|\textit{var}|]{|\textit{reg}|}|\\ |
| 501 |
|\metapick[|\textit{var}|]{|\textit{reg}|}|\\ |
| 502 |
|\metaifpick[|\textit{var}|]{|\textit{reg}|}|% |
| 503 |
|{|\textit{true}|}{|\textit{false}|}|\\ |
| 504 |
|\metacompose[|\textit{var}|]{|\textit{reg}|}|% |
| 505 |
|{|\textit{prefix}|}{|\textit{postfix}|}| |
| 506 |
\end{center} |
| 507 |
% |
| 508 |
Here, the default variant is accessed by an empty argument \textit{var}. |
| 509 |
|
| 510 |
\DescribeMacro{titletext} |
| 511 |
\DescribeMacro{\metatitleline} |
| 512 |
\DescribeMacro{\metatitlelinetwo} |
| 513 |
To illustrate a construction using variants, |
| 514 |
let us consider the above register |titletext| |
| 515 |
(with activated package option |titlematter|). |
| 516 |
It is defined in the generic variant as: |
| 517 |
% |
| 518 |
\begin{center} |
| 519 |
\begin{tabular}{l} |
| 520 |
|\metaset{titletext}{%|\\ |
| 521 |
| \metacompose[#1]{draft}{}{\metaget[sep]{draft}}{}%|\\ |
| 522 |
| \metapick[#1]{title}%|\\ |
| 523 |
| \metacompose[#1]{subtitle}{\metaget[sep]{subtitle}}{}{}}| |
| 524 |
\end{tabular} |
| 525 |
\end{center} |
| 526 |
% |
| 527 |
This expands to the prefix `\textit{draft}: ' (if available), |
| 528 |
the main title `\textit{title}' |
| 529 |
and the suffix ` -- \textit{subtitle}' (if available). |
| 530 |
The |print| variant to output a full title for the document is defined by: |
| 531 |
% |
| 532 |
\begin{center} |
| 533 |
\begin{tabular}{l} |
| 534 |
|\metaset[print]{titletext}{%|\\ |
| 535 |
| \metatitleline[print]{title}%|\\ |
| 536 |
| \metatitlelinetwo[print]{subtitle}[print]{draft}| |
| 537 |
\end{tabular} |
| 538 |
\end{center} |
| 539 |
% |
| 540 |
Here, the macros |\metatitleline|[|two|] produce a title line |
| 541 |
consisting of one or two items. |
| 542 |
The single-item version is defined as: |
| 543 |
% |
| 544 |
\begin{center} |
| 545 |
\begin{tabular}{l} |
| 546 |
|\def\metatitleline[#1]#2{%|\\ |
| 547 |
| \metacompose[#1]{#2}|\\ |
| 548 |
| {\metaget[skip]{#2}\begingroup\metaget[style]{#2}}|\\ |
| 549 |
| {\par\endgroup}{}}| |
| 550 |
\end{tabular} |
| 551 |
\end{center} |
| 552 |
% |
| 553 |
If register |#2| is filled, |
| 554 |
this expands to the vertical skip defined by the variant |skip| |
| 555 |
and an encapsulated paragraph of the register value |
| 556 |
in the layout defined by the variant |style|. |
| 557 |
|
| 558 |
\DescribeMacro{authortext} |
| 559 |
\DescribeMacro{datetext} |
| 560 |
\DescribeMacro{titlematter} |
| 561 |
The composition registers |authortext| and |datetext| work in |
| 562 |
a similar fashion as |titletext| and compose |
| 563 |
the registers |author| and |location| + |date|, respectively. |
| 564 |
The composition register |titlematter| (in variant |print|) |
| 565 |
prints out the title, author and date information |
| 566 |
and serves a similar purpose as the \LaTeX{} command |\maketitle|: |
| 567 |
% |
| 568 |
\begin{center} |
| 569 |
\begin{tabular}{l} |
| 570 |
|\metaset{titlematter}{%|\\ |
| 571 |
| \metapick[#1]{titletext}%|\\ |
| 572 |
| \metapick[#1]{authortext}%|\\ |
| 573 |
| \metapick[#1]{datatext}%|\\ |
| 574 |
| \metaget[skip]{titlematter}}| |
| 575 |
\end{tabular} |
| 576 |
\end{center} |
| 577 |
|
| 578 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 579 |
\subsection{Write Document Metadata} |
| 580 |
\label{sec:meta} |
| 581 |
|
| 582 |
The contents of certain registers can be written out to |
| 583 |
PDF files as metadata using the package \ctanpkg{hyperref} |
| 584 |
and the extension \ctanpkg{hyperxmp}. |
| 585 |
|
| 586 |
\DescribeMacro{\metawritepdfinfo} |
| 587 |
The basic metadata registers are written out by |\metawritepdfinfo| |
| 588 |
using \ctanpkg{hyperref}. |
| 589 |
The mapping between \ctanpkg{metastr} registers |
| 590 |
and \ctanpkg{hyperref} |\hypersetup| options is given by: |
| 591 |
% |
| 592 |
\begin{center} |
| 593 |
\begin{tabular}{l@{\quad$\to$\quad}l} |
| 594 |
|titletext| & |pdftitle| |
| 595 |
\\ |
| 596 |
|authortext| & |pdfauthor| |
| 597 |
\\ |
| 598 |
|subject| & |pdfsubject| |
| 599 |
\\ |
| 600 |
|keywords| & |pdfkeywords| |
| 601 |
\end{tabular} |
| 602 |
\end{center} |
| 603 |
% |
| 604 |
Here, |titletext| is used instead of |title| to compose information |
| 605 |
from the registers |draft|, |title| and |subtitle| (as far as filled). |
| 606 |
Similarly, |authortext| composes information on the author, |
| 607 |
typically just |author|. |
| 608 |
Note that |\metawritepdfinfo| will be effective |
| 609 |
only when invoked before the contents of the first page are written out. |
| 610 |
|
| 611 |
\DescribeMacro{\metawritepdfaux} |
| 612 |
Auxiliary metadata is written out using \ctanpkg{hyperxmp} |
| 613 |
by the command |\metawritepdfaux| with the mapping: |
| 614 |
% |
| 615 |
\begin{center} |
| 616 |
\begin{tabular}{l@{\quad$\to$\quad}l} |
| 617 |
|url| & |pdfurl| |
| 618 |
\\ |
| 619 |
|source| & |pdfsource| |
| 620 |
\end{tabular} |
| 621 |
\end{center} |
| 622 |
|
| 623 |
\DescribeMacro{\metawritepdfpreamble} |
| 624 |
Some metadata must be written out sufficiently early, |
| 625 |
i.e.\ in the document preamble, in order to go into effect. |
| 626 |
These include the language settings, |
| 627 |
and they are written out by |\metawritepdfpreamble| |
| 628 |
with the mapping: |
| 629 |
% |
| 630 |
\begin{center} |
| 631 |
\begin{tabular}{l@{\quad$\to$\quad}l} |
| 632 |
|language| & |pdflang| |
| 633 |
\\ |
| 634 |
|language| variant |[meta]| & |pdfmetalang| |
| 635 |
\\ |
| 636 |
& |keeppdfinfo| |
| 637 |
\end{tabular} |
| 638 |
\end{center} |
| 639 |
% |
| 640 |
Note that |pdfmetalang| is a setting of \ctanpkg{hyperxmp} |
| 641 |
and will be ignored if the package is not loaded. |
| 642 |
Furthermore, the \ctanpkg{hyperxmp} option |keeppdfinfo| |
| 643 |
will be set unless the package option |xmppdfinfo=false| is set. |
| 644 |
|
| 645 |
\DescribeMacro{\metawritepdfcontact} |
| 646 |
A contact can be specified within PDF files |
| 647 |
in a standardised format using \ctanpkg{hyperxmp}. |
| 648 |
The command |\metawritepdfcontact| passes on the following |
| 649 |
registers with the mapping: |
| 650 |
% |
| 651 |
\begin{center} |
| 652 |
\begin{tabular}{l@{\quad$\to$\quad}l} |
| 653 |
|contactaddress| & |pdfcontactaddress| |
| 654 |
\\ |
| 655 |
|contactpostcode| & |pdfcontactpostcode| |
| 656 |
\\ |
| 657 |
|contactcity| & |pdfcontactcity| |
| 658 |
\\ |
| 659 |
|contactregion| & |pdfcontactregion| |
| 660 |
\\ |
| 661 |
|contactcountry| & |pdfcontactcountry| |
| 662 |
\\ |
| 663 |
|contactemail| & |pdfcontactemail| |
| 664 |
\\ |
| 665 |
|contacturl| & |pdfcontacturl| |
| 666 |
\end{tabular} |
| 667 |
\end{center} |
| 668 |
|
| 669 |
\DescribeMacro{\metawritepdfrights} |
| 670 |
A document copyright statement, see \secref{sec:rights}, |
| 671 |
is recorded within the PDF file by |\metawritepdfrights| |
| 672 |
using \ctanpkg{hyperxmp} with the mapping: |
| 673 |
% |
| 674 |
\begin{center} |
| 675 |
\begin{tabular}{l@{\quad$\to$\quad}l} |
| 676 |
|rightstext| & |pdfcopyright| |
| 677 |
\\ |
| 678 |
|licenseurl| & |pdflicenseurl| |
| 679 |
\end{tabular} |
| 680 |
\end{center} |
| 681 |
% |
| 682 |
|
| 683 |
\DescribeMacro{\metawritepdf} |
| 684 |
\DescribeMacro{writepdf} |
| 685 |
Finally, it makes sense to write out PDF metadata automatically. |
| 686 |
This is controlled by filling or clearing certain variants \textit{var} |
| 687 |
of the register |writepdf|: |
| 688 |
% |
| 689 |
\begin{center} |
| 690 |
\begin{tabular}{rl} |
| 691 |
&|\metaset[|\textit{var}|]{writepdf}{}|\\ |
| 692 |
or&|\metaunset[|\textit{var}|]{writepdf}| |
| 693 |
\end{tabular} |
| 694 |
\end{center} |
| 695 |
% |
| 696 |
If the variant |auto| is filled (default), |
| 697 |
PDF metadata is written automatically |
| 698 |
at the beginning of the |document| block |
| 699 |
by calling |\metawritepdf|. |
| 700 |
The command |\metawritepdf| calls |
| 701 |
the commands |\metawritepdf|\ldots{} |
| 702 |
depending on whether the variants |info|, |aux|, |preamble|, |
| 703 |
|contact|, |rights| of the register |writepdf| are filled; |
| 704 |
the variants |info|, |aux|, |preamble| are enabled by default, |
| 705 |
the variants |contact|, |rights| need to be enabled explicitly. |
| 706 |
|
| 707 |
Note that the basic metadata such as |author| and |title| |
| 708 |
do not have to be defined already in the preamble, |
| 709 |
but (depending on the combination of drivers and packages) |
| 710 |
they can be set before the contents of the first page |
| 711 |
are shipped out to the PDF file. |
| 712 |
If the basic registers are to be declared on the first page, |
| 713 |
one should disable their automatic writing by |
| 714 |
|\metaunset[info]{writepdf}|. |
| 715 |
When the corresponding registers have been filled, |
| 716 |
(but no later than the end of the first page), |
| 717 |
they need to be written manually |
| 718 |
by invoking |\metawritepdfinfo|. |
| 719 |
|
| 720 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 721 |
\subsection{Copyright and Licenses} |
| 722 |
\label{sec:rights} |
| 723 |
|
| 724 |
Specifying a copyright statement and a license is very useful because it |
| 725 |
makes the allowed (re)use of the provided material evident to the reader. |
| 726 |
However, it also takes some efforts to set things up properly. |
| 727 |
The package \ctanpkg{metastr} provides some default texts to |
| 728 |
state the license for a couple of well-established licenses. |
| 729 |
For instance, the set of Creative Commons licenses has become a standard |
| 730 |
to mark the intended (re)use of a document involving creative content. |
| 731 |
For documents related to software, there is a number of |
| 732 |
standard software licenses to choose from. |
| 733 |
|
| 734 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 735 |
\paragraph{Registers.} |
| 736 |
|
| 737 |
The package declares the following registers to state the copyright: |
| 738 |
% |
| 739 |
\begin{center} |
| 740 |
\begin{tabular}{ll} |
| 741 |
|copyrightmark| & `\copyright' (|print| variant) or ``Copyright'' |
| 742 |
\\ |
| 743 |
|copyrightdate| & copyright date |
| 744 |
\\ |
| 745 |
|copyrightowner| & copyright owner |
| 746 |
\\ |
| 747 |
|copyrightstatement| & combines: |
| 748 |
|...mark| + |...date| + |...owner| |
| 749 |
\\ |
| 750 |
|copyrightmessage| & a message explaining the copyright situation |
| 751 |
\end{tabular} |
| 752 |
\end{center} |
| 753 |
% |
| 754 |
The package declares the following registers to state the license: |
| 755 |
% |
| 756 |
\begin{center} |
| 757 |
\begin{tabular}{ll} |
| 758 |
|licensemessage| & licensing message |
| 759 |
\\ |
| 760 |
|licenseprovider| & license provider |
| 761 |
\\ |
| 762 |
|licenseversion| & license version |
| 763 |
\\ |
| 764 |
|licenselogo| & license logo inclusion |
| 765 |
\\ |
| 766 |
|licenselogomessage| & display the license logo |
| 767 |
\\ |
| 768 |
|licenseurl| & URL with license text and details |
| 769 |
\\ |
| 770 |
|licenseurlmessage| & display the license URL |
| 771 |
\end{tabular} |
| 772 |
\end{center} |
| 773 |
% |
| 774 |
Furthermore, there are some related auxiliary registers: |
| 775 |
% |
| 776 |
\begin{center} |
| 777 |
\begin{tabular}{ll} |
| 778 |
|partof| & specifies the work this document is a part of |
| 779 |
\\ |
| 780 |
|partofmessage| & a message declaring being part of |
| 781 |
\\ |
| 782 |
|attributionmessage| & a message declaring attributions |
| 783 |
\\ |
| 784 |
|rightstext| & a composition template for all of the above |
| 785 |
\end{tabular} |
| 786 |
\end{center} |
| 787 |
% |
| 788 |
The above information is compiled automatically in the register |rightstext|. |
| 789 |
It can be written as PDF metadata |
| 790 |
as well as printed with formatting: |
| 791 |
% |
| 792 |
\begin{center} |
| 793 |
|\metapick[print]{rightstext}| |
| 794 |
\end{center} |
| 795 |
% |
| 796 |
|
| 797 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 798 |
\paragraph{Presets.} |
| 799 |
|
| 800 |
The package provides a couple of presets |
| 801 |
for commonly used copyright statements and licenses. |
| 802 |
These are selected by: |
| 803 |
% |
| 804 |
\begin{center} |
| 805 |
\begin{tabular}{l} |
| 806 |
|\metacopyright{|\textit{preset}|}|\\ |
| 807 |
|\metalicense{|\textit{preset}|}| |
| 808 |
\end{tabular} |
| 809 |
\end{center} |
| 810 |
% |
| 811 |
The following \textit{preset} values |
| 812 |
provide the associated copyright statements: |
| 813 |
% |
| 814 |
\begin{center} |
| 815 |
\begin{tabular}{ll} |
| 816 |
|plain| & This work is protected by copyright. |
| 817 |
\\ |
| 818 |
|parts| & This work as well as its parts is protected by copyright. |
| 819 |
\\ |
| 820 |
|doc| & This document is protected by copyright. |
| 821 |
\\ |
| 822 |
|doc-parts| & This document as well as its parts is protected by copyright. |
| 823 |
\\ |
| 824 |
|reserved| & All rights reserved. |
| 825 |
\\ |
| 826 |
|publicdomain| & This work is dedicated to the public domain. |
| 827 |
\end{tabular} |
| 828 |
\end{center} |
| 829 |
% |
| 830 |
The following \textit{preset} values |
| 831 |
provide the associated license statements: |
| 832 |
% |
| 833 |
\begin{center} |
| 834 |
\begin{tabular}{ll} |
| 835 |
|consent| & |
| 836 |
\parbox[t]{0.75\textwidth}{\raggedright |
| 837 |
Reproduction of any part of this work in any form |
| 838 |
without prior written consent |
| 839 |
\textit{of the author} |
| 840 |
is not permissible. |
| 841 |
} |
| 842 |
\\ |
| 843 |
\vphantom{$\hat A$}% |
| 844 |
|consent-noncom| & |
| 845 |
\parbox[t]{0.75\textwidth}{\raggedright |
| 846 |
Reproduction of any part of this work in any form |
| 847 |
without prior written consent |
| 848 |
\textit{of the author} |
| 849 |
is permissible only for private, scientific and non-commercial use. |
| 850 |
\vphantom{g}} |
| 851 |
\\ |
| 852 |
\vphantom{$\hat A$}% |
| 853 |
|lppl| & |
| 854 |
\parbox[t]{0.75\textwidth}{\raggedright |
| 855 |
This work may be distributed and/or modified under the |
| 856 |
conditions of the LaTeX Project Public License, either version \textit{1.3} |
| 857 |
of this license or (at your option) any later version.\\ |
| 858 |
\url{https://www.latex-project.org/lppl.txt} |
| 859 |
} |
| 860 |
\end{tabular} |
| 861 |
\end{center} |
| 862 |
% |
| 863 |
The license URL will be selected where available. |
| 864 |
The italicised parts of the license statement can be customised |
| 865 |
by the registers |licenseversion| and |licenseprovider|. |
| 866 |
|
| 867 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 868 |
\paragraph{Creative Commons Licenses.} |
| 869 |
|
| 870 |
A Creative Commons license can be selected by the command: |
| 871 |
% |
| 872 |
\begin{center} |
| 873 |
|\metalicensecc{|\textit{license}|}| |
| 874 |
\end{center} |
| 875 |
% |
| 876 |
The parameter \textit{license} specifies the type of CC license: |
| 877 |
% |
| 878 |
\begin{center} |
| 879 |
\begin{tabular}{ll} |
| 880 |
|by| & Attribution \\ |
| 881 |
|by-sa| & Attribution-ShareAlike \\ |
| 882 |
|by-nd| & Attribution-NoDerivatives \\ |
| 883 |
|by-nc| & Attribution-NonCommercial \\ |
| 884 |
|by-nc-sa| & Attribution-NonCommercial-ShareAlike \\ |
| 885 |
|by-nc-nd| & Attribution-NonCommercial-NoDerivatives \\ |
| 886 |
|zero| & CC0 public domain declaration \\ |
| 887 |
|pd| & generic public domain declaration |
| 888 |
\end{tabular} |
| 889 |
\end{center} |
| 890 |
% |
| 891 |
The appropriate license URL and CC logo is selected |
| 892 |
by the command as well, e.g. |
| 893 |
% |
| 894 |
\begin{center} |
| 895 |
\includegraphics{doclicense-CC-by-sa-88x31}\\ |
| 896 |
\url{https://creativecommons.org/licenses/by-sa/4.0/} |
| 897 |
\end{center} |
| 898 |
% |
| 899 |
Note that |pd| is not a CC license, but it declares |
| 900 |
that the document is in the public domain by |
| 901 |
|\metacopyright{publicdomain}| |
| 902 |
and it selects the corresponding CC logo for public domain content. |
| 903 |
|
| 904 |
A version of the CC license can be specified by |
| 905 |
the register |licenseversion|. |
| 906 |
The default version is |4.0| (international), further available versions are |
| 907 |
|3.0| (unported) as well as |2.5|, |2.0|, |1.0| (generic). |
| 908 |
For the CC0 license |zero|, the only available version is |1.0| (universal) |
| 909 |
which is the default. |
| 910 |
|
| 911 |
Displaying the logo requires (manual) loading |
| 912 |
of the package \ctanpkg{graphicx}; |
| 913 |
furthermore the package \ctanpkg{doclicense} containing the logo files |
| 914 |
must be present. |
| 915 |
The display of the logo can be disabled by the package option |cclogo=false|. |
| 916 |
The logo display is coded by the following definitions |
| 917 |
which can be customised: |
| 918 |
% |
| 919 |
\begin{center} |
| 920 |
\begin{tabular}{l} |
| 921 |
|\metaset[print]{licenselogomessage}{%|\\ |
| 922 |
| \centerline{\metapick[#1]{licenselogo}}}|\\ |
| 923 |
|\metaset[cmd]{licenselogo}{\includegraphics{#1}}| |
| 924 |
\end{tabular} |
| 925 |
\end{center} |
| 926 |
|
| 927 |
Various registers and variants of the selected CC license exist. |
| 928 |
The registers specific to CC licenses are: |
| 929 |
% |
| 930 |
\begin{center} |
| 931 |
\begin{tabular}{ll} |
| 932 |
|licencecc| & CC license identifier |
| 933 |
\\ |
| 934 |
|licenceccver| & CC license version |
| 935 |
\\ |
| 936 |
|licenceccfull| & full license descriptor |
| 937 |
\end{tabular} |
| 938 |
\end{center} |
| 939 |
% |
| 940 |
The variants specific to CC licenses are: |
| 941 |
% |
| 942 |
\begin{center} |
| 943 |
\begin{tabular}{ll} |
| 944 |
\textit{ln} & representation in language \textit{ln} |
| 945 |
\\ |
| 946 |
|icon| & CC icon (package \ctanpkg{ccicons} required), |
| 947 |
e.g. \ccLogo\ccAttribution\ccShareAlike |
| 948 |
\\ |
| 949 |
|url| & license URL |
| 950 |
\\ |
| 951 |
|ident| & CC identifier, e.g.\ `BY-SA' |
| 952 |
\\ |
| 953 |
|short| & short form, e.g.\ `CC BY-SA' |
| 954 |
\\ |
| 955 |
|logo| & logo filename (package \ctanpkg{doclicense}) |
| 956 |
\end{tabular} |
| 957 |
\end{center} |
| 958 |
% |
| 959 |
For example, a full license descriptor is displayed by |
| 960 |
|\metapick[]{licenseccfull}|: |
| 961 |
Creative Commons License ``Attribution-ShareAlike 4.0 International''. |
| 962 |
The license icon can be displayed by |
| 963 |
|\metaget[icon]{licensecc}|: \ccLogo\ccAttribution\ccShareAlike{} |
| 964 |
(this requires the package \ctanpkg{ccicons} to be loaded). |
| 965 |
Note that displaying the full license message |licensemessage| |
| 966 |
in variant |print| in some languages |
| 967 |
may produce quotation marks not declared in default fonts |
| 968 |
causing an error; this can be avoided to some extent by |
| 969 |
loading an appropriate packages for internationalisation |
| 970 |
such as \ctanpkg{babel}. |
| 971 |
|
| 972 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 973 |
\subsection{Languages} |
| 974 |
\label{sec:language} |
| 975 |
|
| 976 |
A principal application of the register variants is to |
| 977 |
implement internationalisation and localisation. |
| 978 |
Evidently, this is a tricky subject |
| 979 |
due to various particularities of languages, |
| 980 |
but the register variants can be used |
| 981 |
to specify and select different language representations |
| 982 |
for some commonly used text elements. |
| 983 |
For example, the copyright and license statements in \secref{sec:rights} |
| 984 |
are internationalised (to some extent). |
| 985 |
This makes them conveniently usable in the appropriate language. |
| 986 |
Note that the language presets to be loaded |
| 987 |
need to be specified explicitly by the package option |loadlang|, |
| 988 |
see \secref{sec:options}. |
| 989 |
|
| 990 |
The idea is to understand the variant \textit{var} |
| 991 |
of a register \textit{reg} to be its representation in the language |
| 992 |
\textit{var}=\textit{ln}[|-|\textit{CN}]. |
| 993 |
The default (empty) variant as well as specific purpose variants |
| 994 |
(such as |print|) should be provided in the |
| 995 |
document language or a fallback language (such as English). |
| 996 |
The macro |\metapick[|\textit{var}|]{|\textit{reg}|}| |
| 997 |
then selects the appropriate language representation |
| 998 |
or falls back to the default language. |
| 999 |
Here \textit{var} can specify a particular language or a particular purpose. |
| 1000 |
Then, |\metapick| will pick (in this order of preference): |
| 1001 |
% |
| 1002 |
\begin{itemize} |
| 1003 |
\item |
| 1004 |
the language or purpose \textit{var}, |
| 1005 |
\item |
| 1006 |
the document language specified by |\metasetlang| (if available), |
| 1007 |
\item |
| 1008 |
the document language specified by |\metasetlang| |
| 1009 |
with country code stripped (if available), |
| 1010 |
\item |
| 1011 |
the default variant, |
| 1012 |
\item |
| 1013 |
the fallback language (first of package option |loadlang|). |
| 1014 |
\end{itemize} |
| 1015 |
% |
| 1016 |
Note that nesting of |\metapick| |
| 1017 |
via |\metapick[#1]{|\textit{reg}|}| |
| 1018 |
passes along the original variant |
| 1019 |
\textit{var} in the parameter |#1|. |
| 1020 |
This mechanism allows to specify some non-specific elements |
| 1021 |
in a universal language while the appropriate language is |
| 1022 |
selected where available. |
| 1023 |
|
| 1024 |
\macro{\metaterm} |
| 1025 |
\macro{\metatranslate} |
| 1026 |
\macro{\metasetterm} |
| 1027 |
The package reserves registers of the form |term-|\textit{term} |
| 1028 |
for storing terms in various (language) representations. |
| 1029 |
A couple of such term registers describing common entities in typesetting |
| 1030 |
are defined by the package: |
| 1031 |
% |
| 1032 |
\begin{center} |
| 1033 |
\begin{tabular}[t]{ll} |
| 1034 |
|title|&Title\\ |
| 1035 |
|abstract|&Abstract\\ |
| 1036 |
|copyright|&Copyright\\ |
| 1037 |
|preface|&Preface\\ |
| 1038 |
|part|&Part\\ |
| 1039 |
|chapter|&Chapter\\ |
| 1040 |
|section|&Section\\ |
| 1041 |
|subsection|&Subsection\\ |
| 1042 |
|paragraph|&Paragraph |
| 1043 |
\end{tabular} |
| 1044 |
\qquad\qquad |
| 1045 |
\begin{tabular}[t]{ll} |
| 1046 |
|appendix|&Appendix\\ |
| 1047 |
|page|&Page\\ |
| 1048 |
|figure|&Figure\\ |
| 1049 |
|table|&Table\\ |
| 1050 |
|contents|&Contents\\ |
| 1051 |
|listfigure|&List of Figures\\ |
| 1052 |
|listtable|&List of Tables\\ |
| 1053 |
|references|&References\\ |
| 1054 |
|index|&Index\\ |
| 1055 |
|draft|&DRAFT |
| 1056 |
\end{tabular} |
| 1057 |
\end{center} |
| 1058 |
% |
| 1059 |
These are provided in different languages for convenient |
| 1060 |
internationalisation |
| 1061 |
(this can be viewed as a low-key implementation of some of the features |
| 1062 |
of the \ctanpkg{babel} package). |
| 1063 |
Additional term registers can be defined by the user. |
| 1064 |
Term registers are accessed by the macros: |
| 1065 |
% |
| 1066 |
\begin{center} |
| 1067 |
\begin{tabular}{l} |
| 1068 |
|\metaterm{|\textit{term}|}|\\ |
| 1069 |
|\metatranslate[|\textit{ln}|]{|\textit{term}|}|\\ |
| 1070 |
|\metasetterm[|\textit{ln}|]{|\textit{reg}|}{|\textit{def}|}| |
| 1071 |
\end{tabular} |
| 1072 |
\end{center} |
| 1073 |
% |
| 1074 |
The macro |\metaterm| obtains the term \textit{term} |
| 1075 |
in the default language |
| 1076 |
(it invokes |\metapick[]| with empty variant), |
| 1077 |
while |\metatranslate| uses any other language \textit{ln}. |
| 1078 |
The macro |\metasetterm| declares and fills a term register \textit{term} |
| 1079 |
(in a particular language \textit{ln}). |
| 1080 |
Note that therefore it is not necessary to declare term registers |
| 1081 |
explicitly by |\metadef|. |
| 1082 |
|
| 1083 |
The PDF metadata are written out in the metadata language variant |
| 1084 |
specified by |\metasetlang*|; |
| 1085 |
otherwise in the default document language |
| 1086 |
specified by |\metasetlang| is used. |
| 1087 |
Some registers can even be written out |
| 1088 |
in several alternative language versions |
| 1089 |
using the package \ctanpkg{hyperxmp}, |
| 1090 |
namely |title|, |subject| and |rightstext|. |
| 1091 |
The set of alternative languages is specified by |
| 1092 |
(before invoking the respective command |\metawritepdf...|): |
| 1093 |
% |
| 1094 |
\begin{center} |
| 1095 |
\begin{tabular}{l} |
| 1096 |
|\metaset[altlang]{title}{|\textit{languages}|}|\\ |
| 1097 |
|\metaset[altlang]{subject}{|\textit{languages}|}|\\ |
| 1098 |
|\metaset[altlang]{rightstext}{|\textit{languages}|}| |
| 1099 |
\end{tabular} |
| 1100 |
\end{center} |
| 1101 |
% |
| 1102 |
Here, \textit{languages} is a comma-separated list of language identifiers |
| 1103 |
and for each identifier \textit{ln} |
| 1104 |
the information is written out in the respective language variant. |
| 1105 |
|
| 1106 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1107 |
\subsection{Package Options} |
| 1108 |
\label{sec:options} |
| 1109 |
|
| 1110 |
General options for the package can be selected by the commands: |
| 1111 |
% |
| 1112 |
\begin{center} |
| 1113 |
\begin{tabular}{rl} |
| 1114 |
&|\usepackage[|\textit{opts}|]{metastr}| |
| 1115 |
\\ |
| 1116 |
or&|\PassOptionsToPackage{|\textit{opts}|}{metastr}| |
| 1117 |
\end{tabular} |
| 1118 |
\end{center} |
| 1119 |
% |
| 1120 |
|\PassOptionsToPackage| must be used before |\usepackage|. |
| 1121 |
\textit{opts} is a comma-separated list of options. |
| 1122 |
|
| 1123 |
The following options are available: |
| 1124 |
% |
| 1125 |
\begin{itemize} |
| 1126 |
\item |hyperref|[|=true|\textbar|false|] |
| 1127 |
(no value implies |true|, initially set to |true|) -- |
| 1128 |
use the package \ctanpkg{hyperref} to write metadata to PDF. |
| 1129 |
\item |hyperxmp|[|=true|\textbar|false|] |
| 1130 |
(no value implies |true|, initially set to |true|) -- |
| 1131 |
use the auxiliary package \ctanpkg{hyperxmp} |
| 1132 |
to write additional metadata to PDF. |
| 1133 |
\item |checkdef|[|=true|\textbar|false|] |
| 1134 |
(no value implies |true|, initially set to |true|) -- |
| 1135 |
check whether registers have been previously declared |
| 1136 |
when filling them. |
| 1137 |
\item |cclogo|[|=true|\textbar|false|] |
| 1138 |
(no value implies |true|, initially set to |true|) -- |
| 1139 |
display CC logo from \ctanpkg{doclicense} package. |
| 1140 |
\item |cclogocurr=dollar|\textbar|euro|\textbar|yen| |
| 1141 |
(initially set to |dollar|) -- |
| 1142 |
select currency symbol for Creative Commons NonCommercial logos. |
| 1143 |
\item |cclogoshape=box|\textbar|slim| |
| 1144 |
(initially set to |box|) -- |
| 1145 |
select shape of Creative Commons NonCommercial logos. |
| 1146 |
\item |xmppdfinfo|[|=true|\textbar|false|] |
| 1147 |
(no value implies |true|, initially set to |true|) -- |
| 1148 |
write the basic PDF info block |
| 1149 |
when using the auxiliary package \ctanpkg{hyperxmp}; |
| 1150 |
if this option is set, |
| 1151 |
\ctanpkg{hyperxmp} is loaded with the option |keeppdfinfo|. |
| 1152 |
\item |draft|[|=true|\textbar|false|] |
| 1153 |
(no value implies |true|, initially set to |false|) -- |
| 1154 |
fill |draft| register with ``DRAFT''. |
| 1155 |
\item |titlematter|[|=true|\textbar|false|] |
| 1156 |
(no value implies |true|, initially set to |false|) -- |
| 1157 |
when set to |true|, composition register |titletext| |
| 1158 |
prints only the title; when set to |false|, |
| 1159 |
|titletext| also prints authorship, location and date information |
| 1160 |
(legacy behaviour). |
| 1161 |
\item |course|[|=true|\textbar|false|] |
| 1162 |
(no value implies |true|, initially set to |false|) -- |
| 1163 |
Setup extended registers for course materials, see \secref{sec:extras}. |
| 1164 |
\item |loadlang=|\textit{ln-1}\texttt{\textbar}\textit{ln-2}% |
| 1165 |
\texttt{\textbar}|...|\texttt{\textbar}\textit{ln-n} |
| 1166 |
(bar-separated list w/o spaces, initially set to |en|) -- |
| 1167 |
Load presets for languages \textit{ln-1}, \textit{ln-2}, \ldots, \textit{ln-n}, |
| 1168 |
see \secref{sec:language}. |
| 1169 |
The first language \textit{ln-1} serves as the fallback variant. |
| 1170 |
Available internationalisations currently consist of: |
| 1171 |
\begin{center} |
| 1172 |
\begin{tabular}{ll} |
| 1173 |
|en|& English\\ |
| 1174 |
|de|& German\\ |
| 1175 |
|fr|& French\\ |
| 1176 |
|es|& Spanish |
| 1177 |
\end{tabular} |
| 1178 |
\end{center} |
| 1179 |
\end{itemize} |
| 1180 |
% |
| 1181 |
|
| 1182 |
Selected package options can be adjusted after the package |
| 1183 |
has been loaded by the command: |
| 1184 |
% |
| 1185 |
\begin{center} |
| 1186 |
|\metasetup{|\textit{opts}|}| |
| 1187 |
\end{center} |
| 1188 |
% |
| 1189 |
Presently, only |draft| can be adjusted. |
| 1190 |
|
| 1191 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1192 |
\subsection{Extras} |
| 1193 |
\label{sec:extras} |
| 1194 |
|
| 1195 |
The package can provide some special purpose registers on request. |
| 1196 |
|
| 1197 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1198 |
\paragraph{Course Materials.} |
| 1199 |
|
| 1200 |
A couple of registers for course materials are provided |
| 1201 |
upon setting the package option |course|: |
| 1202 |
% |
| 1203 |
\begin{center} |
| 1204 |
\begin{tabular}{ll} |
| 1205 |
|course| & title of course |
| 1206 |
\\ |
| 1207 |
|material| & description of document material |
| 1208 |
\\ |
| 1209 |
|period| & period where course takes place |
| 1210 |
\\ |
| 1211 |
|institution| & institution where course is given |
| 1212 |
\\ |
| 1213 |
|instructor| & instructor of course |
| 1214 |
\end{tabular} |
| 1215 |
\end{center} |
| 1216 |
% |
| 1217 |
|
| 1218 |
The variant |course| of the register |titlematter| (or |titletext|) |
| 1219 |
displays a compilation of these registers for display on a title page: |
| 1220 |
% |
| 1221 |
\begin{center} |
| 1222 |
\textit{course}\\ |
| 1223 |
\textit{material} |\par| \textit{draft}\\ |
| 1224 |
\textit{institution}, \textit{period}\\ |
| 1225 |
\textit{instructor} |
| 1226 |
\end{center} |
| 1227 |
% |
| 1228 |
Furthermore, the registers |
| 1229 |
|title|, |subtitle|, |author|, |location| and |date| are |
| 1230 |
diverted to |course|, |material|, |instructor|, |
| 1231 |
|institution| and |period| respectively. |
| 1232 |
Consequently, their values are automatically written as PDF metadata, |
| 1233 |
but it is certainly possible to override them with custom values. |
| 1234 |
|
| 1235 |
|
| 1236 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1237 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1238 |
\section{Information} |
| 1239 |
|
| 1240 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1241 |
\subsection{Copyright} |
| 1242 |
|
| 1243 |
Copyright \copyright{} 2020 Niklas Beisert |
| 1244 |
|
| 1245 |
This work may be distributed and/or modified under the |
| 1246 |
conditions of the \LaTeX{} Project Public License, either version 1.3 |
| 1247 |
of this license or (at your option) any later version. |
| 1248 |
The latest version of this license is in |
| 1249 |
\url{https://www.latex-project.org/lppl.txt} |
| 1250 |
and version 1.3c or later is part of all distributions of \LaTeX{} |
| 1251 |
version 2008 or later. |
| 1252 |
|
| 1253 |
This work has the LPPL maintenance status `maintained'. |
| 1254 |
|
| 1255 |
The Current Maintainer of this work is Niklas Beisert. |
| 1256 |
|
| 1257 |
This work consists of the files |README.txt|, |metastr.ins| and |metastr.dtx| |
| 1258 |
as well as the derived files |metastr.sty|, |metasamp.tex| and |metastr.pdf|. |
| 1259 |
|
| 1260 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1261 |
\subsection{Files and Installation} |
| 1262 |
|
| 1263 |
The package consists of the files: |
| 1264 |
% |
| 1265 |
\begin{center} |
| 1266 |
\begin{tabular}{ll} |
| 1267 |
|README.txt| & readme file \\ |
| 1268 |
|metastr.ins| & installation file \\ |
| 1269 |
|metastr.dtx| & source file \\ |
| 1270 |
|metastr.sty| & package file \\ |
| 1271 |
|metasamp.tex| & sample file \\ |
| 1272 |
|metastr.pdf| & manual |
| 1273 |
\end{tabular} |
| 1274 |
\end{center} |
| 1275 |
% |
| 1276 |
The distribution consists of the files |
| 1277 |
|README.txt|, |metastr.ins| and |metastr.dtx|. |
| 1278 |
% |
| 1279 |
\begin{itemize} |
| 1280 |
\item |
| 1281 |
Run (pdf)\LaTeX{} on |metastr.dtx| |
| 1282 |
to compile the manual |metastr.pdf| (this file). |
| 1283 |
\item |
| 1284 |
Run \LaTeX{} on |metastr.ins| to create the package |metastr.sty| |
| 1285 |
and the samples consisting of |metasamp.tex|. |
| 1286 |
Copy the file |metastr.sty| to an appropriate directory of your \LaTeX{} |
| 1287 |
distribution, e.g.\ \textit{texmf-root}|/tex/latex/metastr|. |
| 1288 |
\end{itemize} |
| 1289 |
|
| 1290 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1291 |
\subsection{Related Packages} |
| 1292 |
|
| 1293 |
The package makes use of other packages available at CTAN: |
| 1294 |
\begin{itemize} |
| 1295 |
\item |
| 1296 |
This package uses the package |
| 1297 |
\ctanpkg{hyperref} |
| 1298 |
to write basic metadata to a PDF file. |
| 1299 |
Compatibility with the \ctanpkg{hyperref} package |
| 1300 |
has been tested with v7.00c (2019/11/10). |
| 1301 |
\item |
| 1302 |
This package uses the package \ctanpkg{keyval} |
| 1303 |
from the \ctanpkg{graphics} bundle |
| 1304 |
to process the options for the package, environments and macros. |
| 1305 |
Compatibility with the \ctanpkg{keyval} package |
| 1306 |
has been tested with v1.15 (2014/10/28). |
| 1307 |
\item |
| 1308 |
This package can use the package \ctanpkg{hyperxmp} |
| 1309 |
to write extended metadata to a PDF file. |
| 1310 |
Compatibility with the \ctanpkg{hyperxmp} package |
| 1311 |
has been tested with v5.4 (2020/06/19). |
| 1312 |
\item |
| 1313 |
This package can use the Creative Commons license icon files |
| 1314 |
included in the package \ctanpkg{doclicense}. |
| 1315 |
Compatibility with the \ctanpkg{doclicense} package |
| 1316 |
has been tested with v2.0.1 (2020/06/26). |
| 1317 |
\item |
| 1318 |
This package can use the Creative Commons license icon fonts |
| 1319 |
included in the package \ctanpkg{ccicons}. |
| 1320 |
Compatibility with the \ctanpkg{ccicons} package |
| 1321 |
has been tested with v1.6 (2017/10/30). |
| 1322 |
\item |
| 1323 |
Icon files are displayed by means of the \ctanpkg{graphicx} package. |
| 1324 |
The package needs to be loaded explicitly. |
| 1325 |
Compatibility with the \ctanpkg{graphicx} package |
| 1326 |
has been tested with v1.1a (2017/06/01). |
| 1327 |
\end{itemize} |
| 1328 |
|
| 1329 |
There are several other \LaTeX{} packages |
| 1330 |
which store and write basic metadata |
| 1331 |
for some specific purposes: |
| 1332 |
% |
| 1333 |
\begin{itemize} |
| 1334 |
\item |
| 1335 |
The package \ctanpkg{hyperref} |
| 1336 |
writes the arguments of |\author| and |\title| |
| 1337 |
unless the package option |pdfusetitle=false| is declared (at load time). |
| 1338 |
\item |
| 1339 |
The package \ctanpkg{hyperxmp} |
| 1340 |
writes the arguments of |\author| and |\title|. |
| 1341 |
\item |
| 1342 |
The package \ctanpkg{exframe} |
| 1343 |
writes the |\exercisedata| registers |
| 1344 |
|author|, |title|, |subject| and |keyword| |
| 1345 |
unless the package option |pdfdata=off| is specified. |
| 1346 |
\item |
| 1347 |
The package \ctanpkg{beamer} |
| 1348 |
writes the arguments of |\author|, |\title|, |\subject| and |\keywords|. |
| 1349 |
\item |
| 1350 |
The package \ctanpkg{gitver} |
| 1351 |
writes |pdfsubject| unless the package option |nopdfinfo| is specified. |
| 1352 |
\item |
| 1353 |
Various packages to prepare articles for publication in journals. |
| 1354 |
\end{itemize} |
| 1355 |
% |
| 1356 |
Their mechanisms may be in competition |
| 1357 |
with the ones of the present package \ctanpkg{metastr}. |
| 1358 |
In order to make the packages work together on the same set of data, |
| 1359 |
the most promising option which should work in many cases is the following: |
| 1360 |
Fill the registers of \ctanpkg{metastr} |
| 1361 |
with the desired values. |
| 1362 |
Then pass them on to the structures |
| 1363 |
of the other package(s) using |\metaget| or |\metapick|. |
| 1364 |
Since the latter commands are robust, |
| 1365 |
the other structures ought to be able to handle them without further ado. |
| 1366 |
To avoid potential conflicts, multiple writing of (basic) metadata |
| 1367 |
should be disabled. For the \ctanpkg{metastr} package this is achived by: |
| 1368 |
% |
| 1369 |
\begin{center} |
| 1370 |
\begin{tabular}{rl} |
| 1371 |
&|\metaunset[info]{writepdf}|\\ |
| 1372 |
or&|\metaunset[auto]{writepdf}| |
| 1373 |
\end{tabular} |
| 1374 |
\end{center} |
| 1375 |
|
| 1376 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1377 |
\subsection{Feature Suggestions} |
| 1378 |
\label{sec:suggestions} |
| 1379 |
|
| 1380 |
The following is a list of features which may be useful for future |
| 1381 |
versions of this package: |
| 1382 |
% |
| 1383 |
\begin{itemize} |
| 1384 |
\item |
| 1385 |
Presets for GNU and other software licenses. |
| 1386 |
\item |
| 1387 |
Registers for publication data. |
| 1388 |
% editor, preprint, doi, publisher, publication, (volume, page), version ... |
| 1389 |
\item |
| 1390 |
Further translations of copyright and license statements. |
| 1391 |
\item |
| 1392 |
Export translations to files |
| 1393 |
\item |
| 1394 |
Make use of the \ctanpkg{babel} package for translations of basic terms. |
| 1395 |
% load babel when not only en? |
| 1396 |
%\item |
| 1397 |
%title translations via titletext? |
| 1398 |
%\item |
| 1399 |
%perhaps use \ctanpkg{xparse} to generate robust commands for optional variants |
| 1400 |
\end{itemize} |
| 1401 |
|
| 1402 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1403 |
\subsection{Revision History} |
| 1404 |
|
| 1405 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1406 |
\iffalse |
| 1407 |
\paragraph{vN.N.N+:} 20YY/MM/NN |
| 1408 |
|
| 1409 |
\begin{itemize} |
| 1410 |
\item |
| 1411 |
\ldots |
| 1412 |
\end{itemize} |
| 1413 |
\fi |
| 1414 |
|
| 1415 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1416 |
\paragraph{v1.1.3:} 2025/03/25 |
| 1417 |
|
| 1418 |
\begin{itemize} |
| 1419 |
\item |
| 1420 |
maintenance and manual update |
| 1421 |
\end{itemize} |
| 1422 |
|
| 1423 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1424 |
\paragraph{v1.1.2:} 2020/09/02 |
| 1425 |
|
| 1426 |
\begin{itemize} |
| 1427 |
\item |
| 1428 |
improve hook processing to set |pdflang| at the right moment |
| 1429 |
\end{itemize} |
| 1430 |
|
| 1431 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1432 |
\paragraph{v1.1.1:} 2020/08/27 |
| 1433 |
|
| 1434 |
\begin{itemize} |
| 1435 |
\item |
| 1436 |
introduce |skip| variant for |titlematter| register |
| 1437 |
\item |
| 1438 |
adjust hook to new \LaTeXe\ (2020-10) hook processing |
| 1439 |
\end{itemize} |
| 1440 |
|
| 1441 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1442 |
\paragraph{v1.1:} 2020/06/28 |
| 1443 |
|
| 1444 |
\begin{itemize} |
| 1445 |
\item |
| 1446 |
|\metasetup| to adjust some package options (|draft|) |
| 1447 |
\item |
| 1448 |
|titlematter|, |authortext|, |datatext| composition registers added; |
| 1449 |
legacy behaviour of |titletext| preserved, |
| 1450 |
can be changed by package option |titlematter| |
| 1451 |
\item |
| 1452 |
|linebreak| register added |
| 1453 |
\item |
| 1454 |
fix saving of PDF info (|keeppdfinfo|) with updated \ctanpkg{hyperxmp} package |
| 1455 |
\item |
| 1456 |
fix package options |hyperref|, |hyperxmp|, |checkdef|, |xmppdfinfo| |
| 1457 |
\item |
| 1458 |
fix compatibility with updated \ctanpkg{doclicense} package (v2) |
| 1459 |
\end{itemize} |
| 1460 |
|
| 1461 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1462 |
\paragraph{v1.0:} 2020/02/06 |
| 1463 |
|
| 1464 |
\begin{itemize} |
| 1465 |
\item |
| 1466 |
first version, published on CTAN |
| 1467 |
\end{itemize} |
| 1468 |
|
| 1469 |
|
| 1470 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1471 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1472 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1473 |
\appendix |
| 1474 |
|
| 1475 |
\settowidth\MacroIndent{\rmfamily\scriptsize 0000\ } |
| 1476 |
|
| 1477 |
\DocInput{metastr.dtx} |
| 1478 |
|
| 1479 |
\end{document} |
| 1480 |
%</driver> |
| 1481 |
% \fi |
| 1482 |
% |
| 1483 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1484 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1485 |
% \section{Sample} |
| 1486 |
% \label{sec:sample} |
| 1487 |
%\iffalse |
| 1488 |
%<*sample> |
| 1489 |
%\fi |
| 1490 |
% |
| 1491 |
% This section provides an example of how to apply |
| 1492 |
% some of the \ctanpkg{metastr} mechanisms and licenses. |
| 1493 |
% |
| 1494 |
% Some lines in the example are commented by |%%| for easy experimenting. |
| 1495 |
% |
| 1496 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1497 |
% \paragraph{Preamble.} |
| 1498 |
% |
| 1499 |
% Standard document class: |
| 1500 |
% \begin{macrocode} |
| 1501 |
\documentclass[12pt]{article} |
| 1502 |
% \end{macrocode} |
| 1503 |
|
| 1504 |
% Use package \ctanpkg{geometry} to set the page layout; |
| 1505 |
% adjust the paragraph shape: |
| 1506 |
% \begin{macrocode} |
| 1507 |
\usepackage{geometry} |
| 1508 |
\geometry{layout=a4paper} |
| 1509 |
\geometry{paper=a4paper} |
| 1510 |
\geometry{margin=2.5cm} |
| 1511 |
\parindent0pt |
| 1512 |
\parskip1ex |
| 1513 |
% \end{macrocode} |
| 1514 |
|
| 1515 |
% Declare some options for the package \ctanpkg{hyperref}; |
| 1516 |
% it does not hurt to load it explicitly |
| 1517 |
% although \ctanpkg{metastr} will invoke it by default if not loaded: |
| 1518 |
% \begin{macrocode} |
| 1519 |
\PassOptionsToPackage{bookmarks=true}{hyperref} |
| 1520 |
\usepackage{hyperref} |
| 1521 |
% \end{macrocode} |
| 1522 |
|
| 1523 |
% Set some options for the \ctanpkg{metastr} package: |
| 1524 |
% \begin{macrocode} |
| 1525 |
\PassOptionsToPackage{loadlang=en|de|fr|es}{metastr} |
| 1526 |
%%\PassOptionsToPackage{loadlang=en|fr|es}{metastr} |
| 1527 |
%%\PassOptionsToPackage{loadlang=de|en}{metastr} |
| 1528 |
\PassOptionsToPackage{cclogocurr=euro}{metastr} |
| 1529 |
%%\PassOptionsToPackage{cclogoshape=slim}{metastr} |
| 1530 |
% \end{macrocode} |
| 1531 |
|
| 1532 |
% Include the \ctanpkg{metastr} package along with |
| 1533 |
% \ctanpkg{graphicx}, \ctanpkg{babel} |
| 1534 |
% and \ctanpkg{ccicons} (where available): |
| 1535 |
% \begin{macrocode} |
| 1536 |
\usepackage[titlematter]{metastr} |
| 1537 |
\usepackage{graphicx} |
| 1538 |
\usepackage[english]{babel} |
| 1539 |
\IfFileExists{ccicons.sty}{\usepackage{ccicons}}{} |
| 1540 |
% \end{macrocode} |
| 1541 |
|
| 1542 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1543 |
% \paragraph{Some Adjustments.} |
| 1544 |
% |
| 1545 |
% Declare some term to be translated; |
| 1546 |
% doesn't hurt to declare a couple of variants: |
| 1547 |
% \begin{macrocode} |
| 1548 |
\metasetterm[en]{Zurich}{Zurich} |
| 1549 |
\metasetterm[de]{Zurich}{Z\"rich} |
| 1550 |
\metasetterm[fr]{Zurich}{Zurich} |
| 1551 |
\metasetterm[es]{Zurich}{Z\'urich} |
| 1552 |
\metasetterm[it]{Zurich}{Zurigo} |
| 1553 |
\metasetterm[pt]{Zurich}{Zurique} |
| 1554 |
% \end{macrocode} |
| 1555 |
|
| 1556 |
% Define |subject| to combine |location| and |date| |
| 1557 |
% (as far as filled): |
| 1558 |
% \begin{macrocode} |
| 1559 |
\metaset{subject}{\metacompose[#1]{location}{location: } |
| 1560 |
{\metacompose[#1]{date}{, date: }{}{}} |
| 1561 |
{\metacompose[#1]{date}{date: }{}{}}} |
| 1562 |
% \end{macrocode} |
| 1563 |
|
| 1564 |
% Adjust title display: |
| 1565 |
% \begin{macrocode} |
| 1566 |
\metaset[skip]{subtitle}{\vspace{1ex}} |
| 1567 |
\metaset[skip]{author}{\vspace{2ex}} |
| 1568 |
\metaset[skip]{location}{\vspace{1ex}} |
| 1569 |
\metaset[skip]{date}{\vspace{1ex}} |
| 1570 |
\metaset[style]{title}{\LARGE\bfseries} |
| 1571 |
\metaset[style]{author}{\large\scshape} |
| 1572 |
\metaset[sep]{draft}{ -- } |
| 1573 |
%%\metaunset[sep]{date} |
| 1574 |
% \end{macrocode} |
| 1575 |
|
| 1576 |
% Write title also in english and german; |
| 1577 |
% write rights as PDF metadata also in English and Spanish: |
| 1578 |
% \begin{macrocode} |
| 1579 |
\metaset[altlang]{title}{en,de} |
| 1580 |
\metaset[altlang]{rightstext}{en,es} |
| 1581 |
\metaset[rights]{writepdf}{} |
| 1582 |
% \end{macrocode} |
| 1583 |
|
| 1584 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1585 |
% \paragraph{Set Document Data.} |
| 1586 |
% |
| 1587 |
% Set the document language: |
| 1588 |
% \begin{macrocode} |
| 1589 |
\metasetlang{en} |
| 1590 |
%%\metasetlang{de} |
| 1591 |
%%\metasetlang{de-CH} |
| 1592 |
%%\metasetlang{fr} |
| 1593 |
% \end{macrocode} |
| 1594 |
|
| 1595 |
% Define some document data: |
| 1596 |
% \begin{macrocode} |
| 1597 |
\metaset[en]{title}{A metastr Sample} |
| 1598 |
\metaset[de]{title}{Ein metastr Beispiel} |
| 1599 |
\metaset[print]{title}{A \textsf{metastr} Sample} |
| 1600 |
\metaset{subtitle}{Illustration of some features} |
| 1601 |
\metaset{author}{Niklas Beisert} |
| 1602 |
\metaset{keywords}{composition of title, application of licenses, translations} |
| 1603 |
\metaset{location}{\metatranslate[#1]{Zurich}} |
| 1604 |
\metaset{date}{2020/02/06} |
| 1605 |
\metaset{partof}{The metastr Package} |
| 1606 |
\metaset[print]{partof}{The \textsf{metastr} Package} |
| 1607 |
\metasetup{draft=true} |
| 1608 |
% \end{macrocode} |
| 1609 |
|
| 1610 |
% Copyright settings: |
| 1611 |
% \begin{macrocode} |
| 1612 |
\metaset{copyrightowner}{\metapick[#1]{author}} |
| 1613 |
\metaset{copyrightdate}{2020} |
| 1614 |
\metacopyright{doc} |
| 1615 |
%%\metacopyright{reserved} |
| 1616 |
% \end{macrocode} |
| 1617 |
|
| 1618 |
% License settings: |
| 1619 |
% \begin{macrocode} |
| 1620 |
%%\metaset{licenseversion}{1.2} |
| 1621 |
%%\metalicense{lppl} |
| 1622 |
% \end{macrocode} |
| 1623 |
|
| 1624 |
% Creative Commons License use: |
| 1625 |
% \begin{macrocode} |
| 1626 |
%%\metaset{licenseversion}{3.0} |
| 1627 |
\metalicensecc{by-sa} |
| 1628 |
%%\metalicensecc{by-nc-sa} |
| 1629 |
%%\metalicensecc{zero} |
| 1630 |
%%\metalicensecc{pd} |
| 1631 |
% \end{macrocode} |
| 1632 |
|
| 1633 |
% Scale the CC logo a bit: |
| 1634 |
% \begin{macrocode} |
| 1635 |
\metaset[cmd]{licenselogo}{\includegraphics[scale=0.75]{#1}} |
| 1636 |
% \end{macrocode} |
| 1637 |
|
| 1638 |
% Start document body: |
| 1639 |
% \begin{macrocode} |
| 1640 |
\begin{document} |
| 1641 |
% \end{macrocode} |
| 1642 |
|
| 1643 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1644 |
% \paragraph{Header.} |
| 1645 |
% |
| 1646 |
% Display title block: |
| 1647 |
% \begin{macrocode} |
| 1648 |
\pdfbookmark[1]{\metaterm{title}}{title} |
| 1649 |
\begin{center} |
| 1650 |
\metapick[print]{titlematter} |
| 1651 |
\end{center} |
| 1652 |
% \end{macrocode} |
| 1653 |
|
| 1654 |
% Display fineprint in fine print: |
| 1655 |
% \begin{macrocode} |
| 1656 |
\vspace{1ex}\hrule\par\vspace{1ex} |
| 1657 |
\begingroup\footnotesize |
| 1658 |
\pdfbookmark[1]{\metaterm{copyright}}{copyright} |
| 1659 |
\metapick[print]{rightstext} |
| 1660 |
\endgroup |
| 1661 |
\vspace{1ex}\hrule\par\vspace{1ex} |
| 1662 |
% \end{macrocode} |
| 1663 |
|
| 1664 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1665 |
% \paragraph{Content.} |
| 1666 |
% |
| 1667 |
% Some useful content: |
| 1668 |
% \begin{macrocode} |
| 1669 |
\section{Metadata Inspection} |
| 1670 |
|
| 1671 |
The metadata stored in this example PDF can be inspected with |
| 1672 |
the tool \texttt{pdfinfo}: |
| 1673 |
|
| 1674 |
\begin{tabular}{l} |
| 1675 |
\verb+pdfinfo metasamp.pdf+\\ |
| 1676 |
\verb+pdfinfo -meta metasamp.pdf | less+ |
| 1677 |
\end{tabular} |
| 1678 |
% \end{macrocode} |
| 1679 |
|
| 1680 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1681 |
% \paragraph{Translations.} |
| 1682 |
% |
| 1683 |
% Demonstration of terms and translations: |
| 1684 |
% \begin{macrocode} |
| 1685 |
\section{Translations} |
| 1686 |
|
| 1687 |
\begin{tabular}{ll} |
| 1688 |
document language:&\metaterm{Zurich}\\ |
| 1689 |
Spanish:&\metatranslate[es]{Zurich} |
| 1690 |
\end{tabular} |
| 1691 |
% \end{macrocode} |
| 1692 |
|
| 1693 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1694 |
% \paragraph{Creative Commons.} |
| 1695 |
% |
| 1696 |
% Demonstrate some CC terms: |
| 1697 |
% \begin{macrocode} |
| 1698 |
\metaif[]{cc@type}{ % only if a CC license is in use |
| 1699 |
\section{Creative Commons} |
| 1700 |
some representations of the selected license: |
| 1701 |
\begin{itemize} |
| 1702 |
\item license identifier: |
| 1703 |
\metapick[]{licensecc} |
| 1704 |
\item \texttt{short} identifier: |
| 1705 |
\metapick[short]{licensecc} |
| 1706 |
\item full form: |
| 1707 |
\metapick[]{licenseccfull} |
| 1708 |
\item \texttt{ident} form: |
| 1709 |
\metapick[ident]{licensecc} |
| 1710 |
\item \texttt{short} form: |
| 1711 |
\metapick[short]{licenseccfull} |
| 1712 |
\IfFileExists{ccicons.sty} |
| 1713 |
{\item \texttt{icon} forms: |
| 1714 |
-- \metapick[icon]{licensecc} |
| 1715 |
-- \metapick[icon]{licenseccfull} --}{} |
| 1716 |
\item \texttt{url} form: |
| 1717 |
\metapick[url]{licenseccfull} |
| 1718 |
\end{itemize} |
| 1719 |
}{} |
| 1720 |
% \end{macrocode} |
| 1721 |
|
| 1722 |
% End of document body: |
| 1723 |
% \begin{macrocode} |
| 1724 |
\end{document} |
| 1725 |
% \end{macrocode} |
| 1726 |
%\iffalse |
| 1727 |
%</sample> |
| 1728 |
%\fi |
| 1729 |
% |
| 1730 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1731 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1732 |
% \section{Implementation} |
| 1733 |
% \label{sec:implementation} |
| 1734 |
%\iffalse |
| 1735 |
%<*package> |
| 1736 |
%\fi |
| 1737 |
% |
| 1738 |
% This section describes the implementation of the package |metastr.sty|. |
| 1739 |
|
| 1740 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1741 |
% \subsection{Package Setup} |
| 1742 |
% \label{sec:imp-setup} |
| 1743 |
% |
| 1744 |
% The package declares a couple of setup options. |
| 1745 |
% |
| 1746 |
% It loads the package \ctanpkg{keyval} |
| 1747 |
% for extended options processing. |
| 1748 |
% \begin{macrocode} |
| 1749 |
\RequirePackage{keyval} |
| 1750 |
% \end{macrocode} |
| 1751 |
|
| 1752 |
% \macro{hyperref} |
| 1753 |
% \macro{hyperxmp} |
| 1754 |
% \macro{checkdef} |
| 1755 |
% \macro{cclogo} |
| 1756 |
% \macro{cclogocurr} |
| 1757 |
% \macro{cclogoshape} |
| 1758 |
% \macro{xmppdfinfo} |
| 1759 |
% Store the selected package options in some corresponding internal macros: |
| 1760 |
% \begin{macrocode} |
| 1761 |
\newif\ifmstr@opt@hyperref\mstr@opt@hyperreftrue |
| 1762 |
\newif\ifmstr@opt@hyperxmp\mstr@opt@hyperxmptrue |
| 1763 |
\newif\ifmstr@opt@checkdef\mstr@opt@checkdeftrue |
| 1764 |
\newif\ifmstr@opt@xmppdfinfo\mstr@opt@xmppdfinfotrue |
| 1765 |
\newif\ifmstr@opt@course\mstr@opt@coursefalse |
| 1766 |
\newif\ifmstr@opt@draft\mstr@opt@draftfalse |
| 1767 |
\newif\ifmstr@opt@titlematter\mstr@opt@titlematterfalse |
| 1768 |
\newif\ifmstr@opt@cclogo\mstr@opt@cclogotrue |
| 1769 |
\def\mstr@opt@cclogocurr{dollar} |
| 1770 |
\def\mstr@opt@cclogoshape{box} |
| 1771 |
\def\mstr@opt@loadlang{en} |
| 1772 |
\def\mstr@group{mstr@} |
| 1773 |
\define@key{\mstr@group}{hyperref}[true]{% |
| 1774 |
\csname mstr@opt@hyperref#1\endcsname} |
| 1775 |
\define@key{\mstr@group}{hyperxmp}[true]{% |
| 1776 |
\csname mstr@opt@hyperxmp#1\endcsname} |
| 1777 |
\define@key{\mstr@group}{checkdef}[true]{% |
| 1778 |
\csname mstr@opt@checkdef#1\endcsname} |
| 1779 |
\define@key{\mstr@group}{xmppdfinfo}[true]{% |
| 1780 |
\csname mstr@opt@xmppdfinfo#1\endcsname} |
| 1781 |
\define@key{\mstr@group}{cclogo}[true]{\csname mstr@opt@cclogo#1\endcsname} |
| 1782 |
\define@key{\mstr@group}{cclogocurr}{\def\mstr@opt@cclogocurr{#1}} |
| 1783 |
\define@key{\mstr@group}{cclogoshape}{\def\mstr@opt@cclogoshape{#1}} |
| 1784 |
\define@key{\mstr@group}{loadlang}{\def\mstr@opt@loadlang{#1}} |
| 1785 |
\define@key{\mstr@group}{course}[true]{\csname mstr@opt@course#1\endcsname} |
| 1786 |
\define@key{\mstr@group}{draft}[true]{\csname mstr@opt@draft#1\endcsname} |
| 1787 |
\define@key{\mstr@group}{titlematter}[true]{% |
| 1788 |
\csname mstr@opt@titlematter#1\endcsname} |
| 1789 |
% \end{macrocode} |
| 1790 |
|
| 1791 |
% Pass undeclared options on to \ctanpkg{keyval} processing: |
| 1792 |
% \begin{macrocode} |
| 1793 |
\DeclareOption*{\expandafter\setkeys\expandafter\mstr@group% |
| 1794 |
\expandafter{\CurrentOption}} |
| 1795 |
% \end{macrocode} |
| 1796 |
|
| 1797 |
% Process global options while loading package: |
| 1798 |
% \begin{macrocode} |
| 1799 |
\ProcessOptions |
| 1800 |
% \end{macrocode} |
| 1801 |
|
| 1802 |
% \macro{\metasetup} |
| 1803 |
% |\metasetup| processes package options |
| 1804 |
% when the package has already been loaded: |
| 1805 |
% \begin{macrocode} |
| 1806 |
\def\mstr@setup{mstr@setup} |
| 1807 |
\newcommand{\metasetup}[1]{\setkeys\mstr@setup{#1}} |
| 1808 |
% \end{macrocode} |
| 1809 |
|
| 1810 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1811 |
% \subsection{Definitions} |
| 1812 |
% \label{sec:imp-def} |
| 1813 |
% |
| 1814 |
% The following describes the basic definitions |
| 1815 |
% of the package. |
| 1816 |
% |
| 1817 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1818 |
% \paragraph{Required Packages.} |
| 1819 |
% |
| 1820 |
% The package loads the packages |
| 1821 |
% \ctanpkg{hyperref} and \ctanpkg{hyperxmp} |
| 1822 |
% (unless excluded): |
| 1823 |
% \begin{macrocode} |
| 1824 |
\ifmstr@opt@hyperref\RequirePackage{hyperref}\fi |
| 1825 |
\ifmstr@opt@hyperxmp\RequirePackage{hyperxmp}\fi |
| 1826 |
\ifmstr@opt@xmppdfinfo\ifdefined\xmptilde\hypersetup{keeppdfinfo}\fi\fi |
| 1827 |
% \end{macrocode} |
| 1828 |
|
| 1829 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1830 |
% \paragraph{General Definitions.} |
| 1831 |
% |
| 1832 |
% \macro{\mstr@exptwo} |
| 1833 |
% A macro to conveniently expand the third token in line: |
| 1834 |
% \begin{macrocode} |
| 1835 |
\def\mstr@exptwo#1{\expandafter#1\expandafter} |
| 1836 |
% \end{macrocode} |
| 1837 |
% \macro{\mstr@csdo} |
| 1838 |
% \macro{\mstr@csdotwo} |
| 1839 |
% Some macros to conveniently expand |\csname| arguments |
| 1840 |
% before expanding the macro: |
| 1841 |
% \begin{macrocode} |
| 1842 |
\def\mstr@csdo#1#2{\expandafter#1\csname#2\endcsname} |
| 1843 |
\def\mstr@csdotwo#1#2#3{\mstr@exptwo#1#2\csname#3\endcsname} |
| 1844 |
% \end{macrocode} |
| 1845 |
% \macro{\mstr@iftext} |
| 1846 |
% Check whether macro |#1| equals text |#2|, then do |#3|: |
| 1847 |
% \begin{macrocode} |
| 1848 |
\long\def\mstr@iftext#1#2#3{\def\mstr@tmp{#2}\ifx#1\mstr@tmp#3\fi} |
| 1849 |
% \end{macrocode} |
| 1850 |
|
| 1851 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1852 |
% \paragraph{Internal Definitions.} |
| 1853 |
% |
| 1854 |
% \macro{\mstr@lang@main} |
| 1855 |
% \macro{\mstr@lang@short} |
| 1856 |
% \macro{\mstr@lang@fallback} |
| 1857 |
% \macro{\mstr@lang@meta} |
| 1858 |
% Predefine language identifiers as empty. |
| 1859 |
% These define the language for the document text |
| 1860 |
% (with and without country code), document metadata |
| 1861 |
% and a fallback language: |
| 1862 |
% \begin{macrocode} |
| 1863 |
\let\mstr@lang@main\@empty |
| 1864 |
\let\mstr@lang@short\@empty |
| 1865 |
\let\mstr@lang@fallback\@empty |
| 1866 |
\let\mstr@lang@meta\@empty |
| 1867 |
% \end{macrocode} |
| 1868 |
|
| 1869 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1870 |
% \paragraph{Interface Definitions.} |
| 1871 |
% |
| 1872 |
% \macro{\metatilde} |
| 1873 |
% \macro{\metacomma} |
| 1874 |
% Define a macro for the tilde character (mostly for use within URLs); |
| 1875 |
% recycle the definitions from \ctanpkg{hyperxmp} if available: |
| 1876 |
% \begin{macrocode} |
| 1877 |
\ifdefined\xmptilde |
| 1878 |
\let\metatilde\xmptilde |
| 1879 |
\let\metacomma\xmpcomma |
| 1880 |
\else |
| 1881 |
\def\metatilde{~} |
| 1882 |
\def\metacomma{,} |
| 1883 |
\fi |
| 1884 |
% \end{macrocode} |
| 1885 |
|
| 1886 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1887 |
% \paragraph{Declare Registers.} |
| 1888 |
% |
| 1889 |
% \macro{\metadef} |
| 1890 |
% Declare a register: |
| 1891 |
% \begin{macrocode} |
| 1892 |
\newcommand{\metadef}[1]{% |
| 1893 |
\mstr@csdo\let{mstr@def@#1}\relax} |
| 1894 |
% \end{macrocode} |
| 1895 |
|
| 1896 |
% \macro{\mstr@verify} |
| 1897 |
% Verify the declaration of a register; |
| 1898 |
% throw an error if undeclared; |
| 1899 |
% disable checking for package option |checkdef=false|: |
| 1900 |
% \begin{macrocode} |
| 1901 |
\newcommand{\mstr@verify}[1]{% |
| 1902 |
\ifcsname mstr@def@#1\endcsname\else |
| 1903 |
\PackageError{metastr}{register `#1' undefined}{}% |
| 1904 |
\fi} |
| 1905 |
\ifmstr@opt@checkdef\else\def\mstr@verify#1{}\fi |
| 1906 |
% \end{macrocode} |
| 1907 |
|
| 1908 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1909 |
% \paragraph{Set Registers.} |
| 1910 |
% |
| 1911 |
% \macro{\mstr@setbare} |
| 1912 |
% Store the register value in the macro |
| 1913 |
% |\mstr@data@|\textit{reg}|@|\textit{var}; |
| 1914 |
% define one argument to pass along original variant: |
| 1915 |
% \begin{macrocode} |
| 1916 |
\long\def\mstr@setbare[#1]#2#3{% |
| 1917 |
\mstr@csdo\gdef{mstr@data@#2@#1}##1{#3}} |
| 1918 |
% \end{macrocode} |
| 1919 |
|
| 1920 |
% \macro{\mstr@set} |
| 1921 |
% Set the register value; verify whether the register has been declared: |
| 1922 |
% \begin{macrocode} |
| 1923 |
\long\def\mstr@set[#1]#2#3{\mstr@verify{#2}% |
| 1924 |
\mstr@setbare[#1]{#2}{#3}} |
| 1925 |
% \end{macrocode} |
| 1926 |
|
| 1927 |
% \macro{\metaset} |
| 1928 |
% Interface macro for setting register |
| 1929 |
% with optional variant argument: |
| 1930 |
% \begin{macrocode} |
| 1931 |
\newcommand{\metaset}{\@ifnextchar[{\mstr@set}{\mstr@set[]}} |
| 1932 |
% \end{macrocode} |
| 1933 |
|
| 1934 |
% \macro{\mstr@unset} |
| 1935 |
% Clear a register value: |
| 1936 |
% \begin{macrocode} |
| 1937 |
\long\def\mstr@unset[#1]#2{\mstr@verify{#2}% |
| 1938 |
\mstr@csdotwo\global\let{mstr@data@#2@#1}\@undefined} |
| 1939 |
% \end{macrocode} |
| 1940 |
|
| 1941 |
% \macro{\metaunset} |
| 1942 |
% Interface macro for clearing register |
| 1943 |
% with optional variant argument: |
| 1944 |
% \begin{macrocode} |
| 1945 |
\newcommand{\metaunset}{\@ifnextchar[{\mstr@unset}{\mstr@unset[]}} |
| 1946 |
% \end{macrocode} |
| 1947 |
|
| 1948 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1949 |
% \paragraph{Register Conditionals.} |
| 1950 |
% |
| 1951 |
% \macro{\metaif} |
| 1952 |
% If-then-else structure checking whether register variant is filled: |
| 1953 |
% \begin{macrocode} |
| 1954 |
\long\def\metaif[#1]#2#3#4{% |
| 1955 |
\ifcsname mstr@data@#2@#1\endcsname #3\else #4\fi} |
| 1956 |
% \end{macrocode} |
| 1957 |
|
| 1958 |
% \macro{\metaifpick} |
| 1959 |
% If-then-else structure checking if the register in either of the variants |
| 1960 |
% |#1|, |\mstr@lang@main|, |\mstr@lang@short|, |
| 1961 |
% default and |\mstr@lang@fallback| |
| 1962 |
% is filled; |
| 1963 |
% |#1| may in fact be a comma-separated list of variants (without spaces): |
| 1964 |
% \begin{macrocode} |
| 1965 |
\long\def\mstr@ifloop[#1,#2]#3#4#5{% |
| 1966 |
\metaif[#1]{#3}{#4}{\if @#2@#5\else\mstr@ifloop[#2]{#3}{#4}{#5}\fi}} |
| 1967 |
\long\def\metaifpick[#1]#2#3#4{% |
| 1968 |
\mstr@ifloop |
| 1969 |
[#1,\mstr@lang@main,\mstr@lang@short,,\mstr@lang@fallback,] |
| 1970 |
{#2}{#3}{#4}} |
| 1971 |
% \end{macrocode} |
| 1972 |
|
| 1973 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1974 |
% \paragraph{Manipulate Registers.} |
| 1975 |
% |
| 1976 |
% \macro{\mstr@append} |
| 1977 |
% Append some string to a register value: |
| 1978 |
% \begin{macrocode} |
| 1979 |
\long\def\mstr@append[#1]#2#3{% |
| 1980 |
\mstr@csdotwo\let\mstr@tmpa{mstr@data@#2@#1}% |
| 1981 |
\def\mstr@tmpb##1{\mstr@set[#1]{#2}{##1#3}}% |
| 1982 |
\mstr@exptwo\mstr@tmpb{\mstr@tmpa{##1}}} |
| 1983 |
% \end{macrocode} |
| 1984 |
|
| 1985 |
% \macro{\mstr@prepend} |
| 1986 |
% Prepend some string to a register value: |
| 1987 |
% \begin{macrocode} |
| 1988 |
\long\def\mstr@prepend[#1]#2#3{% |
| 1989 |
\mstr@csdotwo\let\mstr@tmpa{mstr@data@#2@#1}% |
| 1990 |
\def\mstr@tmpb##1{\mstr@set[#1]{#2}{#3##1}}% |
| 1991 |
\mstr@exptwo\mstr@tmpb{\mstr@tmpa{##1}}} |
| 1992 |
% \end{macrocode} |
| 1993 |
|
| 1994 |
% \macro{\mstr@addsep} |
| 1995 |
% Append a string to a register value separated by |#1| |
| 1996 |
% if the string was previously filled: |
| 1997 |
% \begin{macrocode} |
| 1998 |
\long\def\mstr@addsep[#1]#2#3#4{% |
| 1999 |
\metaif[#1]{#2}{\mstr@append[#1]{#2}{#3#4}}{\mstr@set[#1]{#2}{#4}}} |
| 2000 |
% \end{macrocode} |
| 2001 |
|
| 2002 |
% \macro{\metaappend} |
| 2003 |
% \macro{\metaprepend} |
| 2004 |
% \macro{\metaaddsep} |
| 2005 |
% Interface macros for appending, prepending |
| 2006 |
% and adding with separator: |
| 2007 |
% \begin{macrocode} |
| 2008 |
\newcommand{\metaappend}{% |
| 2009 |
\@ifnextchar[{\mstr@append}{\mstr@append[]}} |
| 2010 |
\newcommand{\metaprepend}{% |
| 2011 |
\@ifnextchar[{\mstr@prepend}{\mstr@prepend[]}} |
| 2012 |
\newcommand{\metaaddsep}{% |
| 2013 |
\@ifnextchar[{\mstr@addsep}{\mstr@addsep[]}} |
| 2014 |
% \end{macrocode} |
| 2015 |
|
| 2016 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2017 |
% \paragraph{Read Register Values.} |
| 2018 |
% |
| 2019 |
% \macro{\mstr@getbare} |
| 2020 |
% Read a register value |
| 2021 |
% while passing along the original variant as an argument: |
| 2022 |
% \begin{macrocode} |
| 2023 |
\def\mstr@getbare[#1]#2#3{\csname mstr@data@#2@#1\endcsname{#3}} |
| 2024 |
% \end{macrocode} |
| 2025 |
|
| 2026 |
% \macro{\metaget} |
| 2027 |
% Interface function to read register value |
| 2028 |
% with mandatory variant argument in square brackets; |
| 2029 |
% return nothing if register clean: |
| 2030 |
% \begin{macrocode} |
| 2031 |
\def\metaget[#1]#2{% |
| 2032 |
\metaif[#1]{#2}{\mstr@getbare[#1]{#2}{#1}}{}}% |
| 2033 |
% \end{macrocode} |
| 2034 |
|
| 2035 |
% \macro{\metacompose} |
| 2036 |
% \macro{\metapick} |
| 2037 |
% |\metapick| returns a filled register value among the variants |
| 2038 |
% |#1|, |\mstr@lang@main|, |\mstr@lang@short|, default |
| 2039 |
% and |\mstr@lang@fallback| |
| 2040 |
% (in this order of preference), otherwise it returns nothing; |
| 2041 |
% |#1| may in fact be a comma-separated list of variants (without spaces); |
| 2042 |
% |\metacompose| sandwiches the value between |#3| and |#4| if found, |
| 2043 |
% and otherwise returns |#5|: |
| 2044 |
% \begin{macrocode} |
| 2045 |
\long\def\mstr@composeloop[#1,#2]#3#4#5#6#7{% |
| 2046 |
\metaif[#1]{#4}{#5\mstr@getbare[#1]{#4}{#3}#6} |
| 2047 |
{\if @#2@#7\else\mstr@composeloop[#2]{#3}{#4}{#5}{#6}{#7}\fi}} |
| 2048 |
\long\def\metacompose[#1]#2#3#4#5{% |
| 2049 |
\mstr@composeloop |
| 2050 |
[#1,\mstr@lang@main,\mstr@lang@short,,\mstr@lang@fallback,]{#1} |
| 2051 |
{#2}{#3}{#4}{#5}}% |
| 2052 |
\def\metapick[#1]#2{\metacompose[#1]{#2}{}{}{}} |
| 2053 |
% \end{macrocode} |
| 2054 |
|
| 2055 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2056 |
% \paragraph{Language Selection.} |
| 2057 |
% |
| 2058 |
% \macro{language} |
| 2059 |
% Declare language register: |
| 2060 |
% \begin{macrocode} |
| 2061 |
\metadef{language} |
| 2062 |
% \end{macrocode} |
| 2063 |
% \macro{\metasetlang} |
| 2064 |
% Set language and extract short forms: |
| 2065 |
% \begin{macrocode} |
| 2066 |
\def\mstr@lang@split#1#2-#3@{% |
| 2067 |
\mstr@csdo\gdef{mstr@lang@#1}{#2}} |
| 2068 |
\newcommand{\mstr@setlang@main}[1]{% |
| 2069 |
\metaset{language}{#1}% |
| 2070 |
\gdef\mstr@lang@main{#1}% |
| 2071 |
\mstr@lang@split{short}#1-@% |
| 2072 |
\metaset[short]{language}{\mstr@lang@short}% |
| 2073 |
\metaif[meta]{language}{}{\mstr@lang@split{meta}#1-@}} |
| 2074 |
\newcommand{\mstr@setlang@meta}[1]{% |
| 2075 |
\metaset[meta]{language}{#1}% |
| 2076 |
\mstr@lang@split{meta}#1-@% |
| 2077 |
\metaset[metashort]{language}{\mstr@lang@meta}} |
| 2078 |
\newcommand{\metasetlang}{% |
| 2079 |
\@ifstar\mstr@setlang@meta\mstr@setlang@main} |
| 2080 |
% \end{macrocode} |
| 2081 |
|
| 2082 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2083 |
% \paragraph{Terms.} |
| 2084 |
% |
| 2085 |
% \macro{\metaterm} |
| 2086 |
% \macro{\metatranslate} |
| 2087 |
% \macro{\metasetterm} |
| 2088 |
% Macros for filling and reading term registers: |
| 2089 |
% \begin{macrocode} |
| 2090 |
\newcommand{\metaterm}{\metatranslate[]} |
| 2091 |
\def\metatranslate[#1]#2{\metapick[#1]{term-#2}} |
| 2092 |
\long\def\mstr@setterm[#1]#2#3{% |
| 2093 |
\metadef{term-#2}\mstr@setbare[#1]{term-#2}{#3}} |
| 2094 |
\newcommand{\metasetterm}{\@ifnextchar[{\mstr@setterm}{\mstr@setterm[]}} |
| 2095 |
% \end{macrocode} |
| 2096 |
|
| 2097 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2098 |
% \paragraph{Automatic Writing to PDF.} |
| 2099 |
% |
| 2100 |
% \macro{writepdf} |
| 2101 |
% Declare register |writepdf| to control automatic |
| 2102 |
% writing of metadata to PDF files: |
| 2103 |
% \begin{macrocode} |
| 2104 |
\metadef{writepdf} |
| 2105 |
\metaset[auto]{writepdf}{} |
| 2106 |
\metaset[preamble]{writepdf}{} |
| 2107 |
\metaset[info]{writepdf}{} |
| 2108 |
\metaset[aux]{writepdf}{} |
| 2109 |
% \end{macrocode} |
| 2110 |
|
| 2111 |
% \macro{\mstr@ifwritepdf} |
| 2112 |
% Auxiliary macro to write some type of metadata if switch activated, |
| 2113 |
% disable switch afterwards: |
| 2114 |
% \begin{macrocode} |
| 2115 |
\long\def\mstr@ifwritepdf[#1]#2{% |
| 2116 |
\metaif[#1]{writepdf}{#2\metaunset[#1]{writepdf}}{}} |
| 2117 |
% \end{macrocode} |
| 2118 |
|
| 2119 |
% \macro{\metawritepdf} |
| 2120 |
% Write selected types of metadata to PDF file: |
| 2121 |
% \begin{macrocode} |
| 2122 |
\newcommand{\metawritepdf}{% |
| 2123 |
\mstr@ifwritepdf[preamble]{\metawritepdfpreamble}% |
| 2124 |
\mstr@ifwritepdf[info]{\metawritepdfinfo}% |
| 2125 |
\mstr@ifwritepdf[aux]{\metawritepdfaux}% |
| 2126 |
\mstr@ifwritepdf[contact]{\metawritepdfcontact}% |
| 2127 |
\mstr@ifwritepdf[rights]{\metawritepdfrights}% |
| 2128 |
} |
| 2129 |
% \end{macrocode} |
| 2130 |
|
| 2131 |
% \macro{\mstr@begindoc} |
| 2132 |
% \macro{\mstr@begindocpreamble} |
| 2133 |
% Hook for writing data to PDF file; |
| 2134 |
% this is the last chance to write the preamble set of data to the PDF |
| 2135 |
% (|pdflang| must be declared before \ctanpkg{hyperxmp} |
| 2136 |
% detects languages at the end of the preamble |
| 2137 |
% and before \ctanpkg{hyperref} sets it at the beginning of the document): |
| 2138 |
% \begin{macrocode} |
| 2139 |
\newcommand{\mstr@begindoc}{% |
| 2140 |
\mstr@ifwritepdf[auto]{\metawritepdf}} |
| 2141 |
\newcommand{\mstr@begindocpreamble}{% |
| 2142 |
\mstr@ifwritepdf[preamble]{\metawritepdfpreamble}} |
| 2143 |
% \end{macrocode} |
| 2144 |
|
| 2145 |
% Hook |\mstr@begindoc| to begining of |document| block |
| 2146 |
% (before hooks by \ctanpkg{hyperref} and \ctanpkg{hyperxmp} are called, |
| 2147 |
% just in case); |
| 2148 |
% hook |\mstr@begindocpreamble| to begining of |document| block |
| 2149 |
% before hooks by \ctanpkg{hyperxmp} are called; |
| 2150 |
% legacy code for latex releases earlier than 2020-10 |
| 2151 |
% to add hook before all other hooks are called: |
| 2152 |
% \begin{macrocode} |
| 2153 |
\ifdefined\AddToHook |
| 2154 |
\DeclareHookRule{begindocument}{metastr}{before}{hyperref} |
| 2155 |
\DeclareHookRule{begindocument}{metastr}{before}{hyperxmp} |
| 2156 |
\AddToHook{begindocument}{\mstr@begindoc} |
| 2157 |
\DeclareHookRule{begindocument/before}{metastr}{before}{hyperxmp} |
| 2158 |
\AddToHook{begindocument/before}{\mstr@begindocpreamble} |
| 2159 |
\else |
| 2160 |
\AtBeginDocument{\mstr@begindoc} |
| 2161 |
\begingroup |
| 2162 |
\toks@\expandafter{\expandafter\mstr@begindocpreamble\@begindocumenthook} |
| 2163 |
\xdef\@begindocumenthook{\the\toks@} |
| 2164 |
\endgroup |
| 2165 |
\fi |
| 2166 |
% \end{macrocode} |
| 2167 |
|
| 2168 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2169 |
% \subsection{Basic Registers} |
| 2170 |
% \label{sec:imp-basic} |
| 2171 |
% |
| 2172 |
% The following defines a set of basic and auxiliary registers. |
| 2173 |
% |
| 2174 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2175 |
% \paragraph{Declarations.} |
| 2176 |
% |
| 2177 |
% \macro{draft} |
| 2178 |
% Declare register to state draft mode: |
| 2179 |
% \begin{macrocode} |
| 2180 |
\metadef{draft} |
| 2181 |
% \end{macrocode} |
| 2182 |
% Set draft text (if |draft| option set), declare |draft| option: |
| 2183 |
% \begin{macrocode} |
| 2184 |
\newcommand{\mstr@set@draft}{% |
| 2185 |
\ifmstr@opt@draft\metaset{draft}{\metatranslate[##1]{draft}}% |
| 2186 |
\else\metaunset{draft}\fi} |
| 2187 |
\define@key{\mstr@setup}{draft}[true]{% |
| 2188 |
\csname mstr@opt@draft#1\endcsname\mstr@set@draft}% |
| 2189 |
\mstr@set@draft |
| 2190 |
% \end{macrocode} |
| 2191 |
|
| 2192 |
% \macro{title} |
| 2193 |
% \macro{subtitle} |
| 2194 |
% \macro{author} |
| 2195 |
% \macro{date} |
| 2196 |
% \macro{location} |
| 2197 |
% \macro{subject} |
| 2198 |
% \macro{keywords} |
| 2199 |
% Basic registers: |
| 2200 |
% \begin{macrocode} |
| 2201 |
\metadef{title} |
| 2202 |
\metadef{subtitle} |
| 2203 |
\metadef{author} |
| 2204 |
\metadef{date} |
| 2205 |
\metadef{location} |
| 2206 |
\metadef{subject} |
| 2207 |
\metadef{keywords} |
| 2208 |
% \end{macrocode} |
| 2209 |
|
| 2210 |
% \macro{linebreak} |
| 2211 |
% Declare an auxiliary register to break a line in |print| variant |
| 2212 |
% and display a space otherwise: |
| 2213 |
% \begin{macrocode} |
| 2214 |
\metadef{linebreak} |
| 2215 |
\metaset[]{linebreak}{ } |
| 2216 |
\metaset[print]{linebreak}{\\} |
| 2217 |
% \end{macrocode} |
| 2218 |
|
| 2219 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2220 |
% \paragraph{Title and Author Composition.} |
| 2221 |
% |
| 2222 |
% \macro{titlematter} |
| 2223 |
% \macro{titletext} |
| 2224 |
% \macro{authortext} |
| 2225 |
% \macro{datatext} |
| 2226 |
% Declare register to compose title display (analogous to |\maketitle|): |
| 2227 |
% \begin{macrocode} |
| 2228 |
\metadef{titlematter} |
| 2229 |
\metadef{titletext} |
| 2230 |
\metadef{authortext} |
| 2231 |
\metadef{datatext} |
| 2232 |
% \end{macrocode} |
| 2233 |
|
| 2234 |
% \macro{\metatitleline} |
| 2235 |
% \macro{\metatitlelinetwo} |
| 2236 |
% Macros to print a formatted title line |
| 2237 |
% with one or two items; |
| 2238 |
% variant |skip| produces vertical skip before the item, |
| 2239 |
% variant |style| sets the text style, |
| 2240 |
% variant |sep| defines the separator between |
| 2241 |
% two items or undefined for two independent lines: |
| 2242 |
% \begin{macrocode} |
| 2243 |
\def\metatitleline[#1]#2{% |
| 2244 |
\metacompose[#1]{#2} |
| 2245 |
{\metaget[skip]{#2}\begingroup\metaget[style]{#2}} |
| 2246 |
{\par\endgroup}{}} |
| 2247 |
\def\metatitlelinetwo[#1]#2[#3]#4{% |
| 2248 |
\metaif[sep]{#4} |
| 2249 |
{\metacompose[#1]{#2} |
| 2250 |
{\metaget[skip]{#2}\begingroup\metaget[style]{#2}} |
| 2251 |
{\metacompose[#3]{#4}{\metaget[sep]{#4}}{}{}\par\endgroup} |
| 2252 |
{\metatitleline[#3]{#4}}} |
| 2253 |
{\metatitleline[#1]{#2}\metatitleline[#3]{#4}}} |
| 2254 |
% \end{macrocode} |
| 2255 |
|
| 2256 |
% Set default layout and spacing: |
| 2257 |
% \begin{macrocode} |
| 2258 |
\metaset[style]{title}{\LARGE} |
| 2259 |
\metaset[style]{subtitle}{\large} |
| 2260 |
\metaset[style]{draft}{\large} |
| 2261 |
\metaset[style]{author}{\large} |
| 2262 |
\metaset[style]{location}{\large} |
| 2263 |
\metaset[style]{date}{\large} |
| 2264 |
\metaset[skip]{subtitle}{\vspace{1.5em}} |
| 2265 |
\metaset[skip]{draft}{\vspace{1.5em}} |
| 2266 |
\metaset[skip]{author}{\vspace{3em}} |
| 2267 |
\metaset[skip]{location}{\vspace{1.5em}} |
| 2268 |
\metaset[skip]{date}{\vspace{1.5em}} |
| 2269 |
\metaset[sep]{subtitle}{ -- } |
| 2270 |
\metaset[sep]{date}{, } |
| 2271 |
\metaset[sep]{draft}{: } |
| 2272 |
% \end{macrocode} |
| 2273 |
% Preset for |titlematter|, |titletext|, |authortext| and |datatext| |
| 2274 |
% in generic and |print| variants: |
| 2275 |
% \begin{macrocode} |
| 2276 |
\metaset{titletext}{% |
| 2277 |
\metacompose[#1]{draft}{}{\metaget[sep]{draft}}{}% |
| 2278 |
\metapick[#1]{title}% |
| 2279 |
\metacompose[#1]{subtitle}{\metaget[sep]{subtitle}}{}{}} |
| 2280 |
\metaset{authortext}{\metapick[#1]{author}} |
| 2281 |
\metaset{datatext}{% |
| 2282 |
\metacompose[#1]{location}{}{\metaget[sep]{date}}{}% |
| 2283 |
\metapick[#1]{date}} |
| 2284 |
\metaset{titlematter}{% |
| 2285 |
\metapick[#1]{titletext}% |
| 2286 |
\metapick[#1]{authortext}% |
| 2287 |
\metapick[#1]{datatext}% |
| 2288 |
\metaget[skip]{titlematter}} |
| 2289 |
\metaset[print]{titletext}{% |
| 2290 |
\metatitleline[print]{title}% |
| 2291 |
\metatitlelinetwo[print]{subtitle}[print]{draft}} |
| 2292 |
\metaset[print]{authortext}{% |
| 2293 |
\metatitleline[print]{author}} |
| 2294 |
\metaset[print]{datatext}{% |
| 2295 |
\metatitlelinetwo[print]{location}[print]{date}} |
| 2296 |
% \end{macrocode} |
| 2297 |
% Legacy presets: |
| 2298 |
% \begin{macrocode} |
| 2299 |
\ifmstr@opt@titlematter\else |
| 2300 |
\metaset{titlematter}{% |
| 2301 |
\metapick[#1]{titletext}% |
| 2302 |
\metaget[skip]{titlematter}} |
| 2303 |
\metaset[print]{titletext}{% |
| 2304 |
\metatitleline[print]{title}% |
| 2305 |
\metatitlelinetwo[print]{subtitle}[print]{draft}% |
| 2306 |
\metapick[print]{authortext}% |
| 2307 |
\metapick[print]{datatext}} |
| 2308 |
\fi |
| 2309 |
% \end{macrocode} |
| 2310 |
|
| 2311 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2312 |
% \paragraph{Further Registers.} |
| 2313 |
% |
| 2314 |
% \macro{url} |
| 2315 |
% \macro{urlmessage} |
| 2316 |
% Registers for document URL and message to display it: |
| 2317 |
% \begin{macrocode} |
| 2318 |
\metadef{url} |
| 2319 |
\metadef{urlmessage} |
| 2320 |
% \end{macrocode} |
| 2321 |
% Print URL as hyperlink: |
| 2322 |
% \begin{macrocode} |
| 2323 |
\metaset[print]{url}{\url{\metaget[]{url}}} |
| 2324 |
% \end{macrocode} |
| 2325 |
% URL message default text (translated): |
| 2326 |
% \translate{urlmessage} |
| 2327 |
% \begin{macrocode} |
| 2328 |
% \metaset{urlmessage}{% |
| 2329 |
% The current version of this work can be found at: |
| 2330 |
% \metapick[#1]{url}.} |
| 2331 |
% \end{macrocode} |
| 2332 |
|
| 2333 |
% \macro{partof} |
| 2334 |
% \macro{partofmessage} |
| 2335 |
% Registers for document URL and message to display it: |
| 2336 |
% \begin{macrocode} |
| 2337 |
\metadef{partof} |
| 2338 |
\metadef{partofmessage} |
| 2339 |
% \end{macrocode} |
| 2340 |
% part of message default text (translated): |
| 2341 |
% \translate{partofmessage} |
| 2342 |
% \begin{macrocode} |
| 2343 |
% \metaset{partofmessage}{% |
| 2344 |
% This document is part of the work: \metapick[#1]{partof}.} |
| 2345 |
% \end{macrocode} |
| 2346 |
|
| 2347 |
% \macro{source} |
| 2348 |
% Register for source name: |
| 2349 |
% \begin{macrocode} |
| 2350 |
\metadef{source} |
| 2351 |
% \end{macrocode} |
| 2352 |
|
| 2353 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2354 |
% \paragraph{Write to PDF.} |
| 2355 |
% |
| 2356 |
% \macro{\metawritepdfpreamble} |
| 2357 |
% Write some registers to PDF that need to be written |
| 2358 |
% before the start of the document: |
| 2359 |
% \begin{macrocode} |
| 2360 |
\newcommand{\metawritepdfpreamble}{\ifdefined\hypersetup |
| 2361 |
\metaif[]{language} |
| 2362 |
{\hypersetup{pdflang={\metaget[]{language}}}}{}% |
| 2363 |
\ifdefined\xmptilde |
| 2364 |
\metaif[meta]{language} |
| 2365 |
{\hypersetup{pdfmetalang={\metaget[meta]{language}}}}{}% |
| 2366 |
\fi\fi} |
| 2367 |
% \end{macrocode} |
| 2368 |
|
| 2369 |
% \macro{\metawritepdfinfo} |
| 2370 |
% Write the basic registers to PDF; |
| 2371 |
% also write alternative language representations |
| 2372 |
% of |pdftitle| and |pdfsubject|: |
| 2373 |
% \begin{macrocode} |
| 2374 |
\newcommand{\metawritepdfinfo}{\ifdefined\hypersetup |
| 2375 |
\metaifpick[\mstr@lang@meta]{author} |
| 2376 |
{\hypersetup{pdfauthor={\metapick[\mstr@lang@meta]{authortext}}}}{}% |
| 2377 |
\metaifpick[\mstr@lang@meta]{title} |
| 2378 |
{\hypersetup{pdftitle={\metapick[\mstr@lang@meta]{titletext}}}}{}% |
| 2379 |
\metaifpick[\mstr@lang@meta]{subject} |
| 2380 |
{\hypersetup{pdfsubject={\metapick[\mstr@lang@meta]{subject}}}}{}% |
| 2381 |
\metaifpick[\mstr@lang@meta]{keywords} |
| 2382 |
{\hypersetup{pdfkeywords={\metapick[\mstr@lang@meta]{keywords}}}}{}% |
| 2383 |
\ifdefined\xmptilde |
| 2384 |
\metaif[altlang]{title}{% |
| 2385 |
\@for\mstr@tmp:=\mstr@data@title@altlang{}\do{% |
| 2386 |
\metaifpick[\mstr@tmp]{title} |
| 2387 |
{\XMPLangAlt{\mstr@tmp}{pdftitle= |
| 2388 |
{\metapick[\mstr@tmp]{titletext}}}}{}}% |
| 2389 |
\metaunset[altlang]{title}}{}% |
| 2390 |
\metaif[altlang]{subject}{% |
| 2391 |
\@for\mstr@tmp:=\mstr@data@subject@altlang{}\do{% |
| 2392 |
\metaifpick[\mstr@tmp]{subject} |
| 2393 |
{\XMPLangAlt{\mstr@tmp}{pdfsubject= |
| 2394 |
{\metapick[\mstr@tmp]{subject}}}}{}}% |
| 2395 |
\metaunset[altlang]{subject}}{}% |
| 2396 |
\fi\fi} |
| 2397 |
% \end{macrocode} |
| 2398 |
|
| 2399 |
% \macro{\metawritepdfaux} |
| 2400 |
% Write auxiliary registers to PDF: |
| 2401 |
% \begin{macrocode} |
| 2402 |
\newcommand{\metawritepdfaux}{\ifdefined\hypersetup\ifdefined\xmptilde |
| 2403 |
\metaif[]{url} |
| 2404 |
{\hypersetup{pdfurl={\metaget[]{url}}}}{}% |
| 2405 |
\hypersetup{pdfsource={}}% |
| 2406 |
\metaif[]{source} |
| 2407 |
{\hypersetup{pdfsource={\metaget[]{source}}}}{}% |
| 2408 |
\fi\fi} |
| 2409 |
% \end{macrocode} |
| 2410 |
|
| 2411 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2412 |
% \subsection{Copyright and License} |
| 2413 |
% \label{sec:imp-rights} |
| 2414 |
% |
| 2415 |
% The following defines some registers concerning |
| 2416 |
% copyright and licensing. |
| 2417 |
% |
| 2418 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2419 |
% \paragraph{Rights Composition.} |
| 2420 |
% |
| 2421 |
% \macro{rightstext} |
| 2422 |
% Declare a register to compose copyright and license information: |
| 2423 |
% \begin{macrocode} |
| 2424 |
\metadef{rightstext} |
| 2425 |
% \end{macrocode} |
| 2426 |
% Define generic version of composition register: |
| 2427 |
% \begin{macrocode} |
| 2428 |
\metaset{rightstext}{% |
| 2429 |
\metaifpick[]{partof}{\metacompose[#1]{partofmessage}{}{ }{}}{}% |
| 2430 |
\metapick[#1]{copyrightstatement}% |
| 2431 |
\metacompose[#1]{copyrightmessage}{ }{}{}% |
| 2432 |
\metacompose[#1]{licensemessage}{ }{}{}% |
| 2433 |
\metaif[]{licenseurl}{\metacompose[#1]{licenseurlmessage}{ }{}{}}{}% |
| 2434 |
\metaif[]{url}{\metacompose[#1]{urlmessage}{ }{}{}}{}% |
| 2435 |
} |
| 2436 |
% \end{macrocode} |
| 2437 |
% Define print version of composition register; |
| 2438 |
% variant |sep| contains code to separate parts of the message: |
| 2439 |
% \begin{macrocode} |
| 2440 |
\metaset[skip]{rightstext}{\par\addvspace\medskipamount} |
| 2441 |
\metaset[print]{rightstext}{% |
| 2442 |
\metaifpick[]{partof}{% |
| 2443 |
\metacompose[#1]{partofmessage}{}{\metaget[skip]{rightstext}}{}}{}% |
| 2444 |
\metacompose[#1]{copyrightstatement}{}{\metaget[skip]{rightstext}}{}% |
| 2445 |
\metacompose[#1]{copyrightmessage}{}{ }{}% |
| 2446 |
\metacompose[#1]{licensemessage}{}{ }{}% |
| 2447 |
\metaif[]{licenselogo}{% |
| 2448 |
\metacompose[#1]{licenselogomessage} |
| 2449 |
{\metaget[skip]{rightstext}}{\metaget[skip]{rightstext}}{}}{}% |
| 2450 |
\metaif[]{licenseurl}{\metacompose[#1]{licenseurlmessage}{ }{ }{}}{}% |
| 2451 |
\metaif[]{url}{\metacompose[#1]{urlmessage} |
| 2452 |
{\metaget[skip]{rightstext}}{}{}}{} |
| 2453 |
\metacompose[#1]{attributionmessage}{\metaget[skip]{rightstext}}{}{}% |
| 2454 |
} |
| 2455 |
% \end{macrocode} |
| 2456 |
|
| 2457 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2458 |
% \paragraph{Copyright Composition.} |
| 2459 |
% |
| 2460 |
% \macro{copyright...} |
| 2461 |
% Declare registers to specify document copyright: |
| 2462 |
% \begin{macrocode} |
| 2463 |
\metadef{copyrightmark} |
| 2464 |
\metadef{copyrightdate} |
| 2465 |
\metadef{copyrightowner} |
| 2466 |
\metadef{copyrightstatement} |
| 2467 |
\metadef{copyrightmessage} |
| 2468 |
% \end{macrocode} |
| 2469 |
|
| 2470 |
% \macro{copyrightmark} |
| 2471 |
% The copyright sign or word: |
| 2472 |
% \begin{macrocode} |
| 2473 |
\metaset{copyrightmark}{Copyright} |
| 2474 |
\metaset[print]{copyrightmark}{\copyright} |
| 2475 |
% \end{macrocode} |
| 2476 |
|
| 2477 |
% \macro{copyrightstatement} |
| 2478 |
% Assemble the copyright statement from available fragments; |
| 2479 |
% proper spacing makes this a bit tedious: |
| 2480 |
% \begin{macrocode} |
| 2481 |
\metaset{copyrightstatement}{\metaifpick[#1]{copyrightdate}% |
| 2482 |
{\metapick[#1]{copyrightmark} \metapick[#1]{copyrightdate}% |
| 2483 |
\metacompose[#1]{copyrightowner}{ }{}{}.} |
| 2484 |
{\metaifpick[#1]{copyrightowner} |
| 2485 |
{\metapick[#1]{copyrightmark} \metapick[#1]{copyrightowner}.}{}}} |
| 2486 |
% \end{macrocode} |
| 2487 |
|
| 2488 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2489 |
% \paragraph{License Composition.} |
| 2490 |
% |
| 2491 |
% \macro{license...} |
| 2492 |
% Declare registers to specify document license: |
| 2493 |
% \begin{macrocode} |
| 2494 |
\metadef{licenseversion} |
| 2495 |
\metadef{licenseprovider} |
| 2496 |
\metadef{licensemessage} |
| 2497 |
\metadef{licenselogo} |
| 2498 |
\metadef{licenselogomessage} |
| 2499 |
\metadef{licenseurl} |
| 2500 |
\metadef{licenseurlmessage} |
| 2501 |
% \end{macrocode} |
| 2502 |
|
| 2503 |
% \macro{attributionmessage} |
| 2504 |
% Declare a register for the attribution message: |
| 2505 |
% \begin{macrocode} |
| 2506 |
\metadef{attributionmessage} |
| 2507 |
% \end{macrocode} |
| 2508 |
|
| 2509 |
% \macro{licenseurlmessage} |
| 2510 |
% Message to declare URL at which the relevant license |
| 2511 |
% or further details can be found (translated): |
| 2512 |
% \translate{licenseurlmessage} |
| 2513 |
% \begin{macrocode} |
| 2514 |
% \metaset{licenseurlmessage}{% |
| 2515 |
% To view a copy of this license, visit: \metapick[#1]{licenseurl}.} |
| 2516 |
% \end{macrocode} |
| 2517 |
|
| 2518 |
% \macro{licenseurl} |
| 2519 |
% In |print| version, pass plain |licenseurl| through |\url|: |
| 2520 |
% \begin{macrocode} |
| 2521 |
\metaset[print]{licenseurl}{\url{\metaget[]{licenseurl}}} |
| 2522 |
% \end{macrocode} |
| 2523 |
|
| 2524 |
% \macro{licenselogo} |
| 2525 |
% \macro{licenselogomessage} |
| 2526 |
% Display license logo, by default align centrally; |
| 2527 |
% abuse the variant argument for passing the file name argument |
| 2528 |
% to |\includegraphics|: |
| 2529 |
% \begin{macrocode} |
| 2530 |
\metaset[print]{licenselogomessage}{% |
| 2531 |
\centerline{\metapick[#1]{licenselogo}}} |
| 2532 |
\metaset[cmd]{licenselogo}{\includegraphics{#1}} |
| 2533 |
\metaset[print]{licenselogo}{% |
| 2534 |
\IfFileExists{\metaget[]{licenselogo}.pdf}% |
| 2535 |
{\mstr@getbare[cmd]{licenselogo}{\metaget[]{licenselogo}}}% |
| 2536 |
{\mstr@getbare[cmd]{licenselogo}{\metaget[nocurr]{licenselogo}}}} |
| 2537 |
% \end{macrocode} |
| 2538 |
|
| 2539 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2540 |
% \paragraph{Write to PDF.} |
| 2541 |
% |
| 2542 |
% \macro{\metawritepdfrights} |
| 2543 |
% Write rights information |
| 2544 |
% (rights text, alternative language representations, license url) |
| 2545 |
% to PDF via \ctanpkg{hyperxmp}: |
| 2546 |
% \begin{macrocode} |
| 2547 |
\newcommand{\metawritepdfrights}{\ifdefined\hypersetup\ifdefined\xmptilde |
| 2548 |
\metaifpick[\mstr@lang@meta]{rightstext} |
| 2549 |
{\hypersetup{pdfcopyright= |
| 2550 |
{\metapick[\mstr@lang@meta]{rightstext}}}}{}% |
| 2551 |
\metaif[altlang]{rightstext} |
| 2552 |
{\@for\mstr@tmp:=\mstr@data@rightstext@altlang{}\do |
| 2553 |
{\XMPLangAlt{\mstr@tmp}{pdfcopyright= |
| 2554 |
{\metapick[\mstr@tmp]{rightstext}}}}}{} |
| 2555 |
\metaifpick[\mstr@lang@meta]{licenseurl} |
| 2556 |
{\hypersetup{pdflicenseurl= |
| 2557 |
{\metapick[\mstr@lang@meta]{licenseurl}}}}{}% |
| 2558 |
\fi\fi} |
| 2559 |
% \end{macrocode} |
| 2560 |
|
| 2561 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2562 |
% \paragraph{Copyright Presets.} |
| 2563 |
% |
| 2564 |
% \macro{copyright@...} |
| 2565 |
% Declare some copyright presets: |
| 2566 |
% \begin{macrocode} |
| 2567 |
\metadef{copyright@plain} |
| 2568 |
\metadef{copyright@parts} |
| 2569 |
\metadef{copyright@doc} |
| 2570 |
\metadef{copyright@doc-parts} |
| 2571 |
\metadef{copyright@reserved} |
| 2572 |
\metadef{copyright@publicdomain} |
| 2573 |
% \end{macrocode} |
| 2574 |
% \macro{plain} |
| 2575 |
% \macro{parts} |
| 2576 |
% \macro{doc} |
| 2577 |
% \macro{doc-parts} |
| 2578 |
% \macro{reserved} |
| 2579 |
% Some plain copyright messages (translated): |
| 2580 |
% \translate{copyright@plain} |
| 2581 |
% \translate{copyright@parts} |
| 2582 |
% \translate{copyright@doc} |
| 2583 |
% \translate{copyright@doc-parts} |
| 2584 |
% \translate{copyright@reserved} |
| 2585 |
% \begin{macrocode} |
| 2586 |
% \metaset{copyright@plain}{% |
| 2587 |
% This work is protected by copyright.} |
| 2588 |
% \metaset{copyright@parts}{% |
| 2589 |
% This work as well as its parts is protected by copyright.} |
| 2590 |
% \metaset{copyright@doc}{% |
| 2591 |
% This document is protected by copyright.} |
| 2592 |
% \metaset{copyright@doc-parts}{% |
| 2593 |
% This document as well as its parts is protected by copyright.} |
| 2594 |
% \metaset{copyright@reserved}{All rights reserved.} |
| 2595 |
% \end{macrocode} |
| 2596 |
% \macro{publicdomain} |
| 2597 |
% A public domain declaration (translated): |
| 2598 |
% \translate{copyright@publicdomain} |
| 2599 |
% \begin{macrocode} |
| 2600 |
% \metaset{copyright@publicdomain} |
| 2601 |
% {This work is dedicated to the public domain.} |
| 2602 |
% \end{macrocode} |
| 2603 |
|
| 2604 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2605 |
% \paragraph{License Presets.} |
| 2606 |
% |
| 2607 |
% \macro{license@...} |
| 2608 |
% Declare some license presets |
| 2609 |
% \begin{macrocode} |
| 2610 |
\metadef{license@consent} |
| 2611 |
\metadef{license@consent-noncom} |
| 2612 |
\metadef{license@lppl} |
| 2613 |
% \end{macrocode} |
| 2614 |
|
| 2615 |
% \macro{consent} |
| 2616 |
% A license to reproduce with prior written consent (translated): |
| 2617 |
% \translate{license@consent} |
| 2618 |
% \begin{macrocode} |
| 2619 |
% \metaset{license@consent}{% |
| 2620 |
% Reproduction of any part of this work in any form |
| 2621 |
% without prior written consent |
| 2622 |
% \metacompose[#1]{licenseprovider}{}{}{of the author} |
| 2623 |
% is not permissible.} |
| 2624 |
% \end{macrocode} |
| 2625 |
|
| 2626 |
% \macro{consent-noncom} |
| 2627 |
% A license to reproduce |
| 2628 |
% for private, scientific and non-commercial purposes |
| 2629 |
% or with prior written consent (translated): |
| 2630 |
% \translate{license@consent-noncom} |
| 2631 |
% \begin{macrocode} |
| 2632 |
% \metaset{license@consent-noncom}{% |
| 2633 |
% Reproduction of any part of this work in any form |
| 2634 |
% without prior written consent |
| 2635 |
% \metapick[#1]{licenseprovider}{}{}{of the author} |
| 2636 |
% is permissible only for private, scientific and non-commercial use.} |
| 2637 |
% \end{macrocode} |
| 2638 |
|
| 2639 |
% \macro{lppl} |
| 2640 |
% \LaTeX{} project public license (translated): |
| 2641 |
% \translate{license@lppl} |
| 2642 |
% \begin{macrocode} |
| 2643 |
\metaset[url]{license@lppl}{https://www.latex-project.org/lppl.txt} |
| 2644 |
% \metaset{license@lppl}{% |
| 2645 |
% This work may be distributed and/or modified under the |
| 2646 |
% conditions of the LaTeX Project Public License, either version |
| 2647 |
% \metaif[]{licenseversion}{\metaget[]{licenseversion}}{1.3} |
| 2648 |
% of this license or (at your option) any later version.} |
| 2649 |
% \end{macrocode} |
| 2650 |
|
| 2651 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2652 |
% \paragraph{Selection Code.} |
| 2653 |
% |
| 2654 |
% \macro{\metacopyright} |
| 2655 |
% \macro{\metalicense} |
| 2656 |
% Set a copyright or license message: |
| 2657 |
% \begin{macrocode} |
| 2658 |
\newcommand{\metacopyright}[1]{% |
| 2659 |
\metaset{copyrightmessage}{\metapick[##1]{copyright@#1}}} |
| 2660 |
\newcommand{\metalicense}[1]{% |
| 2661 |
\metaset{licensemessage}{\metapick[##1]{license@#1}}% |
| 2662 |
\metaif[url]{license@#1}{% |
| 2663 |
\metaset{licenseurl}{\metaget[url]{license@#1}}}{}} |
| 2664 |
% \end{macrocode} |
| 2665 |
|
| 2666 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2667 |
% \subsection{Creative Commons} |
| 2668 |
% \label{sec:imp-cc} |
| 2669 |
% |
| 2670 |
% The following implements the scheme of Creative Commons licenses. |
| 2671 |
% |
| 2672 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2673 |
% \paragraph{Declarations.} |
| 2674 |
% |
| 2675 |
% \macro{cc@type} |
| 2676 |
% \macro{cc@class} |
| 2677 |
% |cc@type| stores the selected CC license type; |
| 2678 |
% |cc@class| is `|@zero|' for the CC0 public domain dedication |
| 2679 |
% and empty otherwise: |
| 2680 |
% \begin{macrocode} |
| 2681 |
\metadef{cc@type} |
| 2682 |
\metadef{cc@class} |
| 2683 |
% \end{macrocode} |
| 2684 |
|
| 2685 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2686 |
% \paragraph{Text Components and Internationalisation.} |
| 2687 |
% |
| 2688 |
% CC license declarations are composed |
| 2689 |
% from several elements which can be conveniently internationalised. |
| 2690 |
% |
| 2691 |
% The following registers store various terms used in CC licenses: |
| 2692 |
% \translate{term-cc@...} |
| 2693 |
% \begin{macrocode} |
| 2694 |
\metasetterm{cc@sep}{-} |
| 2695 |
\metasetterm{cc@quotel}{\textquotedblleft} |
| 2696 |
\metasetterm{cc@quoter}{\textquotedblright} |
| 2697 |
\metasetterm{cc@cc}{Creative Commons} |
| 2698 |
\metasetterm{cc@zero}{CC0} |
| 2699 |
\metasetterm{cc@by}{Attribution} |
| 2700 |
\metasetterm{cc@sa}{ShareAlike} |
| 2701 |
\metasetterm{cc@nd}{NoDerivatives} |
| 2702 |
\metasetterm{cc@nc}{NonCommercial} |
| 2703 |
\metasetterm{cc@unported}{Unported} |
| 2704 |
\metasetterm{cc@generic}{Generic} |
| 2705 |
\metasetterm{cc@intl}{International} |
| 2706 |
\metasetterm{cc@univ}{Universal} |
| 2707 |
\metasetterm{cc@pd}{Public Domain} |
| 2708 |
\metasetterm{cc@license}{License} |
| 2709 |
\metasetterm{cc@pddecl}{Public Domain Dedication} |
| 2710 |
% \end{macrocode} |
| 2711 |
|
| 2712 |
% \macro{cc@pd} |
| 2713 |
% \macro{cc@zero} |
| 2714 |
% \macro{cc@by...} |
| 2715 |
% The following template registers store the combinations |
| 2716 |
% for the various CC licenses: |
| 2717 |
% \begin{macrocode} |
| 2718 |
\metadef{cc@pd} |
| 2719 |
\metadef{cc@zero} |
| 2720 |
\metadef{cc@by} |
| 2721 |
\metadef{cc@by-sa} |
| 2722 |
\metadef{cc@by-nd} |
| 2723 |
\metadef{cc@by-nc} |
| 2724 |
\metadef{cc@by-nc-sa} |
| 2725 |
\metadef{cc@by-nc-nd} |
| 2726 |
% \end{macrocode} |
| 2727 |
% Fill the registers: |
| 2728 |
% \begin{macrocode} |
| 2729 |
\metaset{cc@zero}{\metatranslate[#1]{cc@zero}} |
| 2730 |
\metaset{cc@by}{\metatranslate[#1]{cc@by}} |
| 2731 |
\metaset{cc@by-sa}{% |
| 2732 |
\metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}% |
| 2733 |
\metatranslate[#1]{cc@sa}} |
| 2734 |
\metaset{cc@by-nd}{% |
| 2735 |
\metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}% |
| 2736 |
\metatranslate[#1]{cc@nd}} |
| 2737 |
\metaset{cc@by-nc}{% |
| 2738 |
\metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}% |
| 2739 |
\metatranslate[#1]{cc@nc}} |
| 2740 |
\metaset{cc@by-nc-sa}{% |
| 2741 |
\metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}% |
| 2742 |
\metatranslate[#1]{cc@nc}\metatranslate[#1]{cc@sep}% |
| 2743 |
\metatranslate[#1]{cc@sa}} |
| 2744 |
\metaset{cc@by-nc-nd}{% |
| 2745 |
\metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}% |
| 2746 |
\metatranslate[#1]{cc@nc}\metatranslate[#1]{cc@sep}% |
| 2747 |
\metatranslate[#1]{cc@nd}} |
| 2748 |
% \end{macrocode} |
| 2749 |
|
| 2750 |
% \macro{[email protected]} |
| 2751 |
% \macro{[email protected]@zero} |
| 2752 |
% The following registers store the various versions for CC licenses: |
| 2753 |
% \begin{macrocode} |
| 2754 |
\metadef{[email protected]@zero} |
| 2755 |
\metadef{[email protected]} |
| 2756 |
\metadef{[email protected]} |
| 2757 |
\metadef{[email protected]} |
| 2758 |
\metadef{[email protected]} |
| 2759 |
\metadef{[email protected]} |
| 2760 |
% \end{macrocode} |
| 2761 |
% Fill the registers: |
| 2762 |
% \begin{macrocode} |
| 2763 |
\metaset{[email protected]@zero}{\metatranslate[#1]{cc@univ}} |
| 2764 |
\metaset{[email protected]}{\metatranslate[#1]{cc@generic}} |
| 2765 |
\metaset{[email protected]}{\metatranslate[#1]{cc@generic}} |
| 2766 |
\metaset{[email protected]}{\metatranslate[#1]{cc@generic}} |
| 2767 |
\metaset{[email protected]}{\metatranslate[#1]{cc@unported}} |
| 2768 |
\metaset{[email protected]}{\metatranslate[#1]{cc@intl}} |
| 2769 |
% \end{macrocode} |
| 2770 |
|
| 2771 |
% \macro{cc@license} |
| 2772 |
% \macro{cc@license@zero} |
| 2773 |
% \macro{cc@license@pd} |
| 2774 |
% The following registers store the term ``CC license'': |
| 2775 |
% \begin{macrocode} |
| 2776 |
\metadef{cc@license} |
| 2777 |
\metadef{cc@license@zero} |
| 2778 |
\metadef{cc@license@pd} |
| 2779 |
% \end{macrocode} |
| 2780 |
% Fill the registers (translated): |
| 2781 |
% \translate{cc@license} |
| 2782 |
% \translate{cc@license@zero} |
| 2783 |
% \translate{cc@license@pd} |
| 2784 |
% \begin{macrocode} |
| 2785 |
% \metaset{cc@license}{% |
| 2786 |
% \metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@license}} |
| 2787 |
% \metaset{cc@license@zero}{% |
| 2788 |
% \metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@pddecl}} |
| 2789 |
\metaset{cc@license@pd}{\metatranslate[#1]{cc@pddecl}} |
| 2790 |
% \end{macrocode} |
| 2791 |
|
| 2792 |
% \macro{cc@message} |
| 2793 |
% \macro{cc@message@zero} |
| 2794 |
% The following registers contain presets for the CC license messages: |
| 2795 |
% \begin{macrocode} |
| 2796 |
\metadef{cc@message} |
| 2797 |
\metadef{cc@message@zero} |
| 2798 |
% \end{macrocode} |
| 2799 |
% Fill the registers (translated): |
| 2800 |
% \translate{cc@message} |
| 2801 |
% \translate{cc@message@zero} |
| 2802 |
% \begin{macrocode} |
| 2803 |
% \metaset{cc@message}{% |
| 2804 |
% This work is licensed under the |
| 2805 |
% \metapick[#1]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 2806 |
% \metaset{cc@message@zero}{% |
| 2807 |
% This work is dedicated to the public domain by means of the |
| 2808 |
% \metapick[#1]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 2809 |
% \end{macrocode} |
| 2810 |
|
| 2811 |
% \macro{licensecc} |
| 2812 |
% \macro{licenseccver} |
| 2813 |
% \macro{licenseccfull} |
| 2814 |
% |licensecc| and |licenseccver| |
| 2815 |
% represent the name and version of the selected CC license; |
| 2816 |
% |licenseccfull| contains a full representation of the selected CC license: |
| 2817 |
% \begin{macrocode} |
| 2818 |
\metadef{licensecc} |
| 2819 |
\metadef{licenseccver} |
| 2820 |
\metadef{licenseccfull} |
| 2821 |
% \end{macrocode} |
| 2822 |
% Fill the registers: |
| 2823 |
% \begin{macrocode} |
| 2824 |
\metaset{licensecc}{% |
| 2825 |
\metapick[#1]{cc@\metaget[]{cc@type}}} |
| 2826 |
\metaset{licenseccver}{% |
| 2827 |
\metaget[]{licenseversion} |
| 2828 |
\metapick[#1]{cc@\metaget[]{licenseversion}\metaget[]{cc@class}}} |
| 2829 |
\metaset{licenseccfull}{% |
| 2830 |
\metapick[#1]{cc@license\metaget[]{cc@class}} |
| 2831 |
\metatranslate[#1]{cc@quotel}% |
| 2832 |
\metapick[#1]{licensecc} |
| 2833 |
\metapick[#1]{licenseccver}% |
| 2834 |
\metatranslate[#1]{cc@quoter}} |
| 2835 |
% \end{macrocode} |
| 2836 |
|
| 2837 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2838 |
% \paragraph{License Identifier.} |
| 2839 |
% |
| 2840 |
% \macro{ident} |
| 2841 |
% Compose the license identifier by |ident| variant: |
| 2842 |
% \begin{macrocode} |
| 2843 |
\metaset[ident]{licenseccver}{\metaget[]{licenseversion}} |
| 2844 |
\metaset[ident]{licenseccfull}{% |
| 2845 |
\metapick[ident]{licensecc} \metaget[ident]{licenseccver}} |
| 2846 |
\metasetterm[ident]{cc@sep}{-} |
| 2847 |
\metasetterm[ident]{cc@cc}{CC} |
| 2848 |
\metasetterm[ident]{cc@by}{BY} |
| 2849 |
\metasetterm[ident]{cc@sa}{SA} |
| 2850 |
\metasetterm[ident]{cc@nd}{ND} |
| 2851 |
\metasetterm[ident]{cc@nc}{NC} |
| 2852 |
\metasetterm[ident]{cc@zero}{CC0} |
| 2853 |
% \end{macrocode} |
| 2854 |
% |
| 2855 |
% \macro{short} |
| 2856 |
% Compose the short license identifier by |short| variant: |
| 2857 |
% \begin{macrocode} |
| 2858 |
\metaset[short]{licensecc}{% |
| 2859 |
\metaget[short]{cc@license\metaget[]{cc@class}}% |
| 2860 |
\metapick[short]{cc@\metaget[]{cc@type}}} |
| 2861 |
\metaset[short]{licenseccver}{\metaget[]{licenseversion}} |
| 2862 |
\metaset[short]{licenseccfull}{% |
| 2863 |
\metapick[short]{licensecc} \metaget[short]{licenseccver}} |
| 2864 |
\metasetterm[short]{cc@sep}{-} |
| 2865 |
\metasetterm[short]{cc@cc}{CC} |
| 2866 |
\metasetterm[short]{cc@by}{BY} |
| 2867 |
\metasetterm[short]{cc@sa}{SA} |
| 2868 |
\metasetterm[short]{cc@nd}{ND} |
| 2869 |
\metasetterm[short]{cc@nc}{NC} |
| 2870 |
\metasetterm[short]{cc@zero}{CC0} |
| 2871 |
\metaset[short]{cc@license}{CC } |
| 2872 |
\metaset[short]{cc@license@zero}{} |
| 2873 |
% \end{macrocode} |
| 2874 |
|
| 2875 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2876 |
% \paragraph{License Logo.} |
| 2877 |
% |
| 2878 |
% \macro{logo} |
| 2879 |
% |logo| variants used for the license logo |
| 2880 |
% provided by the \ctanpkg{doclicense} package: |
| 2881 |
% \begin{macrocode} |
| 2882 |
\metaset[logo]{cc@pd}{doclicense-CC-pd} |
| 2883 |
\metaset[logo]{cc@zero}{doclicense-CC-zero} |
| 2884 |
\metaset[logo]{cc@by}{doclicense-CC-by} |
| 2885 |
\metaset[logo]{cc@by-sa}{doclicense-CC-by-sa} |
| 2886 |
\metaset[logo]{cc@by-nd}{doclicense-CC-by-nd} |
| 2887 |
\metaset[logo]{cc@by-nc}{doclicense-CC-by-nc} |
| 2888 |
\metaset[logo]{cc@by-nc-sa}{doclicense-CC-by-nc-sa} |
| 2889 |
\metaset[logo]{cc@by-nc-nd}{doclicense-CC-by-nc-nd} |
| 2890 |
% \end{macrocode} |
| 2891 |
% Select currency versions: |
| 2892 |
% \begin{macrocode} |
| 2893 |
\mstr@iftext\mstr@opt@cclogocurr{dollar}{\metaset[curr]{licenselogo}{}} |
| 2894 |
\mstr@iftext\mstr@opt@cclogocurr{euro}{\metaset[curr]{licenselogo}{-eu}} |
| 2895 |
\mstr@iftext\mstr@opt@cclogocurr{yen}{\metaset[curr]{licenselogo}{-jp}} |
| 2896 |
% \end{macrocode} |
| 2897 |
% Select shape versions: |
| 2898 |
% \begin{macrocode} |
| 2899 |
\mstr@iftext\mstr@opt@cclogoshape{box}{\metaset[shape]{licenselogo}{-88x31}} |
| 2900 |
\mstr@iftext\mstr@opt@cclogoshape{slim}{\metaset[shape]{licenselogo}{-80x15}} |
| 2901 |
% \end{macrocode} |
| 2902 |
|
| 2903 |
% \macro{\mstr@setcclogo} |
| 2904 |
% Use the Creative Commons logos |
| 2905 |
% included in the \ctanpkg{doclicense} package: |
| 2906 |
% \begin{macrocode} |
| 2907 |
\newcommand{\mstr@setcclogo}{% |
| 2908 |
\ifmstr@opt@cclogo |
| 2909 |
\IfFileExists{doclicense.sty}{% |
| 2910 |
\ifdefined\includegraphics |
| 2911 |
\IfFileExists{doclicense-CC-by-88x31.pdf} |
| 2912 |
{\metaset[size]{licenselogo}{-88x31}}{} |
| 2913 |
\metaset{licenselogo}{% |
| 2914 |
\metapick[logo]{licensecc}\metaget[curr]{licenselogo}% |
| 2915 |
\metaget[shape]{licenselogo}}% |
| 2916 |
\metaset[nocurr]{licenselogo}{% |
| 2917 |
\metapick[logo]{licensecc}\metaget[shape]{licenselogo}}% |
| 2918 |
\fi}{\GenericWarning{please install package `doclicense'}}% |
| 2919 |
\fi} |
| 2920 |
% \end{macrocode} |
| 2921 |
|
| 2922 |
% \macro{icon} |
| 2923 |
% |icon| variants used for the license icons |
| 2924 |
% provided by the \ctanpkg{ccicons} package: |
| 2925 |
% \begin{macrocode} |
| 2926 |
\metaset[icon]{licensecc}{% |
| 2927 |
\metaget[icon]{cc@license\metaget[]{cc@class}}% |
| 2928 |
\metapick[icon]{cc@\metaget[]{cc@type}}} |
| 2929 |
\metaset[icon]{licenseccver}{\metaget[]{licenseversion}} |
| 2930 |
\metaset[icon]{licenseccfull}{% |
| 2931 |
\metaget[icon]{licensecc} |
| 2932 |
\metaget[icon]{licenseccver}} |
| 2933 |
\metasetterm[icon]{cc@sep}{} |
| 2934 |
\metasetterm[icon]{cc@cc}{\ccLogo} |
| 2935 |
\metasetterm[icon]{cc@pd}{\ccPublicDomain} |
| 2936 |
\metasetterm[icon]{cc@zero}{\ccZero} |
| 2937 |
\metasetterm[icon]{cc@by}{\ccAttribution} |
| 2938 |
\metasetterm[icon]{cc@sa}{\ccShareAlike} |
| 2939 |
\metasetterm[icon]{cc@nd}{\ccNoDerivatives} |
| 2940 |
\metasetterm[icon]{cc@nc}{\ccNonCommercial} |
| 2941 |
\metaset[icon]{cc@license}{\metatranslate[#1]{cc@cc}} |
| 2942 |
\metaset[icon]{cc@license@zero}{\metatranslate[#1]{cc@cc}} |
| 2943 |
\metaset[icon]{cc@license@pd}{\metatranslate[#1]{cc@pd}} |
| 2944 |
\metaset[icon]{copyrightmark}{\ccCopy} |
| 2945 |
% \end{macrocode} |
| 2946 |
% Use euro or yen sign versions: |
| 2947 |
% \begin{macrocode} |
| 2948 |
\mstr@iftext\mstr@opt@cclogocurr{euro}{ |
| 2949 |
\metasetterm[icon]{cc@nc}{\ccNonCommercialEU}} |
| 2950 |
\mstr@iftext\mstr@opt@cclogocurr{yen}{ |
| 2951 |
\metasetterm[icon]{cc@nc}{\ccNonCommercialJP}} |
| 2952 |
% \end{macrocode} |
| 2953 |
|
| 2954 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2955 |
% \paragraph{License URL.} |
| 2956 |
% |
| 2957 |
% \macro{url} |
| 2958 |
% The |url| variant of compounds are used for the license URL. |
| 2959 |
% \begin{macrocode} |
| 2960 |
\metaset[url]{licenseccver}{\metaget[]{licenseversion}} |
| 2961 |
\metaset[url]{licenseccfull}{% |
| 2962 |
\metaget[url]{cc@license\metaget[]{cc@class}}/% |
| 2963 |
\metapick[url]{licensecc}/% |
| 2964 |
\metaget[url]{licenseccver}/} |
| 2965 |
\metaset[url]{cc@license}{https://creativecommons.org/licenses} |
| 2966 |
\metaset[url]{cc@license@zero}{https://creativecommons.org/publicdomain} |
| 2967 |
\metaset[url]{cc@zero}{zero} |
| 2968 |
\metaset[url]{cc@by}{by} |
| 2969 |
\metaset[url]{cc@by-sa}{by-sa} |
| 2970 |
\metaset[url]{cc@by-nd}{by-nd} |
| 2971 |
\metaset[url]{cc@by-nc}{by-nc} |
| 2972 |
\metaset[url]{cc@by-nc-sa}{by-nc-sa} |
| 2973 |
\metaset[url]{cc@by-nc-nd}{by-nc-nd} |
| 2974 |
% \end{macrocode} |
| 2975 |
|
| 2976 |
% Declare registers for internationalisation of deed URL: |
| 2977 |
% \begin{macrocode} |
| 2978 |
\metadef{cc@url} |
| 2979 |
\metadef{cc@url@deed} |
| 2980 |
% \end{macrocode} |
| 2981 |
% Fill registers: |
| 2982 |
% \translate{cc@url@deed} |
| 2983 |
% \begin{macrocode} |
| 2984 |
\metaset{cc@url@deed}{} |
| 2985 |
\metaset{cc@url}{\metapick[url]{licenseccfull}\metapick[#1]{cc@url@deed}} |
| 2986 |
% \end{macrocode} |
| 2987 |
|
| 2988 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2989 |
% \paragraph{License Preset.} |
| 2990 |
% |
| 2991 |
% \macro{\metalicensecc} |
| 2992 |
% Set the CC license of type `|#1|': |
| 2993 |
% \begin{macrocode} |
| 2994 |
\newcommand{\metalicensecc}[1]{% |
| 2995 |
\def\mstr@tmpl{#1}% |
| 2996 |
\def\mstr@tmp{pd}% |
| 2997 |
\ifx\mstr@tmpl\mstr@tmp |
| 2998 |
\metaset{cc@class}{@pd}% |
| 2999 |
\metacopyright{publicdomain}% |
| 3000 |
\metaset{cc@type}{pd}% |
| 3001 |
\else |
| 3002 |
\def\mstr@tmp{zero}% |
| 3003 |
\ifx\mstr@tmpl\mstr@tmp |
| 3004 |
\metaset{cc@class}{@zero}% |
| 3005 |
\metaif[]{licenseversion}{}{\metaset{licenseversion}{1.0}}% |
| 3006 |
\else |
| 3007 |
\metaset{cc@class}{}% |
| 3008 |
\metaif[]{licenseversion}{}{\metaset{licenseversion}{4.0}}% |
| 3009 |
\fi |
| 3010 |
\metaset{cc@type}{#1}% |
| 3011 |
\metaset{licenseurl}{\metapick[##1]{cc@url}}% |
| 3012 |
\metaset{licensemessage} |
| 3013 |
{\metapick[##1]{cc@message\metaget[]{cc@class}}}% |
| 3014 |
\fi |
| 3015 |
\mstr@setcclogo} |
| 3016 |
% \end{macrocode} |
| 3017 |
|
| 3018 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3019 |
% \subsection{Contact Information} |
| 3020 |
% \label{sec:imp-contact} |
| 3021 |
% |
| 3022 |
% The following describes an interface |
| 3023 |
% to store and write contact information. |
| 3024 |
% |
| 3025 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3026 |
% \paragraph{Declarations.} |
| 3027 |
% |
| 3028 |
% \macro{contact...} |
| 3029 |
% Contact register declarations: |
| 3030 |
% \begin{macrocode} |
| 3031 |
\metadef{contactaddress} |
| 3032 |
\metadef{contactpostcode} |
| 3033 |
\metadef{contactcity} |
| 3034 |
\metadef{contactregion} |
| 3035 |
\metadef{contactcountry} |
| 3036 |
\metadef{contactemail} |
| 3037 |
\metadef{contacturl} |
| 3038 |
% \end{macrocode} |
| 3039 |
|
| 3040 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3041 |
% \paragraph{Write to PDF.} |
| 3042 |
% |
| 3043 |
% \macro{\metawritepdfcontact} |
| 3044 |
% Write contact information to PDF via \ctanpkg{hyperxmp}: |
| 3045 |
% \begin{macrocode} |
| 3046 |
\newcommand{\metawritepdfcontact}{\ifdefined\hypersetup\ifdefined\xmptilde |
| 3047 |
\metaifpick[\mstr@lang@meta]{contactaddress}{% |
| 3048 |
\hypersetup{pdfcontactaddress= |
| 3049 |
{\metapick[\mstr@lang@meta]{contactaddress}}}}{}% |
| 3050 |
\metaifpick[\mstr@lang@meta]{contactpostcode}{% |
| 3051 |
\hypersetup{pdfcontactpostcode= |
| 3052 |
{\metapick[\mstr@lang@meta]{contactpostcode}}}}{}% |
| 3053 |
\metaifpick[\mstr@lang@meta]{contactcity}{% |
| 3054 |
\hypersetup{pdfcontactcity= |
| 3055 |
{\metapick[\mstr@lang@meta]{contactcity}}}}{}% |
| 3056 |
\metaifpick[\mstr@lang@meta]{contactregion}{% |
| 3057 |
\hypersetup{pdfcontactregion= |
| 3058 |
{\metapick[\mstr@lang@meta]{contactregion}}}}{}% |
| 3059 |
\metaifpick[\mstr@lang@meta]{contactcountry}{% |
| 3060 |
\hypersetup{pdfcontactcountry= |
| 3061 |
{\metapick[\mstr@lang@meta]{contactcountry}}}}{}% |
| 3062 |
\metaifpick[\mstr@lang@meta]{contactemail}{% |
| 3063 |
\hypersetup{pdfcontactemail= |
| 3064 |
{\metapick[\mstr@lang@meta]{contactemail}}}}{}% |
| 3065 |
\metaifpick[\mstr@lang@meta]{contacturl}{% |
| 3066 |
\hypersetup{pdfcontacturl= |
| 3067 |
{\metapick[\mstr@lang@meta]{contacturl}}}}{}% |
| 3068 |
\fi\fi} |
| 3069 |
% \end{macrocode} |
| 3070 |
|
| 3071 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3072 |
% \subsection{Extras} |
| 3073 |
% \label{sec:imp-extra} |
| 3074 |
% |
| 3075 |
% The following defines some extras to be activated by package options. |
| 3076 |
% |
| 3077 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3078 |
% \paragraph{Course Metadata.} |
| 3079 |
% |
| 3080 |
% Include structures for course materials: |
| 3081 |
% \begin{macrocode} |
| 3082 |
\ifmstr@opt@course |
| 3083 |
% \end{macrocode} |
| 3084 |
|
| 3085 |
%\macro{institution} |
| 3086 |
%\macro{instructor} |
| 3087 |
%\macro{course} |
| 3088 |
%\macro{material} |
| 3089 |
%\macro{period} |
| 3090 |
% Declare course structures: |
| 3091 |
% \begin{macrocode} |
| 3092 |
\metadef{institution} |
| 3093 |
\metadef{instructor} |
| 3094 |
\metadef{course} |
| 3095 |
\metadef{material} |
| 3096 |
\metadef{period} |
| 3097 |
% \end{macrocode} |
| 3098 |
|
| 3099 |
% Preset formatting styles: |
| 3100 |
% \begin{macrocode} |
| 3101 |
\metaset[style]{course}{\LARGE\bfseries} |
| 3102 |
\metaset[style]{material}{\large} |
| 3103 |
\metaset[style]{institution}{\large} |
| 3104 |
\metaset[style]{period}{\large} |
| 3105 |
\metaset[style]{instructor}{\scshape\Large} |
| 3106 |
\metaset[skip]{material}{\vspace{2ex}} |
| 3107 |
\metaset[skip]{institution}{\vspace{4ex}} |
| 3108 |
\metaset[skip]{period}{\vspace{4ex}} |
| 3109 |
\metaset[skip]{instructor}{\vspace{6ex}} |
| 3110 |
\metaset[sep]{period}{, } |
| 3111 |
% \end{macrocode} |
| 3112 |
|
| 3113 |
% Fill |titletext| in |course| variant to display |
| 3114 |
% relevant title data for the course material: |
| 3115 |
% \begin{macrocode} |
| 3116 |
\metaset[course]{titlematter}{% |
| 3117 |
\metapick[course]{titletext}% |
| 3118 |
\metapick[course]{datatext}% |
| 3119 |
\metapick[course]{authortext}% |
| 3120 |
\metaget[skip]{titlematter}} |
| 3121 |
\metaset[course]{titletext}{% |
| 3122 |
\metatitleline[print]{course}% |
| 3123 |
\metatitlelinetwo[print]{material}[print]{draft}} |
| 3124 |
\metaset[course]{authortext}{% |
| 3125 |
\metatitleline[print]{instructor}} |
| 3126 |
\metaset[course]{datatext}{% |
| 3127 |
\metatitlelinetwo[print]{institution}[print]{period}} |
| 3128 |
% \end{macrocode} |
| 3129 |
% Legacy presets: |
| 3130 |
% \begin{macrocode} |
| 3131 |
\ifmstr@opt@titlematter\else |
| 3132 |
\metaset[course]{titlematter}{% |
| 3133 |
\metapick[course]{titletext}% |
| 3134 |
\metaget[skip]{titlematter}} |
| 3135 |
\metaset[course]{titletext}{% |
| 3136 |
\metatitleline[print]{course}% |
| 3137 |
\metatitlelinetwo[print]{material}[print]{draft}% |
| 3138 |
\metapick[course]{datatext}% |
| 3139 |
\metapick[course]{authortext}} |
| 3140 |
\fi |
| 3141 |
% \end{macrocode} |
| 3142 |
|
| 3143 |
% Inherit title, subtitle, author and date: |
| 3144 |
% \begin{macrocode} |
| 3145 |
\metaset{title}{\metapick[#1]{course}} |
| 3146 |
\metaset{subtitle}{\metapick[#1]{material}} |
| 3147 |
\metaset{author}{\metapick[#1]{instructor}} |
| 3148 |
\metaset{date}{\metapick[#1]{period}} |
| 3149 |
\metaset{location}{\metapick[#1]{institution}} |
| 3150 |
% \end{macrocode} |
| 3151 |
|
| 3152 |
% \begin{macrocode} |
| 3153 |
\fi |
| 3154 |
% \end{macrocode} |
| 3155 |
|
| 3156 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3157 |
% \subsection{Translations} |
| 3158 |
% \label{sec:imp-translate} |
| 3159 |
% |
| 3160 |
% Determine all desired international versions to be loaded; |
| 3161 |
% use first one as fallback language: |
| 3162 |
% \begin{macrocode} |
| 3163 |
\def\mstr@loadlangloop#1|#2&{% |
| 3164 |
\mstr@csdo\let{mstr@lang@#1}\relax% |
| 3165 |
\ifx\mstr@lang@fallback\@empty\def\mstr@lang@fallback{#1}\fi% |
| 3166 |
\if @#2@\else\mstr@loadlangloop#2&\fi} |
| 3167 |
\expandafter\mstr@loadlangloop\mstr@opt@loadlang|& |
| 3168 |
% \end{macrocode} |
| 3169 |
|
| 3170 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3171 |
% \paragraph{English.} |
| 3172 |
% |
| 3173 |
% Check whether to load English strings: |
| 3174 |
% \begin{macrocode} |
| 3175 |
\ifdefined\mstr@lang@en |
| 3176 |
% \end{macrocode} |
| 3177 |
|
| 3178 |
% Terms: |
| 3179 |
% \begin{macrocode} |
| 3180 |
\metasetterm[en]{title}{Title} |
| 3181 |
\metasetterm[en]{abstract}{Abstract} |
| 3182 |
\metasetterm[en]{copyright}{Copyright} |
| 3183 |
\metasetterm[en]{preface}{Preface} |
| 3184 |
\metasetterm[en]{part}{Part} |
| 3185 |
\metasetterm[en]{chapter}{Chapter} |
| 3186 |
\metasetterm[en]{section}{Section} |
| 3187 |
\metasetterm[en]{subsection}{Subsection} |
| 3188 |
\metasetterm[en]{paragraph}{Paragraph} |
| 3189 |
\metasetterm[en]{appendix}{Appendix} |
| 3190 |
\metasetterm[en]{page}{Page} |
| 3191 |
\metasetterm[en]{figure}{Figure} |
| 3192 |
\metasetterm[en]{table}{Table} |
| 3193 |
\metasetterm[en]{contents}{Contents} |
| 3194 |
\metasetterm[en]{listfigure}{List of Figures} |
| 3195 |
\metasetterm[en]{listtable}{List of Tables} |
| 3196 |
\metasetterm[en]{references}{References} |
| 3197 |
\metasetterm[en]{index}{Index} |
| 3198 |
\metasetterm[en]{draft}{DRAFT} |
| 3199 |
% \end{macrocode} |
| 3200 |
|
| 3201 |
% General purpose messages: |
| 3202 |
% \begin{macrocode} |
| 3203 |
\metaset[en]{urlmessage}{% |
| 3204 |
The current version of this work can be found at: \metapick[#1]{url}.} |
| 3205 |
\metaset[en]{partofmessage}{% |
| 3206 |
This document is part of the work: \metapick[#1]{partof}.} |
| 3207 |
\metaset[en]{licenseurlmessage}{% |
| 3208 |
To view a copy of this license, visit: \metapick[#1]{licenseurl}.} |
| 3209 |
% \end{macrocode} |
| 3210 |
% Copyright statements: |
| 3211 |
% \begin{macrocode} |
| 3212 |
\metaset[en]{copyright@plain}{% |
| 3213 |
This work is protected by copyright.} |
| 3214 |
\metaset[en]{copyright@parts}{% |
| 3215 |
This work as well as its parts is protected by copyright.} |
| 3216 |
\metaset[en]{copyright@doc}{% |
| 3217 |
This document is protected by copyright.} |
| 3218 |
\metaset[en]{copyright@doc-parts}{% |
| 3219 |
This document as well as its parts is protected by copyright.} |
| 3220 |
\metaset[en]{copyright@reserved}{All rights reserved.} |
| 3221 |
\metaset[en]{copyright@publicdomain} |
| 3222 |
{This work is dedicated to the public domain.} |
| 3223 |
% \end{macrocode} |
| 3224 |
% License statements: |
| 3225 |
% \begin{macrocode} |
| 3226 |
\metaset[en]{license@consent}{% |
| 3227 |
Reproduction of any part of this work in any form |
| 3228 |
without prior written consent |
| 3229 |
\metacompose[#1]{licenseprovider}{}{}{of the author} |
| 3230 |
is not permissible.} |
| 3231 |
\metaset[en]{license@consent-noncom}{% |
| 3232 |
Reproduction of any part of this work in any form |
| 3233 |
without prior written consent |
| 3234 |
\metacompose[#1]{licenseprovider}{}{}{of the author} |
| 3235 |
is permissible only for private, scientific and non-commercial use.} |
| 3236 |
\metaset[en]{license@lppl}{% |
| 3237 |
This work may be distributed and/or modified under the |
| 3238 |
conditions of the LaTeX Project Public License, either version |
| 3239 |
\metaif[]{licenseversion}{\metaget[]{licenseversion}}{1.3} |
| 3240 |
of this license or (at your option) any later version.} |
| 3241 |
% \end{macrocode} |
| 3242 |
% Creative Commons license composition: |
| 3243 |
% \begin{macrocode} |
| 3244 |
\metaset[en]{cc@url@deed}{deed.en} |
| 3245 |
\metaset[en]{cc@message}{% |
| 3246 |
This work is licensed under the |
| 3247 |
\metapick[en]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 3248 |
\metaset[en]{cc@message@zero}{% |
| 3249 |
This work is dedicated to the public domain by means of the |
| 3250 |
\metapick[#1]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 3251 |
\metaset[en]{cc@license}{% |
| 3252 |
\metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@license}} |
| 3253 |
\metaset[en]{cc@license@zero}{% |
| 3254 |
\metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@pddecl}} |
| 3255 |
\metasetterm[en]{cc@sep}{-} |
| 3256 |
\metasetterm[en]{cc@quotel}{\textquotedblleft} |
| 3257 |
\metasetterm[en]{cc@quoter}{\textquotedblright} |
| 3258 |
\metasetterm[en]{cc@by}{Attribution} |
| 3259 |
\metasetterm[en]{cc@sa}{ShareAlike} |
| 3260 |
\metasetterm[en]{cc@nd}{NoDerivatives} |
| 3261 |
\metasetterm[en]{cc@nc}{NonCommercial} |
| 3262 |
\metasetterm[en]{cc@unported}{Unported} |
| 3263 |
\metasetterm[en]{cc@generic}{Generic} |
| 3264 |
\metasetterm[en]{cc@intl}{International} |
| 3265 |
\metasetterm[en]{cc@univ}{Universal} |
| 3266 |
\metasetterm[en]{cc@license}{License} |
| 3267 |
\metasetterm[en]{cc@pd}{Public Domain} |
| 3268 |
\metasetterm[en]{cc@pddecl}{Public Domain Dedication} |
| 3269 |
% \end{macrocode} |
| 3270 |
|
| 3271 |
% \begin{macrocode} |
| 3272 |
\fi |
| 3273 |
% \end{macrocode} |
| 3274 |
|
| 3275 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3276 |
% \paragraph{German.} |
| 3277 |
% |
| 3278 |
% Check whether to load German strings: |
| 3279 |
% \begin{macrocode} |
| 3280 |
\ifdefined\mstr@lang@de |
| 3281 |
% \end{macrocode} |
| 3282 |
|
| 3283 |
% Terms: |
| 3284 |
% \begin{macrocode} |
| 3285 |
\metasetterm[de]{title}{Titel} |
| 3286 |
\metasetterm[de]{abstract}{Zusammenfassung} |
| 3287 |
\metasetterm[de]{copyright}{Urheberrechte} |
| 3288 |
\metasetterm[de]{preface}{Vorwort} |
| 3289 |
\metasetterm[de]{part}{Teil} |
| 3290 |
\metasetterm[de]{chapter}{Kapitel} |
| 3291 |
\metasetterm[de]{section}{Abschnitt} |
| 3292 |
\metasetterm[de]{subsection}{Unterabschnitt} |
| 3293 |
\metasetterm[de]{paragraph}{Absatz} |
| 3294 |
\metasetterm[de]{appendix}{Anhang} |
| 3295 |
\metasetterm[de]{page}{Seite} |
| 3296 |
\metasetterm[de]{figure}{Abbildung} |
| 3297 |
\metasetterm[de]{table}{Tabelle} |
| 3298 |
\metasetterm[de]{contents}{Inhaltsverzeichnis} |
| 3299 |
\metasetterm[de]{listfigure}{Abbildungsverzeichnis} |
| 3300 |
\metasetterm[de]{listtable}{Tabellenverzeichnis} |
| 3301 |
\metasetterm[de]{references}{Literatur} |
| 3302 |
\metasetterm[de]{index}{Index} |
| 3303 |
\metasetterm[de]{draft}{ENTWURF} |
| 3304 |
% \end{macrocode} |
| 3305 |
|
| 3306 |
% General purpose messages: |
| 3307 |
% \begin{macrocode} |
| 3308 |
\metaset[de]{urlmessage}{% |
| 3309 |
Die aktuelle Version dieses Werks befindet sich unter: |
| 3310 |
\metapick[#1]{url}.} |
| 3311 |
\metaset[de]{partofmessage}{% |
| 3312 |
Dieses Dokument ist Teil des Werks: \metapick[#1]{partof}.} |
| 3313 |
\metaset[de]{licenseurlmessage}{% |
| 3314 |
Die Lizenz kann eingesehen werden unter: |
| 3315 |
\metapick[#1]{licenseurl}.} |
| 3316 |
% \end{macrocode} |
| 3317 |
% Copyright statements: |
| 3318 |
% \begin{macrocode} |
| 3319 |
\metaset[de]{copyright@plain}{% |
| 3320 |
Dieses Werk ist urheberrechtlich gesch\"utzt.} |
| 3321 |
\metaset[de]{copyright@parts}{% |
| 3322 |
Dieses Werk sowie seine Teile sind urheberrechtlich gesch\"utzt.} |
| 3323 |
\metaset[de]{copyright@doc}{% |
| 3324 |
Dieses Dokument ist urheberrechtlich gesch\"utzt.} |
| 3325 |
\metaset[de]{copyright@doc-parts}{% |
| 3326 |
Dieses Dokument sowie seine Teile sind urheberrechtlich gesch\"utzt.} |
| 3327 |
\metaset[de]{copyright@reserved}{Alle Rechte vorbehalten.} |
| 3328 |
\metaset[de]{copyright@publicdomain} |
| 3329 |
{Dieses Werk ist gemeinfrei.} |
| 3330 |
% \end{macrocode} |
| 3331 |
% License statements: |
| 3332 |
% \begin{macrocode} |
| 3333 |
\metaset[de]{license@consent}{% |
| 3334 |
Reproduktion eines Teils dieses Werks in beliebiger Form |
| 3335 |
ohne vorg\"angige schriftliche Erlaubnis |
| 3336 |
\metacompose[#1]{licenseprovider}{}{}{des Verfassers} |
| 3337 |
ist nicht gestattet.} |
| 3338 |
\metaset[de]{license@consent-noncom}{% |
| 3339 |
Reproduktion eines Teils dieses Werks in beliebiger Form |
| 3340 |
ohne vorg\"angige schriftliche Erlaubnis |
| 3341 |
\metacompose[#1]{licenseprovider}{}{}{des Verfassers} |
| 3342 |
ist nur zum privaten, wissenschaftlichen |
| 3343 |
und nicht-gewerblichen Gebrauch gestattet.} |
| 3344 |
\metaset[de]{license@lppl}{% |
| 3345 |
Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz, |
| 3346 |
entweder Version |
| 3347 |
\metaif[]{licenseversion}{\metaget[]{licenseversion}}{1.3} |
| 3348 |
oder (nach Ihrer Wahl) jede sp\"atere Version, |
| 3349 |
verteilt und/oder ver\"andert werden.} |
| 3350 |
% \end{macrocode} |
| 3351 |
% Creative Commons license composition: |
| 3352 |
% \begin{macrocode} |
| 3353 |
\metaset[de]{cc@url@deed}{deed.de} |
| 3354 |
\metaset[de]{cc@message}{% |
| 3355 |
Dieses Werk ist lizensiert unter der |
| 3356 |
\metapick[de]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 3357 |
\metaset[de]{cc@message@zero}{% |
| 3358 |
Dieses Werk ist gemeinfrei deklariert mittels der |
| 3359 |
\metapick[de]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 3360 |
\metaset[de]{cc@license}{% |
| 3361 |
\metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@license}} |
| 3362 |
\metaset[de]{cc@license@zero}{% |
| 3363 |
\metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@pddecl}} |
| 3364 |
\metasetterm[de]{cc@sep}{ -- } |
| 3365 |
\metasetterm[de]{cc@quotel}{\quotedblbase} |
| 3366 |
\metasetterm[de]{cc@quoter}{\textquotedblleft} |
| 3367 |
\metasetterm[de]{cc@by}{Namensnennung} |
| 3368 |
\metasetterm[de]{cc@sa}{Weitergabe unter gleichen Bedingungen} |
| 3369 |
\metasetterm[de]{cc@nd}{Keine Bearbeitungen} |
| 3370 |
\metasetterm[de]{cc@nc}{Nicht kommerziell} |
| 3371 |
\metasetterm[de]{cc@unported}{Unportiert} |
| 3372 |
\metasetterm[de]{cc@generic}{Generisch} |
| 3373 |
\metasetterm[de]{cc@intl}{International} |
| 3374 |
\metasetterm[de]{cc@univ}{Universell} |
| 3375 |
\metasetterm[de]{cc@license}{Lizenz} |
| 3376 |
\metasetterm[de]{cc@pd}{Gemeinfrei} |
| 3377 |
\metasetterm[de]{cc@pddecl}{Gemeinfrei Deklaration} |
| 3378 |
% \end{macrocode} |
| 3379 |
|
| 3380 |
% \begin{macrocode} |
| 3381 |
\fi |
| 3382 |
% \end{macrocode} |
| 3383 |
|
| 3384 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3385 |
% \paragraph{French.} |
| 3386 |
% |
| 3387 |
% Disclaimer: professional assistance with translations needed. |
| 3388 |
% |
| 3389 |
% Check whether to load French strings: |
| 3390 |
% \begin{macrocode} |
| 3391 |
\ifdefined\mstr@lang@fr |
| 3392 |
% \end{macrocode} |
| 3393 |
|
| 3394 |
% Terms: |
| 3395 |
% \begin{macrocode} |
| 3396 |
\metasetterm[fr]{title}{Titre} |
| 3397 |
\metasetterm[fr]{abstract}{R\'esum\'e} |
| 3398 |
\metasetterm[fr]{copyright}{Droits d'Auteur} |
| 3399 |
\metasetterm[fr]{preface}{Pr\'eface} |
| 3400 |
\metasetterm[fr]{part}{Partie} |
| 3401 |
\metasetterm[fr]{chapter}{Chapitre} |
| 3402 |
\metasetterm[fr]{section}{Section} |
| 3403 |
\metasetterm[fr]{subsection}{Sous-Section} |
| 3404 |
\metasetterm[fr]{paragraph}{Paragraphe} |
| 3405 |
\metasetterm[fr]{appendix}{Annexe} |
| 3406 |
\metasetterm[fr]{page}{Page} |
| 3407 |
\metasetterm[fr]{figure}{Figure} |
| 3408 |
\metasetterm[fr]{table}{Table} |
| 3409 |
\metasetterm[fr]{contents}{Table des Mati\`eres} |
| 3410 |
\metasetterm[fr]{listfigure}{Table des Figures} |
| 3411 |
\metasetterm[fr]{listtable}{Liste des Tableaux} |
| 3412 |
\metasetterm[fr]{references}{R\'ef\'erences} |
| 3413 |
\metasetterm[fr]{index}{Index} |
| 3414 |
\metasetterm[fr]{draft}{BROUILLON} |
| 3415 |
% \end{macrocode} |
| 3416 |
|
| 3417 |
% General purpose messages: |
| 3418 |
% \begin{macrocode} |
| 3419 |
\metaset[fr]{urlmessage}{% |
| 3420 |
La version actuelle de cet \oe uvre se trouve \`a l'adresse: |
| 3421 |
\metapick[#1]{url}.} |
| 3422 |
\metaset[fr]{partofmessage}{% |
| 3423 |
Ce document fait partie de la \oe uvre: \metapick[#1]{partof}.} |
| 3424 |
\metaset[fr]{licenseurlmessage}{% |
| 3425 |
Pour voir une copie de cette licence, visitez: |
| 3426 |
\metapick[#1]{licenseurl}.} |
| 3427 |
% \end{macrocode} |
| 3428 |
% Copyright statements: |
| 3429 |
% \begin{macrocode} |
| 3430 |
\metaset[fr]{copyright@plain}{% |
| 3431 |
Cette \oe uvre est prot\'eg\'ee par le droit d'auteur.} |
| 3432 |
\metaset[fr]{copyright@parts}{% |
| 3433 |
Cette \oe uvre ainsi que ses parties |
| 3434 |
sont prot\'eg\'ees par le droit d'auteur.} |
| 3435 |
\metaset[fr]{copyright@doc}{% |
| 3436 |
Ce document est prot\'eg\'es par le droit d'auteur.} |
| 3437 |
\metaset[fr]{copyright@doc-parts}{% |
| 3438 |
Ce document ainsi que ses parties |
| 3439 |
sont prot\'eg\'es par le droit d'auteur.} |
| 3440 |
\metaset[fr]{copyright@reserved}{Tous les droits sont r\'eserv\'es.} |
| 3441 |
\metaset[fr]{copyright@publicdomain} |
| 3442 |
{Cette \oe uvre est du domaine public.} |
| 3443 |
% \end{macrocode} |
| 3444 |
% Creative Commons license composition: |
| 3445 |
% \begin{macrocode} |
| 3446 |
\metaset[fr]{cc@url@deed}{deed.fr} |
| 3447 |
\metaset[fr]{cc@message}{% |
| 3448 |
Cette \oe uvre est mise \`a disposition selon les termes de la |
| 3449 |
\metapick[fr]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 3450 |
\metaset[fr]{cc@message@zero}{% |
| 3451 |
Cette \oe uvre est d\'eclar\'ee du domaine public par le |
| 3452 |
\metapick[fr]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 3453 |
\metaset[fr]{cc@license}{% |
| 3454 |
\metatranslate[#1]{cc@license} \metatranslate[#1]{cc@cc}} |
| 3455 |
\metaset[fr]{cc@license@zero}{% |
| 3456 |
\metatranslate[#1]{cc@pddecl} \metatranslate[#1]{cc@cc}} |
| 3457 |
\metasetterm[fr]{cc@sep}{ -- } |
| 3458 |
\metasetterm[fr]{cc@quotel}{\guillemotleft} |
| 3459 |
\metasetterm[fr]{cc@quoter}{\guillemotright} |
| 3460 |
\metasetterm[fr]{cc@by}{Attribution} |
| 3461 |
\metasetterm[fr]{cc@sa}{Partage dans les M\^emes Conditions} |
| 3462 |
\metasetterm[fr]{cc@nd}{Pas de Modification} |
| 3463 |
\metasetterm[fr]{cc@nc}{Pas d'Utilisation Commerciale} |
| 3464 |
\metasetterm[fr]{cc@unported}{Non Transpos\'e} |
| 3465 |
\metasetterm[fr]{cc@generic}{G\'en\'erique} |
| 3466 |
\metasetterm[fr]{cc@intl}{International} |
| 3467 |
\metasetterm[fr]{cc@univ}{Universel} |
| 3468 |
\metasetterm[fr]{cc@license}{Licence} |
| 3469 |
\metasetterm[fr]{cc@pd}{Domaine Public} |
| 3470 |
\metasetterm[fr]{cc@pddecl}{Transfert dans le Domaine Public} |
| 3471 |
% \end{macrocode} |
| 3472 |
|
| 3473 |
% \begin{macrocode} |
| 3474 |
\fi |
| 3475 |
% \end{macrocode} |
| 3476 |
|
| 3477 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3478 |
% \paragraph{Spanish.} |
| 3479 |
% |
| 3480 |
% Disclaimer: professional assistance with translations needed. |
| 3481 |
% |
| 3482 |
% Check whether to load Spanish strings: |
| 3483 |
% \begin{macrocode} |
| 3484 |
\ifdefined\mstr@lang@es |
| 3485 |
% \end{macrocode} |
| 3486 |
|
| 3487 |
% Terms: |
| 3488 |
% \begin{macrocode} |
| 3489 |
\metasetterm[es]{chapter}{Cap\'itulo} |
| 3490 |
\metasetterm[es]{section}{Secci\'on} |
| 3491 |
\metasetterm[es]{subsection}{Subsecci\'on} |
| 3492 |
\metasetterm[es]{paragraph}{P\'arrafo} |
| 3493 |
\metasetterm[es]{title}{T\'itulo} |
| 3494 |
\metasetterm[es]{abstract}{Resumen} |
| 3495 |
\metasetterm[es]{copyright}{Derechos de Autor} |
| 3496 |
\metasetterm[es]{preface}{Prefacio} |
| 3497 |
\metasetterm[es]{part}{Parte} |
| 3498 |
\metasetterm[es]{appendix}{Ap\'endice} |
| 3499 |
\metasetterm[es]{page}{P\'agina} |
| 3500 |
\metasetterm[es]{figure}{Figura} |
| 3501 |
\metasetterm[es]{table}{Cuadro} |
| 3502 |
\metasetterm[es]{contents}{\'Indice} |
| 3503 |
\metasetterm[es]{listfigure}{\'Indice de Figuras} |
| 3504 |
\metasetterm[es]{listtable}{\'Indice de Cuadros} |
| 3505 |
\metasetterm[es]{references}{Referencias} |
| 3506 |
\metasetterm[es]{index}{\'Indice Alfab\'etico} |
| 3507 |
\metasetterm[es]{draft}{BORRADOR} |
| 3508 |
% \end{macrocode} |
| 3509 |
|
| 3510 |
% General purpose messages: |
| 3511 |
% \begin{macrocode} |
| 3512 |
\metaset[es]{urlmessage}{% |
| 3513 |
La versi\'on actual de esta obra se puede encontrar en: |
| 3514 |
\metapick[#1]{url}.} |
| 3515 |
\metaset[es]{partofmessage}{% |
| 3516 |
Este documento es parte de la obra: \metapick[#1]{partof}.} |
| 3517 |
\metaset[es]{licenseurlmessage}{% |
| 3518 |
Para ver una copia de esta licencia, visite: |
| 3519 |
\metapick[#1]{licenseurl}.} |
| 3520 |
% \end{macrocode} |
| 3521 |
% Copyright statements: |
| 3522 |
% \begin{macrocode} |
| 3523 |
\metaset[es]{copyright@plain}{% |
| 3524 |
Esta obra est\'a protegida por derechos de autor.} |
| 3525 |
\metaset[es]{copyright@parts}{% |
| 3526 |
Esta obra y sus partes est\'an protegidas por derechos de autor.} |
| 3527 |
\metaset[es]{copyright@doc}{% |
| 3528 |
Este documento est\'a protegido por derechos de autor.} |
| 3529 |
\metaset[es]{copyright@doc-parts}{% |
| 3530 |
Este documento y sus partes est\'an protegidos por derechos de autor.} |
| 3531 |
\metaset[es]{copyright@reserved}{Todos los derechos reservados.} |
| 3532 |
\metaset[es]{copyright@publicdomain} |
| 3533 |
{Esta obra es de dominio p\'ublico.} |
| 3534 |
% \end{macrocode} |
| 3535 |
% Creative Commons license composition: |
| 3536 |
% \begin{macrocode} |
| 3537 |
\metaset[es]{cc@url@deed}{deed.es} |
| 3538 |
\metaset[es]{cc@message}{% |
| 3539 |
Esta obra est\'a bajo la |
| 3540 |
\metapick[es]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 3541 |
\metaset[es]{cc@message@zero}{Esta obra est\'a dedicada |
| 3542 |
al dominio p\'ublico por la |
| 3543 |
\metapick[es]{licenseccfull} (\metapick[short]{licenseccfull}).} |
| 3544 |
\metaset[es]{cc@license}{% |
| 3545 |
\metatranslate[#1]{cc@license} \metatranslate[#1]{cc@cc}} |
| 3546 |
\metaset[es]{cc@license@zero}{% |
| 3547 |
\metatranslate[#1]{cc@pddecl} \metatranslate[#1]{cc@cc}} |
| 3548 |
\metasetterm[es]{cc@sep}{-} |
| 3549 |
\metasetterm[es]{cc@quotel}{\textquotedblleft} |
| 3550 |
\metasetterm[es]{cc@quoter}{\textquotedblright} |
| 3551 |
\metasetterm[es]{cc@by}{Atribuci\'on} |
| 3552 |
\metasetterm[es]{cc@sa}{CompartirIgual} |
| 3553 |
\metasetterm[es]{cc@nd}{SinDerivadas} |
| 3554 |
\metasetterm[es]{cc@nc}{NoComercial} |
| 3555 |
\metasetterm[es]{cc@unported}{No Portada} |
| 3556 |
\metasetterm[es]{cc@generic}{Gen\'erica} |
| 3557 |
\metasetterm[es]{cc@intl}{Internacional} |
| 3558 |
\metasetterm[es]{cc@univ}{Universal} |
| 3559 |
\metasetterm[es]{cc@license}{Licencia} |
| 3560 |
\metasetterm[es]{cc@pd}{Dominio P\'ublico} |
| 3561 |
\metasetterm[es]{cc@pddecl}{Dedicaci\'on de Dominio P\'ublico} |
| 3562 |
% \end{macrocode} |
| 3563 |
|
| 3564 |
% \begin{macrocode} |
| 3565 |
\fi |
| 3566 |
% \end{macrocode} |
| 3567 |
|
| 3568 |
%\iffalse |
| 3569 |
%</package> |
| 3570 |
%\fi |
| 3571 |
% |
| 3572 |
\endinput |