| 1 |
\documentclass{article} |
| 2 |
\usepackage{listings} |
| 3 |
|
| 4 |
\lstloadlanguages{[LaTeX]TeX} \lstset{language=[LaTeX]TeX, |
| 5 |
basicstyle=\small, labelstyle=\tiny, labelstep=0, |
| 6 |
labelsep=5pt, commentstyle=\emph, stringstyle=\texttt} |
| 7 |
|
| 8 |
\title{The Plates Package} |
| 9 |
|
| 10 |
\author{Anthony A. Tanbakuchi \\ \small{[email protected]} \\ v0.1 last revised 2002/3/18} |
| 11 |
|
| 12 |
\date{} |
| 13 |
|
| 14 |
\begin{document} |
| 15 |
\maketitle |
| 16 |
\begin{abstract} |
| 17 |
The plates package provides a simple facility for inserting color |
| 18 |
figures in documents when they should be gathered and printed |
| 19 |
together |
| 20 |
--- just like in books with a section of color plates. The benefit of |
| 21 |
such a facility is to allow these special figures to be printed |
| 22 |
separately and later slipped into the final document. The package |
| 23 |
provides the plates environment to handle this situation. The user |
| 24 |
need only place these special figures in a plate environment |
| 25 |
instead of a figure environment and issue a command to print the |
| 26 |
plates at a chosen location in the document. Additionaly, if the |
| 27 |
author wishes to have a version of the document where the color |
| 28 |
figures are included in the text merely including the |
| 29 |
\emph{figures} option will change the behavior of the plates |
| 30 |
environment to a figure environment, causing the plates to be |
| 31 |
printed directly in the text. Finally, the use of |
| 32 |
\lstinline!\autoref{...}! from the \textbf{hyperref} package will |
| 33 |
allow references to logically chose the prefix \emph{Figure} or |
| 34 |
\emph{Plates} depending if the figure option has been given. |
| 35 |
\end{abstract} |
| 36 |
|
| 37 |
It is important to note that one could just create a plate |
| 38 |
appendix in their document and put all their special figures |
| 39 |
directly in this section of the document, alleviating the need for |
| 40 |
this package. However, by using the plates package one can turn |
| 41 |
on and off the functionality, allowing the creation of printed |
| 42 |
version of the document and possibly on line versions (like PDF's) |
| 43 |
where it would be more logical to have the plated near the point |
| 44 |
referenced in the text. Furthermore, by placing the plates in the |
| 45 |
document's text (like figures) the source document is much easier |
| 46 |
to edit. |
| 47 |
|
| 48 |
\section{Usage} |
| 49 |
The new package can be invoked in the preamble by,\\ |
| 50 |
\lstinline!\usepackage[<options>]{plates}!\\ |
| 51 |
Now the new plate environment is available for use in the |
| 52 |
document. The plate environment is used just like the figure |
| 53 |
environment. |
| 54 |
|
| 55 |
\begin{lstlisting}{} |
| 56 |
\begin{plate} |
| 57 |
%Your normal figure commands here eg. |
| 58 |
\cation{A caption} \label{...} |
| 59 |
\end{plate} |
| 60 |
\end{lstlisting} |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
NOTE: it is recommended that you use the \textbf{hyperref} |
| 65 |
package, the plates package dynamically changes the |
| 66 |
\lstinline!\autoref{...}! command such that if |
| 67 |
\lstinline!\autoref{...}! is issued and no options were used when |
| 68 |
the package was loaded, then Plate \ldots is printed, however it |
| 69 |
the package is used with the \emph{figures} option, then |
| 70 |
\lstinline!\autoref{...}! is properly redefined to output Figure |
| 71 |
\ldots. |
| 72 |
|
| 73 |
\bigskip |
| 74 |
|
| 75 |
\noindent {\large Package Options:} |
| 76 |
\begin{description} |
| 77 |
\item[figures] Treats plates just like figures. Gathering is |
| 78 |
turned off, \lstinline!\autoref{plate:...}! references as Figure |
| 79 |
instead of Plate. |
| 80 |
\item[onefloatperpage] Ensures that one float is on a single |
| 81 |
page. After each float \lstinline!\cleardoublepage! is called, this is particulary |
| 82 |
useful in a double sided document where the color figures will |
| 83 |
be one to a page and |
| 84 |
one sided. |
| 85 |
If you wish to define your own actions to be taken after each |
| 86 |
float, you can manually do it, an example of double page |
| 87 |
clearing is:\\ |
| 88 |
\lstinline!\renewcommand{\efloatseparator}{\cleardoublepage}! |
| 89 |
\item[memoir] If the memoir class is being used, then the option |
| 90 |
will cause \lstinline!\ProcessPlates! to create an appendix |
| 91 |
page called Plates before the plates are printed. If this |
| 92 |
option is used and the memoir class is not in use an error will |
| 93 |
occur. If you are not using the memoir package, but wish to |
| 94 |
define your own actions to create appendix pages and such before the |
| 95 |
plates are printed, then you can manually define the |
| 96 |
command: \lstinline!\AtBeginPlates{ Your Actions Here }!. |
| 97 |
\end{description} |
| 98 |
|
| 99 |
\bigskip |
| 100 |
|
| 101 |
\noindent {\large New Commands:} |
| 102 |
\begin{description} |
| 103 |
\item[$\backslash$listofplates] Functions just like |
| 104 |
$\backslash$listoffigures but prints a list of the plates. |
| 105 |
\item[$\backslash$ProcessPlates] At point of issue in document |
| 106 |
all the gathered plates thus far are printed. |
| 107 |
Therefore, the command can be used to accumulate plates to the |
| 108 |
end of each chapter (if issued at the end of each chapter) or at |
| 109 |
the end of the document in an appendix (if issued at the end). |
| 110 |
Note, if the command is never issued, then it will dump all the |
| 111 |
gathered plates at the end of the document. |
| 112 |
\item[$\backslash$atBeginPlates] User definable actions that |
| 113 |
should occur just before the plates are printed. (Eg. |
| 114 |
\lstinline!\atBeginPlates{\chapter{Plates}}!) It is preferable to use this |
| 115 |
method |
| 116 |
rather than hard coding the commands into the document in front |
| 117 |
of the \lstinline!\ProcessPlates! so that if the \emph{figures} |
| 118 |
option is used the actions will not be executed. |
| 119 |
\item[$\backslash$setplatename] Allows user to define the actual |
| 120 |
name used for the plates environment in the table of contents, caption, etc. |
| 121 |
The default is \lstinline!\setplatename{Plate}!, alternately you |
| 122 |
could set it to \lstinline!\setplatename{Diagram}!. Note, you |
| 123 |
should use the singular form of the desired name. |
| 124 |
\end{description} |
| 125 |
|
| 126 |
\section{Examples} |
| 127 |
The following example shows how the commands are used. The |
| 128 |
example will print out all \emph{figure} environments normally, |
| 129 |
but the \emph{plate} environments will be gathered and printed at |
| 130 |
the end of the document where the command |
| 131 |
\lstinline!\ProcessPlates! is issued. |
| 132 |
|
| 133 |
\begin{lstlisting}{} |
| 134 |
\documentclass{article} |
| 135 |
\usepackage{plates} |
| 136 |
\usepackage{hyperref} |
| 137 |
|
| 138 |
\setplatename{Photo} \atBeginPlates{\section{Photos}} |
| 139 |
|
| 140 |
\begin{document} |
| 141 |
%Print a list of figures and plates |
| 142 |
\listoffigures \listofplates |
| 143 |
|
| 144 |
|
| 145 |
\section{Conclusion} |
| 146 |
The document text begins. Here we can include a plate and |
| 147 |
reference it by \autoref{Plate:1}, yet it won't appear until we |
| 148 |
issue the \ProcessPlates command. |
| 149 |
\begin{plate} |
| 150 |
This is a plate. |
| 151 |
\caption{A plate caption.} |
| 152 |
\label{Plate:1} |
| 153 |
\end{plate} |
| 154 |
|
| 155 |
Now a figure in our document. \autoref{fig:1} will appear near |
| 156 |
our reference to it. |
| 157 |
\begin{figure} |
| 158 |
A figure to look at. |
| 159 |
\caption{A figure} |
| 160 |
\label{fig:1} |
| 161 |
\end{figure} |
| 162 |
|
| 163 |
Another plate. |
| 164 |
\begin{plate} |
| 165 |
This is a plate. |
| 166 |
\caption{A plate caption.} |
| 167 |
\label{Plate:2} |
| 168 |
\end{plate} |
| 169 |
|
| 170 |
\section{Conclusion} |
| 171 |
Some final text to go with our thoughts. |
| 172 |
%Now we wish all the plates to print here. |
| 173 |
\ProcessPlates |
| 174 |
% The \atBeginPlates command is issued, |
| 175 |
% creating a new Photos section. |
| 176 |
% Next, |
| 177 |
% Plate:1 then Plate:2 is printed. |
| 178 |
\end{document} |
| 179 |
\end{lstlisting} |
| 180 |
|
| 181 |
\bigskip |
| 182 |
|
| 183 |
Thus, the document has contains by order: introduction section, |
| 184 |
fig:1, concluding section, a new section called Photos, then |
| 185 |
plate:1 and plate:2. |
| 186 |
|
| 187 |
If we issued the option \emph{figures} to the plates package, the |
| 188 |
plates would be printed in the text, the order would be, |
| 189 |
introduction section, plate:1, fig:1, plate:2, then concluding |
| 190 |
section. \lstinline!\listofplates! and \lstinline!\ProcessPlates! |
| 191 |
would have no effect. |
| 192 |
|
| 193 |
|
| 194 |
\section{Credits} |
| 195 |
This package is built from a little new code and some modified |
| 196 |
code from other packages. Specifically, code from the memoir |
| 197 |
class is used to define a new float environment, to enable the |
| 198 |
gathering of the plates modified code from the endfloat package |
| 199 |
has also been used. I would like to thank the authors of both |
| 200 |
noted packages for providing much of the needed facilities |
| 201 |
enabling this package. |
| 202 |
|
| 203 |
\section{Closing} |
| 204 |
If you like this package, find bugs, or just have useful comments |
| 205 |
please let the me know at [email protected]. Please note |
| 206 |
that I am not a TeX hack, just someone who had a wish for this |
| 207 |
type of package and managed to find a solution. |
| 208 |
\end{document} |