summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/plates/plates.tex
blob: c65fec0e1b01eba9ab4bea4edf100ce9b7770fa3 (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
\documentclass{article}
\usepackage{listings}

\lstloadlanguages{[LaTeX]TeX} \lstset{language=[LaTeX]TeX,
basicstyle=\small, labelstyle=\tiny, labelstep=0,
    labelsep=5pt, commentstyle=\emph, stringstyle=\texttt}

\title{The Plates Package}

\author{Anthony A. Tanbakuchi \\ \small{atanbakuchi@hotmail.com} \\ v0.1 last revised 2002/3/18}

\date{}

\begin{document}
\maketitle
\begin{abstract}
The plates package provides a simple facility for inserting color
figures in documents when they should be gathered and printed
together
--- just like in books with a section of color plates. The benefit of
such a facility is to allow these special figures to be printed
separately  and later slipped into the final document. The package
provides the plates environment to handle this situation. The user
need only place these special figures in a plate environment
instead of a figure environment and issue a command to print the
plates at a chosen location in the document. Additionaly, if the
author wishes to have a version of the document where the color
figures are included in the text merely including the
\emph{figures} option will change the behavior of the plates
environment to a figure environment, causing the plates to be
printed directly in the text. Finally, the use of
\lstinline!\autoref{...}! from the \textbf{hyperref} package will
allow references to logically chose the prefix \emph{Figure} or
\emph{Plates} depending if the figure option has been given.
\end{abstract}

It is important to note that one could just create a plate
appendix in their document and put all their special figures
directly in this section of the document, alleviating the need for
this package.  However, by using the plates package one can turn
on and off the functionality, allowing the creation of printed
version of the document and possibly on line versions (like PDF's)
where it would be more logical to have the plated near the point
referenced in the text.  Furthermore, by placing the plates in the
document's text (like figures) the source document is much easier
to edit.

\section{Usage}
The new package can be invoked in the preamble by,\\
\lstinline!\usepackage[<options>]{plates}!\\
Now the new plate environment is available for use in the
document.  The plate environment is used just like the figure
environment.

\begin{lstlisting}{}
\begin{plate}
    %Your normal figure commands here eg.
    \cation{A caption} \label{...}
\end{plate}
\end{lstlisting}



NOTE: it is recommended that you use the \textbf{hyperref}
package, the plates package dynamically changes the
\lstinline!\autoref{...}! command such that if
\lstinline!\autoref{...}! is issued and no options were used when
the package was loaded, then Plate \ldots is printed, however it
the package is used with the \emph{figures} option, then
\lstinline!\autoref{...}! is properly redefined to output Figure
\ldots.

\bigskip

\noindent {\large Package Options:}
\begin{description}
  \item[figures] Treats plates just like figures.  Gathering is
  turned off, \lstinline!\autoref{plate:...}! references as Figure
  instead of Plate.
  \item[onefloatperpage] Ensures that one float is on a single
  page.  After each float \lstinline!\cleardoublepage! is called, this is particulary
  useful in a double sided document where the color figures will
  be one to a page and
  one sided.
  If you wish to define your own actions to be taken after each
  float, you can manually do it, an example of double page
  clearing is:\\
  \lstinline!\renewcommand{\efloatseparator}{\cleardoublepage}!
  \item[memoir] If the memoir class is being used, then the option
  will cause \lstinline!\ProcessPlates! to create an appendix
  page called Plates before the plates are printed.  If this
  option is used and the memoir class is not in use an error will
  occur.  If you are not using the memoir package, but wish to
  define your own actions to create appendix pages and such before the
  plates are printed,  then you can manually define the
  command: \lstinline!\AtBeginPlates{ Your Actions Here }!.
\end{description}

\bigskip

\noindent {\large New Commands:}
\begin{description}
  \item[$\backslash$listofplates] Functions just like
  $\backslash$listoffigures but prints a list of the plates.
  \item[$\backslash$ProcessPlates] At point of issue in document
  all the gathered plates thus far are printed.
  Therefore, the command can be used to accumulate plates to the
  end of each chapter (if issued at the end of each chapter) or at
  the end of the document in an appendix (if issued at the end).
  Note, if the command is never issued, then it will dump all the
  gathered plates at the end of the document.
  \item[$\backslash$atBeginPlates] User definable actions that
  should occur just before the plates are printed.  (Eg.
  \lstinline!\atBeginPlates{\chapter{Plates}}!)  It is preferable to use this
  method
  rather than hard coding the commands into the document in front
  of the \lstinline!\ProcessPlates! so that if the \emph{figures}
  option is used the actions will not be executed.
  \item[$\backslash$setplatename] Allows user to define the actual
  name used for the plates environment in the table of contents, caption, etc.
  The default is \lstinline!\setplatename{Plate}!, alternately you
  could set it to \lstinline!\setplatename{Diagram}!.  Note, you
  should use the singular form of the desired name.
\end{description}

\section{Examples}
The following example shows how the commands are used.  The
example will print out all \emph{figure} environments normally,
but the \emph{plate} environments will be gathered and printed at
the end of the document where the command
\lstinline!\ProcessPlates! is issued.

\begin{lstlisting}{}
\documentclass{article}
\usepackage{plates}
\usepackage{hyperref}

\setplatename{Photo} \atBeginPlates{\section{Photos}}

\begin{document}
%Print a list of figures and plates
\listoffigures \listofplates


\section{Conclusion}
The document text begins.  Here we can include a plate and
reference it by \autoref{Plate:1}, yet it won't appear until we
issue the \ProcessPlates command.
\begin{plate}
    This is a plate.
    \caption{A plate caption.}
    \label{Plate:1}
\end{plate}

Now a figure in our document.  \autoref{fig:1} will appear near
our reference to it.
\begin{figure}
    A figure to look at.
    \caption{A figure}
    \label{fig:1}
\end{figure}

Another plate.
\begin{plate}
    This is a plate.
    \caption{A plate caption.}
    \label{Plate:2}
\end{plate}

\section{Conclusion}
Some final text to go with our thoughts.
%Now we wish all the plates to print here.
\ProcessPlates
% The \atBeginPlates command is issued,
% creating a new Photos section.
% Next,
% Plate:1 then Plate:2 is printed.
\end{document}
\end{lstlisting}

\bigskip

Thus, the document has contains by order: introduction section,
fig:1, concluding section, a new section called Photos, then
plate:1 and plate:2.

If we issued the option \emph{figures} to the plates package, the
plates would be printed in the text, the order would be,
introduction section, plate:1, fig:1, plate:2, then concluding
section. \lstinline!\listofplates! and \lstinline!\ProcessPlates!
would have no effect.


\section{Credits}
This package is built from a little new code and some modified
code from other packages.  Specifically, code from the memoir
class is used to define a new float environment, to enable the
gathering of the plates modified code from the endfloat package
has also been used. I would like to thank the authors of both
noted packages for providing much of the needed facilities
enabling this package.

\section{Closing}
If you like this package, find bugs, or just have useful comments
please let the me know at atanbakuchi@hotmail.com.  Please note
that I am not a TeX hack, just someone who had a wish for this
type of package and managed to find a solution.
\end{document}