| 1 |
|
| 2 |
%version 2004-8-12 |
| 3 |
|
| 4 |
\documentclass{ltxdoc} |
| 5 |
|
| 6 |
\def\FigBib{{\rmfamily F\kern-.05em\lower-.35ex\hbox{\textsc{i\kern-.025em g}}\kern-.05em% |
| 7 |
B\kern-.05em\textsc{i\kern-.025em b}}} |
| 8 |
|
| 9 |
\title{The \FigBib\ - Package} |
| 10 |
\author{Jan Poland} |
| 11 |
|
| 12 |
\setlength{\parindent}{0mm} |
| 13 |
\setlength{\parskip}{1mm} |
| 14 |
|
| 15 |
\begin{document} |
| 16 |
\maketitle |
| 17 |
|
| 18 |
\begin{abstract} |
| 19 |
\noindent This document describes how to manage figure databases, using |
| 20 |
\BibTeX\ together with the \FigBib\ - Package. Some \FigBib\ features |
| 21 |
are: |
| 22 |
\begin{itemize} |
| 23 |
\item Store and manage figures in a \BibTeX\ database |
| 24 |
\item Include figures in your \LaTeX\ document with one short |
| 25 |
command |
| 26 |
\item Generate a List of Figures containing more/other |
| 27 |
information than the figure captions |
| 28 |
\item Control with one switch where to output the figures, either |
| 29 |
as usual float objects or in a separate part at the end of your |
| 30 |
document |
| 31 |
\end{itemize} |
| 32 |
\end{abstract} |
| 33 |
|
| 34 |
\section{Introduction and Quick Start} |
| 35 |
|
| 36 |
The \FigBib\ is designed for \LaTeX\ authors who have to organize |
| 37 |
many figures. In this case, it may not be convenient to manage all |
| 38 |
information in a ``low level" manner directly in the documents. |
| 39 |
Instead, it would be desirable to have a database which contains |
| 40 |
the images, corresponding captions and additional information in a |
| 41 |
bundled form. Then, a ``high-level" command is issued each time a |
| 42 |
figure needs to be included. |
| 43 |
|
| 44 |
\FigBib\ provides such a mechanism. If the user wants to include a |
| 45 |
figure with the label ``MyFigure:1" as a float object on the top |
| 46 |
of the page with a width of 5cm, then he writes |
| 47 |
\begin{verbatim} |
| 48 |
\fbEpsfig{MyFigure:1}{5cm}{t} |
| 49 |
\end{verbatim} |
| 50 |
The corresponding data for the figure, such as caption, name of |
| 51 |
the eps file etc., is stored in a \BibTeX\ data base. There, the |
| 52 |
entry could be for example |
| 53 |
\begin{verbatim} |
| 54 |
@fig{MyFigure:1, |
| 55 |
main = {This is the description/caption}, |
| 56 |
file = {myfigure1} |
| 57 |
} |
| 58 |
\end{verbatim} |
| 59 |
In order to process the information, the latex document must |
| 60 |
contain a |
| 61 |
\begin{verbatim} |
| 62 |
\usepackage{figbib} |
| 63 |
\end{verbatim} |
| 64 |
in the document header and a |
| 65 |
\begin{verbatim} |
| 66 |
\fbList{<figure-bibfile>} |
| 67 |
\end{verbatim} |
| 68 |
at the end, which also generates a List of Figures. Then, the |
| 69 |
document is compiled with the command sequence |
| 70 |
\begin{verbatim} |
| 71 |
latex <latex-file> |
| 72 |
bibtex <latex-file>.figbib |
| 73 |
latex <latex-file> |
| 74 |
latex <latex-file> |
| 75 |
latex <latex-file> |
| 76 |
\end{verbatim} |
| 77 |
(The \texttt{latex} command is repeated until all cross-references |
| 78 |
have been updated correctly, for \FigBib\ this is the case after |
| 79 |
at most three runs.) |
| 80 |
|
| 81 |
\subsection{The Example File} |
| 82 |
Try the example file \texttt{figbib\_sample} provided with this |
| 83 |
package with the above command sequence. |
| 84 |
|
| 85 |
\section{Reference} |
| 86 |
|
| 87 |
\FigBib\ processes information on two levels: (1) the |
| 88 |
\emph{contents} of the figures, and (2) the \emph{float objects} containing |
| 89 |
the figures. For the latter, \FigBib\ gives the user the choice |
| 90 |
between usual float objects and a separate part at the end of the |
| 91 |
document. All commands and options for the \FigBib\ package are |
| 92 |
described in the following. |
| 93 |
|
| 94 |
\subsection{The \BibTeX\ Style} |
| 95 |
|
| 96 |
\DescribeMacro{@fig} |
| 97 |
\DescribeMacro{main} |
| 98 |
\DescribeMacro{add} |
| 99 |
\DescribeMacro{source} |
| 100 |
\DescribeMacro{caption} |
| 101 |
\DescribeMacro{file} |
| 102 |
There is only one entry type for the \FigBib-database, namely |
| 103 |
\texttt{@fig}. It has five fields: |
| 104 |
|
| 105 |
\begin{tabular}{l l l} |
| 106 |
\texttt{main} & (mandatory) & the main description/caption\\ |
| 107 |
\texttt{add} & (optional) & an additional description\\ |
| 108 |
\texttt{source} & (optional) & the source of the figure\\ |
| 109 |
\texttt{caption} & (optional) & a caption which (if it is |
| 110 |
defined) supersedes \texttt{main}\\ |
| 111 |
\texttt{file} & (mandatory) & the eps-file containing the |
| 112 |
figure |
| 113 |
\end{tabular} |
| 114 |
|
| 115 |
The user has options to control how these fields are used in the |
| 116 |
captions and the List of Figures. This is described in Section |
| 117 |
\ref{options}. An example entry for your database would be |
| 118 |
\begin{verbatim} |
| 119 |
@fig{Beatles:1968, |
| 120 |
main = {The Beatles on stage}, |
| 121 |
add = {Picture was probably taken at some performance in 1968}, |
| 122 |
source = {A nice book of mine}, |
| 123 |
file = {beatles1} |
| 124 |
} |
| 125 |
\end{verbatim} |
| 126 |
|
| 127 |
\DescribeMacro{\fbDirectory} |
| 128 |
If you store your figure files at a central place on your file |
| 129 |
system, you may set \verb+\fbDirectory+ to point there. This |
| 130 |
should be defined in the document header of your |
| 131 |
\LaTeX-document. For example, in a windows system, the command could |
| 132 |
read |
| 133 |
\begin{verbatim} |
| 134 |
\def\fbDirectory{c:/EPSpics/} |
| 135 |
\end{verbatim} |
| 136 |
|
| 137 |
\DescribeMacro{\figbibBst} |
| 138 |
You may change the default \BibTeX\ style file, which is |
| 139 |
\texttt{figbib.bst}, by redefining \verb+\figbibBst+. This should |
| 140 |
be done in the \LaTeX document header. One alternative \BibTeX\ |
| 141 |
style file, \texttt{figbib1.bst}, is already included in \FigBib. |
| 142 |
Put |
| 143 |
\begin{verbatim} |
| 144 |
\def\figbibBst{figbib1} |
| 145 |
\end{verbatim} |
| 146 |
in your document header in order to apply it. Then the fields |
| 147 |
\texttt{main1}, \texttt{add1}, \texttt{source1}, and \texttt{caption1} |
| 148 |
are used instead of \texttt{main}, \texttt{add}, \texttt{source}, |
| 149 |
and \texttt{caption}. Thus you can maintain your database in two |
| 150 |
\emph{different languages}, e.g.\ the default fields \texttt{main} |
| 151 |
etc.\ containing English and the alternative fields \texttt{main1} |
| 152 |
etc.\ containing German entries. |
| 153 |
|
| 154 |
\subsection{Including a Figure}\label{include} |
| 155 |
|
| 156 |
There are two ways to include a figure from the database to your |
| 157 |
document: (1) with a single command defining the figure and the |
| 158 |
surrounding (float) environment simultaneously, and (2) including |
| 159 |
the figure without defining the environment. The former method is |
| 160 |
clearly shorter. On the other hand, the latter allows you to have |
| 161 |
more than one figure in a float environment. |
| 162 |
|
| 163 |
\DescribeMacro{\fbEpsfig} |
| 164 |
\DescribeMacro{\fbEpsfigM} |
| 165 |
In order to include a figure and at the same time define the |
| 166 |
environment, use e.g. |
| 167 |
\begin{verbatim} |
| 168 |
\fbEpsfig{Beatles:1968}{8cm}{t!} |
| 169 |
\end{verbatim} |
| 170 |
Then the figure with the label \texttt{Beatles:1968} is included, |
| 171 |
the width of the figure is set to 8cm, and (as default) a float |
| 172 |
environment is generated and placed at the top of the current page |
| 173 |
(\texttt{t!}). The width of the caption would be the whole text |
| 174 |
width. Use \verb+\fbEpsfigM+ instead of |
| 175 |
\verb+\fbEpsfig+ to restrict the caption width to the figure |
| 176 |
width (\texttt{M} stands for \emph{minipage}). |
| 177 |
|
| 178 |
\DescribeMacro{\fbEps} |
| 179 |
\DescribeMacro{\fbEpsM} |
| 180 |
\DescribeMacro{\fbhspace} |
| 181 |
\DescribeMacro{\fbhfill} |
| 182 |
If you want to include more than one figure in an environment, you |
| 183 |
can use for example the following command sequence: |
| 184 |
\begin{verbatim} |
| 185 |
\begin{fbFloat}[b] |
| 186 |
\fbEpsM{Beatles:1968}{5cm} |
| 187 |
\fbhspace{2cm} |
| 188 |
\fbEpsM{Beatles:1969}{5cm} |
| 189 |
\end{fbFloat} |
| 190 |
\end{verbatim} |
| 191 |
There, \verb+\fbEpsM+ includes the figure and sets the caption |
| 192 |
width to the figure width -- \verb+\fbEps+ would set the caption |
| 193 |
width to the text width instead. \verb+\fbhspace+ inserts a |
| 194 |
horizontal space, you could also use \verb+\fbhfill+ (without |
| 195 |
argument) for a horizontal fill. |
| 196 |
|
| 197 |
\DescribeMacro{fbFloat} |
| 198 |
The environment is here defined by |
| 199 |
\begin{verbatim} |
| 200 |
\begin{fbFloat}[b] ... \end{fbFloat} |
| 201 |
\end{verbatim} |
| 202 |
where the positioning parameter \texttt{[b]} is optional. This |
| 203 |
\FigBib-environment is \emph{flexible}: As default, it causes the |
| 204 |
generation as a usual float object. However, if you set the option |
| 205 |
\texttt{xpart} (see Sections \ref{xpart} and \ref{options}), then |
| 206 |
the figure is generated in an extra part (usually) at the end of |
| 207 |
the document. If the usual \texttt{figure} environment is used |
| 208 |
instead of \texttt{fbFloat}, i.e. |
| 209 |
\begin{verbatim} |
| 210 |
\begin{figure} ... \end{figure} |
| 211 |
\end{verbatim} |
| 212 |
then a float object is \emph{always} created. This may be useful |
| 213 |
if you want to have usual float objects and extra figure parts |
| 214 |
simultaneously in a document. Note that \verb+\fbEpsfig+ and |
| 215 |
\verb+\fbEpsfigM+ also internally generate an |
| 216 |
\texttt{fbFloat}-environment. |
| 217 |
|
| 218 |
\DescribeMacro{\fbCaptionStyle} |
| 219 |
You may set the caption style by redefining |
| 220 |
\verb+\fbCaptionStyle+, e.g. |
| 221 |
\begin{verbatim} |
| 222 |
\def\fbCaptionStyle{\small\itshape} |
| 223 |
\end{verbatim} |
| 224 |
The default style is empty, i.e.\ the same as the text style. |
| 225 |
|
| 226 |
\subsection{Extra Figure Parts}\label{xpart} |
| 227 |
|
| 228 |
\DescribeMacro{option xpart} |
| 229 |
\DescribeMacro{\fbTheFigs} |
| 230 |
If you pass the option \texttt{xpart} to \FigBib\ (compare |
| 231 |
Sections \ref{include} and \ref{options}), then all figures in |
| 232 |
\texttt{fbFloat}-environments are moved to one or more \emph{extra |
| 233 |
figure parts}. Note that also \verb+\fbEpsfig+ and |
| 234 |
\verb+\fbEpsfigM+ implicitly generate \texttt{fbFloat} environments. An |
| 235 |
extra figure part is invoked by |
| 236 |
\begin{verbatim} |
| 237 |
\fbTheFigs |
| 238 |
\end{verbatim} |
| 239 |
and causes the output of all figures which were defined up to this |
| 240 |
command. You can give \verb+\fbTheFigs+ multiple times, creating |
| 241 |
several figure parts in your document. |
| 242 |
|
| 243 |
\DescribeMacro{\fbvspace} |
| 244 |
In the figure part, figures are created in the order they appear |
| 245 |
in the document. You may include a \verb+\fbvspace+ command before |
| 246 |
or after a figure inside the \texttt{fbFloat} environment, e.g.\ |
| 247 |
\verb+\fbvspace{1cm}+. This causes a vertical space before/after |
| 248 |
the respective figure. The command is ignored if the option |
| 249 |
\texttt{xpart} is not given. |
| 250 |
|
| 251 |
\DescribeMacro{\figbibskip} |
| 252 |
\DescribeMacro{\figbibcskip} |
| 253 |
In the figure parts, you may redefine the space |
| 254 |
\verb+\figbibskip+ between subsequent figures, e.g.\ |
| 255 |
\verb+\setlength{\figbibskip}{1cm}+. Similarly, you can |
| 256 |
redefine the space \verb+\figbibcskip+ between the figures and |
| 257 |
the corresponding captions. |
| 258 |
|
| 259 |
\DescribeMacro{option xplate} |
| 260 |
If you are using floats \emph{and} figure parts together in one |
| 261 |
document, they should not be referred to as the same type, e.g.\ |
| 262 |
both as a ``figure". In this case, you should declare the option |
| 263 |
\texttt{xplate}, causing that the figures in the extra part are |
| 264 |
referred to as ``plates" rather than ``figures". |
| 265 |
|
| 266 |
\DescribeMacro{fbMinipage} |
| 267 |
If you want to create a \emph{minipage} inside an \texttt{fbFloat} |
| 268 |
environment, you should use the \texttt{fbMinipage} environment |
| 269 |
instead of the usual \texttt{minipage}. It takes one argument, |
| 270 |
namely the width of the minipage, e.g. |
| 271 |
\begin{verbatim} |
| 272 |
\begin{fbMinipage}{\textwidth}...\end{fbMinipage} |
| 273 |
\end{verbatim} |
| 274 |
If the \texttt{xpart} option is set, then the fbMinipages are |
| 275 |
correctly moved to the figure parts. (The only use of a minipage I |
| 276 |
can think of in this context is for having two or more figures in |
| 277 |
one row, when you want to avoid the constraint that some caption |
| 278 |
width equals the figure width.) |
| 279 |
|
| 280 |
\subsection{The List of Figures} |
| 281 |
|
| 282 |
\DescribeMacro{\fbList} |
| 283 |
At any point of the document, you can output the List of Figures |
| 284 |
by giving the command |
| 285 |
\begin{verbatim} |
| 286 |
\fbList{<figure-bibfile>} |
| 287 |
\end{verbatim} |
| 288 |
where \texttt{<figure-bibfile>} is your figure \BibTeX-database |
| 289 |
(without the .bib extension). You \emph{must} include this command |
| 290 |
\emph{exactly once} in your document. |
| 291 |
|
| 292 |
\DescribeMacro{\figbibListHeader} |
| 293 |
Usually, \verb+\fbList+ generates a starred (i.e.\ without |
| 294 |
numbering) chapter or section ``List of Figures", depending on |
| 295 |
your document type. However, if you define |
| 296 |
\verb+\figbibListHeader+ to be empty by including \verb+\def\figbibListHeader{}+ |
| 297 |
in your document, then no chapter/section is generated (while the |
| 298 |
list is still generated). |
| 299 |
|
| 300 |
\DescribeMacro{\fbListStyle} |
| 301 |
\DescribeMacro{\figbibhang} |
| 302 |
\DescribeMacro{\figbibsep} |
| 303 |
The layout of the List of Figures can be adjusted by redefining |
| 304 |
the style, the hang, and the separation space, e.g.\ |
| 305 |
\verb+\def\fbListStyle{\footnotesize}+, \verb+\setlength{\figbibhang}{5mm}+ and |
| 306 |
\verb+\setlength{\figbibsep}{1ex}+. |
| 307 |
|
| 308 |
\subsection{References} |
| 309 |
|
| 310 |
\DescribeMacro{\fbref} |
| 311 |
\DescribeMacro{\fbpageref} |
| 312 |
Use the commands \verb+\fbref+ and \verb+\fbrefpage+ to refer to |
| 313 |
figures. They generate complete references, not only numbers. For |
| 314 |
example, \verb+\fbref{Beatles:68}+ might create ``Fig.~14", and |
| 315 |
\verb+\fbpageref{Beatles:68}+ might generate ``p.~33". |
| 316 |
|
| 317 |
\subsection{Strings and Languages}\label{strings} |
| 318 |
|
| 319 |
\DescribeMacro{\figbibListHeader} |
| 320 |
\DescribeMacro{\figbibPage} |
| 321 |
\DescribeMacro{\figbibFig} |
| 322 |
\DescribeMacro{\figbibPlate} |
| 323 |
\DescribeMacro{\figbibFrom} |
| 324 |
\FigBib\ defines the following strings. |
| 325 |
|
| 326 |
\begin{tabular}{l l l} |
| 327 |
\emph{command} & \emph{description} & \emph{default}\\ |
| 328 |
\verb+\figbibListHeader+ & Header of the L.o.F. chapter/section & List of Figures\\ |
| 329 |
\verb+\figbibPage+ & string/abbreviation for ``page" & p.\\ |
| 330 |
\verb+\figbibFig+ & string/abbreviation for ``figure" & Fig.\\ |
| 331 |
\verb+\figbibPlate+ & string/abbreviation for ``plate" & Plate\\ |
| 332 |
\verb+\figbibFrom+ & string/abbreviation for ``from" & From\\ |
| 333 |
\end{tabular} |
| 334 |
|
| 335 |
You may redefine these strings, e.g.\ by |
| 336 |
\verb+\def\figbibFig{Abb.}+. Thus \FigBib\ can be adjusted to |
| 337 |
different \emph{languages}. As already mentioned, set |
| 338 |
\verb+\figbibListHeader+ to empty in order to prevent the List of Figures |
| 339 |
chapter/section from being generated (the list is still |
| 340 |
generated). |
| 341 |
|
| 342 |
\subsection{Options}\label{options} |
| 343 |
|
| 344 |
\FigBib can be controlled with a number of options. They are given |
| 345 |
at the \verb+\usepackage{figbib}+ command, e.g.\ by |
| 346 |
\begin{verbatim} |
| 347 |
\usepackage[center,nopages,xpart]{figbib} |
| 348 |
\end{verbatim} |
| 349 |
|
| 350 |
\DescribeMacro{center} |
| 351 |
\DescribeMacro{nopics} |
| 352 |
There are options controlling the \emph{figures}: |
| 353 |
|
| 354 |
\begin{tabular}{l l} |
| 355 |
\texttt{center} & Figures and captions are centered instead of left-aligned.\\ |
| 356 |
\texttt{nopics} & Pictures are \emph{not} included. This is for |
| 357 |
faster draft viewing. |
| 358 |
\end{tabular} |
| 359 |
|
| 360 |
\DescribeMacro{nopages} |
| 361 |
\DescribeMacro{nosource} |
| 362 |
\DescribeMacro{addcaption} |
| 363 |
\DescribeMacro{nocaption} |
| 364 |
\DescribeMacro{maincaption} |
| 365 |
There are options controlling the \emph{captions} and \emph{List |
| 366 |
of Figure entries}. If no options are given, the following default |
| 367 |
is used. The caption is set to the field \texttt{caption} if |
| 368 |
defined and \texttt{main} otherwise. The List of Figures entry is |
| 369 |
set to ``Fig.~[number] (p.~[page number])", followed by |
| 370 |
\texttt{main}, followed by \texttt{add} (if defined), followed by |
| 371 |
``From: \texttt{source}" (if defined). |
| 372 |
|
| 373 |
\begin{tabular}{l l} |
| 374 |
\texttt{nopages} & Page numbers are suppressed in the List of Figures.\\ |
| 375 |
\texttt{nosource} & Source is not given in List of Figures.\\ |
| 376 |
\texttt{addcaption} & \texttt{add} field is included to caption.\\ |
| 377 |
\texttt{nocaption} & No caption is generated at all, only figure number.\\ |
| 378 |
\texttt{maincaption} & \texttt{caption} field is not used. |
| 379 |
\end{tabular} |
| 380 |
|
| 381 |
\DescribeMacro{xpart} |
| 382 |
\DescribeMacro{xplate} |
| 383 |
There are options controlling the \emph{extra figure parts}: |
| 384 |
|
| 385 |
\begin{tabular}{l l} |
| 386 |
\texttt{xpart} & \texttt{fbFloat} environments are moved to extra figure part(s), see Sec. \ref{xpart}.\\ |
| 387 |
\texttt{xplate} & Figures in \texttt{fbFloat} environments are |
| 388 |
referred to as ``plates"\\ |
| 389 |
& instead of ``figures". |
| 390 |
\end{tabular} |
| 391 |
|
| 392 |
\DescribeMacro{german} |
| 393 |
The option \texttt{german} sets the strings defined in Section |
| 394 |
\ref{strings} to German language counterparts. Support of other |
| 395 |
languages is planned in the future. |
| 396 |
|
| 397 |
\subsection{\LaTeX-Macros in the figure database} |
| 398 |
|
| 399 |
Using \LaTeX-macros in the figure database entries (e.g.\ in the |
| 400 |
\texttt{main} field) generally causes problems. However, you can |
| 401 |
use the following macros: |
| 402 |
\begin{itemize} |
| 403 |
\item\verb+\"+, e.g.\ for German Umlaut characters |
| 404 |
\item\verb+~+ for spaces without line break |
| 405 |
\item\verb+\emph+ and \verb+\em+ for emphasized text |
| 406 |
\item\verb+\textit+ and \verb+\it+ for italics |
| 407 |
\item\verb+\textbf+ and \verb+\bf+ for bold face |
| 408 |
\item\verb+\textsc+ and \verb+\sc+ for small caps |
| 409 |
\item\verb+\texttt+ and \verb+\tt+ for typewriter font |
| 410 |
\end{itemize} |
| 411 |
If required, you can include further admissible macros by |
| 412 |
extending the definition of \verb+\figbib@noexpands+ in the |
| 413 |
\FigBib\ style file. |
| 414 |
|
| 415 |
\subsection{Extras} |
| 416 |
|
| 417 |
\DescribeMacro{fbForce} |
| 418 |
If you suppress pictures using the option \texttt{nopics}, you can |
| 419 |
still force \FigBib\ to include certain pictures. All you have to |
| 420 |
do is to surround the picture(s) by an \texttt{fbForce} |
| 421 |
environment, i.e. |
| 422 |
\begin{verbatim} |
| 423 |
\begin{fbForce} |
| 424 |
... |
| 425 |
\fbEpsfig{...} |
| 426 |
... |
| 427 |
\end{fbForce} |
| 428 |
\end{verbatim} |
| 429 |
|
| 430 |
\DescribeMacro{\FigBib} |
| 431 |
\verb+\FigBib+ produces the output \FigBib. |
| 432 |
|
| 433 |
\end{document} |