summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/copyrightbox/copyrightbox.tex
blob: 211e7f02bbff4f3dde368f9a349462da41dda4a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
\documentclass[pagesize=auto]{scrartcl}

\usepackage{fixltx2e}
\usepackage{etex}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{amstext}
\usepackage{array}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{microtype}
\usepackage{hyperref}
\usepackage{copyrightbox}

\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
\newcommand*{\pkg}[1]{\textsf{#1}}
\newcommand*{\cls}[1]{\textsf{#1}}
\newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
\makeatletter
\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}}
\makeatother
\newcommand*{\env}[1]{\texttt{#1}}
\newcommand*{\opt}[1]{\texttt{#1}}
\newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle}
\newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}}
\newcommand*{\oarg}[1]{\texttt{[}\meta{#1}\texttt{]}}

\addtokomafont{title}{\rmfamily}

\title{The \pkg{copyrightbox} package\thanks{This manual corresponds to
\pkg{copyrightbox}~v0.1, dated~Nov 27, 2011.}}
\author{Thomas Fischer\thanks{\mail{thomas.fischer@t-fischer.net}}\\Ives van der
Flaas\thanks{\mail{ives.vdf@gmail.com}}}
\date{\today}


\begin{document}

\maketitle

\noindent
\pkg{copyrightbox.sty} provides the command \cmd{\copyrightbox}, which is used
to put a small amount of text, usually a copyright notice, close to an image.
This text can be either below the image, it can be to the right of the image
(and rotated counterclockwise respective to normal text orientation) and it
can be to the left of the image, also rotated counterclockwise.


The command  \cmd{\copyrightbox} has two obligatory parameters, the first
being a box (usually an image loaded with the \cmd{\includegraphics} command
from the \pkg{graphicx} package) and the second being the copyright message.
It also has an optional parameter that determines the position of the
copyright notice relative to the image:
\begin{quote}
	\verb=\copyrightbox[=\meta{placement}\verb=]{=\meta{image}\verb=}{=\meta{text}\verb=}=
\end{quote}
Like usual the \verb=[=\meta{placement}\verb=]= parameter is optional, so this
command can also be expressed as
\begin{quote}
	\verb=\copyrightbox{=\meta{image}\verb=}{=\meta{text}\verb=}=
\end{quote}
In which case the copyright notice will be placed to the right of the image.

Allowed \meta{placement}s are
\begin{description}
	\item[\texttt{l}]The copyright notice is placed to the left of the image.
	\item[\texttt{r}](Default) The copyright notice is placed to the right of the image.
	\item[\texttt{b}]The copyright notice is placed below the image.
\end{description}

A \cmd{\copyrightbox} will be bigger than the image it encompasses, since it
will also fit the copyright text.  

\clearpage
\section{Examples}
\subsection{Example 1}
The command

\begin{verbatim}
 \copyrightbox
      {\includegraphics[scale=0.5]{coin}}
      {Image put in the public domain by the U.S. Mint.}
\end{verbatim}
produces:
\begin{center}
	\copyrightbox
		{\includegraphics[scale=0.5]{coin}}
		{Image put in the public domain by the U.S. Mint.}
\end{center}

\subsection{Example 2}
The command

\begin{verbatim}
 \copyrightbox[b]
      {\includegraphics[scale=0.5]{coin}}
      {Image put in the public domain by the U.S. Mint.}
\end{verbatim}
produces:
\begin{center}
	\copyrightbox[b]
		{\includegraphics[scale=0.5]{coin}}
		{Image put in the public domain by the U.S. Mint.}
\end{center}


\subsection{Example 3}
The command

\begin{verbatim}
 \copyrightbox[l]
      {\includegraphics[scale=0.5]{coin}}
      {Image put in the public domain by the U.S. Mint.}
\end{verbatim}
produces:
\begin{center}
	\copyrightbox[l]
		{\includegraphics[scale=0.5]{coin}}
		{Image put in the public domain by the U.S. Mint.}
\end{center}


\subsection{Example 4}
\cmd{\copyrightbox} does not require \cmd{\includegraphics} images, you can
just as easily generate your own images with something like \pkg{TikZ} or the
\LaTeX\ \env{picture} environment.

For example, the command

\begin{verbatim}
\copyrightbox[r] { \tikz \filldraw[fill=green] (0,0) circle (2); }
{Image created by the author.}
\end{verbatim}
produces:
\begin{center}
\copyrightbox[r] { \tikz \filldraw[fill=green] (0,0) circle (2); }
{Image created by the author.}
\end{center}

\section{Notes}

\subsection{Changing the Font}
It's possible to change every aspect of the font used in the copyright message
by renewing the command \cmd{\CRB$@$setcopyrightfont}, for example: 

\begin{verbatim}
\makeatletter
\renewcommand{\CRB@setcopyrightfont}{%
	\footnotesize 
	\color{red!33}
	\sc
}
\makeatother

\copyrightbox[r] { \tikz \filldraw[fill=green] (0,0) circle (2); }
{Image created by the author.}
\end{verbatim}
can be placed anywhere in your .tex file and will generate the copyright notice in small caps in a reddish tint:
\begin{center}
\makeatletter
\renewcommand{\CRB@setcopyrightfont}{%
	\footnotesize 
	\color{red!33}
	\sc
}
\makeatother

\copyrightbox[r] { \tikz \filldraw[fill=green] (0,0) circle (2); }
{Image created by the author.}
\end{center}

Ofcourse, it's also possible to select a font using the New Font Selection
System in \LaTeX{}2e, for example, to select Helvetica\footnote{This font might not be available on your system. } size
4:

\begin{verbatim}
\makeatletter
\renewcommand{\CRB@setcopyrightfont}{%
\usefont{T1}{phv}{m}{n}\fontsize{4}{4}\selectfont
}
\makeatother

\copyrightbox[r] { \tikz \filldraw[fill=green] (0,0) circle (2); }
{Image created by the author.}
\end{verbatim}

\begin{center}
\makeatletter
\renewcommand{\CRB@setcopyrightfont}{%
\usefont{T1}{phv}{m}{n}\fontsize{4}{4}\selectfont
}
\makeatother

\copyrightbox[r] { \tikz \filldraw[fill=green] (0,0) circle (2); }
{Image created by the author.}
\end{center}

\subsection{Justification}
Although it's not exactly recommended, it is possible to place relatively
large amounts of text near images. Long amounts of text are usually nicer to
look at when justified, and to do so \cmd{\renewcommand}
\cmd{\CRB@setcopyrightparagraphstyle} to something other than
\cmd{\raggedright}, which is the default. 

Place

\begin{verbatim}
\makeatletter
\renewcommand{\CRB@setcopyrightparagraphstyle}{%
% Return to justifying text
\setlength{\rightskip}{0pt}
\setlength{\leftskip}{0pt}
}

\makeatother
\begin{center}
	\copyrightbox[r]
		{\includegraphics[scale=0.5]{coin}}
      {This here image was put in the public domain some time ago by the U.S. Mint.}
\end{center}
\end{verbatim}

anywhere in your .tex file to produce:
\makeatletter
\renewcommand{\CRB@setcopyrightparagraphstyle}{%
% Return to justifying text
\setlength{\rightskip}{0pt}
\setlength{\leftskip}{0pt}
}

\makeatother
\begin{center}
	\copyrightbox[r]
		{\includegraphics[scale=0.5]{coin}}
      {This here image was put in the public domain some time ago by the U.S. Mint.}
\end{center}

instead of 

\makeatletter
\renewcommand{\CRB@setcopyrightparagraphstyle}{%
% Return to justifying text
\raggedright
}

\makeatother
\begin{center}
	\copyrightbox[r]
		{\includegraphics[scale=0.5]{coin}}
      {This here image was put in the public domain some time ago by the U.S. Mint.}
\end{center}

\section{Bugs and Suggestions}
Bugreports, suggestions and patches are welcome and can be emailed to
\mail{ives.vdf@gmail.com}, or you can fork
\url{https://github.com/Ivesvdf/copyrightbox} and send me a pull request
through Github. 
\end{document}