\documentclass{article} \usepackage{nonfloat} \def\filedate{1999/07/05} \def\fileversion{1.0} \title{ Nonfloating Tables and Figures\\ in \LaTeXe\\ --~nonfloat\thanks{This file is version number \fileversion\---last updated \filedate.}~~--} \author{ Kai Rascher\\ Am Remenhof 17a\\ D--38104 Braunschweig\\ {\tt rascher@ifn.ing.tu-bs.de}\thanks{English translation by Steve Peter. Note that German makes a distinction between an \textit{\"Uberschrift}, which appears above a table, and an \textit{Unterschrift} that appears below a figure. Both are called ``caption'' in English, but where the distinction is important, I also use ``supertitle'' for the former and ``subtitle'' for the latter.}} \date{Version~\fileversion} \begin{document} \maketitle \section{Summary} Placing figures and tables in \LaTeX\ documents always raises questions, especially when the figures and tables shouldn't float, or when captions are needed. Often, users try to achieve this through the use of the [h] parameter. But since the parameter is optional, and since \LaTeX\ isn't required to honor it, using [h] doesn't always put the table or figure quite where ``here'' is given. The \textsf{float} package provides one alternative. This package, which provides definitions for other floating objects such as program code or algorithms, offers [H] as an additional parameter. This does indeed place the floats ``here'' or at the beginning of the next page, but captions are limited to beneath the float. However, it is typographically correct for tables always to have their captions above the float. The \textsf{nonfloat} package follows the recommendations in \cite{epslatex,Reichert} and defines various \verb|\XXXcaption| commands for non-floating objects. Furthermore, adjustments via the placement parameters \verb|\textfraction|, \verb|\topfraction|, \verb|\bottomfraction| and \verb|\floatpagefraction| follow the specifications in \cite{epslatex}. Additionally, length declarations for placing floats on separate ``float pages'' have been adjusted so that vertical centering no longer occurs. Tables and figures are not in general centered, although a one-line \verb|\caption| entry is produced centered. The \textsf{nonfloat} package adopts customizations following \cite{Reichert2}. In so doing, the vertical spacing for table captions (supertitle) is determined in the same way as for figure captions (subtitle). From \cite{epslatex} the \verb|narrow| environment was adopted. Using this environment, you can set not only narrow text, but through the use of negative lengths, it is possible to have very wide figures, tables, etc., stick out in the margins. \section{Using the Package} \subsection{Loading Style Options} To use the commands in the \textsf{nonfloat} package, you must load it with the command: \vskip 6pt \verb|\usepackage{nonfloat}| \vskip 6pt \noindent after the declaration of your \verb|\documentclass|. \subsection{Commands} After the package is loaded, there are two commands, aside from \verb|\caption|, for creating descriptions of non-floating tables and figures. \vskip 1pc \begin{minipage}{\linewidth} \centering% \tabcaption{Commands for Table and Figure Captions}% \label{tab:Commands}% \begin{tabular}{*{2}{l}} Supertitle for non-floating tables & \verb|\tabcaption|\\ Subtitle for non-floating figures & \verb|\figcaption| \end{tabular} \end{minipage} \vskip 1pc The implementation also defines a command \verb|\topcaption|, which inserts the same vertical spacing between a supertitle and the object, as is inserted between an object and its subtitle (caption). The command \verb|\topcaption| is not needed within a \LaTeX\ document. The commands \verb|\tabcaption| and \verb|\figcaption| are based on the commands \verb|\topcaption| and \ \verb|\caption|. However, they are intended for use outside of the float environment. Examples are given below in section \ref{Examples}. \subsection{Adjusting the Placement Parameters} \tablename~\ref{tab:Placement} contains the newly defined values for the placement parameters as well as the previous \LaTeX\ default values. Furthermore, incompatabilities in recommended values are noted (\cite{epslatex}). \begin{minipage}{\linewidth} \centering% \tabcaption{Adjusting Parameters for Float Placement}% \label{tab:Placement}% \small \renewcommand{\arraystretch}{1.25} \begin{tabular}{@{}l*{2}{c}l@{}}\hline Name & Value & Default & Recommendation\\ \hline \verb|\textfraction| & 0.15 & 0.2 & $\verb|\textfraction| \ge 0.15$\\ \verb|\topfraction| & 0.85 & 0.7 & $\verb|\topfraction| \le 1-\verb|\textfraction|$\\ \verb|\bottomfraction| & 0.65 & 0.3 & $\verb|\bottomfraction| < \verb|\topfraction|$\\ & & & $\verb|\bottomfraction| \le 1-\verb|\textfraction|$\\ \verb|\floatpagefraction| & 0.60 & 0.5 & $\verb|\floatpagefraction| \le \verb|\topfraction|-0.05$\\ & & & $\verb|\floatpagefraction| \le 1-\verb|\textfraction|$\\ \hline \end{tabular} \end{minipage} \subsection{Adjusting the Table and Figure Environment} Within the \verb|table| and \verb|figure| environment the content is not set centered, although a one-line description is centered. Therefore, the environment has been redefined such that in addition the vertical spacing for table captions (supertitles) is handled analogously with the way figure captions (subtitles) are \cite{Reichert2}. \subsection{Adjusting Vertical Spacing on Float Pages} When floats are not placed within the text, but on extra float pages, \LaTeX\ centers the floats vertically. The new values given in \tablename~\ref{tab:Floatpages} prevent this. If additional floats are placed on the float page, the same vertical spacing as on other pages is applied. The previous default values are also given. \vskip 1pc \begin{minipage}{\linewidth} \centering% \tabcaption{Adjusting Vertical Spacing on Float Pages}% \label{tab:Floatpages}% \small% \renewcommand{\arraystretch}{1.25}% \begin{tabular}{@{}*{3}{l}@{}}\hline Name & New Value & Default Value\\ \hline \verb|\@fptop| & \verb|0pt| & \verb|0pt plus 1.0fil|\\ \verb|\@fpsep| & \verb|20pt plus 2pt minus 2pt| & \verb|8pt plus 2.0fil|\\ \verb|\@fpbot| & \verb|0pt| & \verb|0pt plus 1.0fil|\\ \hline \end{tabular} \end{minipage} \vskip 1pc \noindent\verb|fil| enables insertion of vertical glue, comparable to \verb|\vfill|. By applying \verb|fil| more than once, a proportional devision of whitespace can be achieved. Changes to the length parameters in \tablename~\ref{tab:Floatpages} made in a \LaTeX\ document must be wrapped with the commands \verb|\makeatletter| and \verb|\makeatother| so that \verb|@| is treated properly. \subsection{The \texttt{narrow} Environment} For setting very wide figures or tables, you can use the \verb|narrow| environment with negative lengths within or outside of floating objects. By using \pagebreak \begin{verbatim} \begin{narrow}{-1in}{0in} ... \end{narrow} \end{verbatim} \noindent the content of the \verb|narrow| environment will be set such that it sticks 1\,in into the left margin, and is right aligned. In order to encroach into the right margin, the second argument must also be negative. \subsection{Examples} \label{Examples} \subsubsection{Floating Table} \begin{verbatim} \begin{table}[htbp] \caption{Table Caption}% \label{tab:supertitle}% \begin{tabular}{...} ... \end{tabular} \end{table} \end{verbatim} \subsubsection{Floating Figure} \begin{verbatim} \begin{figure}[htbp] \includegraphics[width=0.8\linewidth,clip=]{input.eps}% \caption{Figure Caption}% \label{fig:input.eps}% \end{figure} \end{verbatim} \subsubsection{Non-Floating Table} \begin{verbatim} \\[\intextsep] \begin{minipage}{\linewidth} \centering% \tabcaption{Commands for Table and Figure Captions}% \label{tab:Commands}% \begin{tabular}{*{2}{l}} ... \end{tabular} \end{minipage} \\[\intextsep] \end{verbatim} The use of \verb|\\[\intextsep]| inserts the correct amount of vertical spacing, which is also used by accompanying objects. \pagebreak \subsubsection{Non-floating Figure} \begin{verbatim} \\[\intextsep] \begin{minipage}{\linewidth} \centering% \includegraphics[width=0.8\linewidth,clip=]{input.eps}% \figcaption{Figure Caption}% \label{fig:input.eps}% \end{minipage} \\[\intextsep] \end{verbatim} \begin{thebibliography}{99} \bibitem{epslatex} Reckdahl, Keith: \emph{Using Imported Graphics in \LaTeXe}, Version~2.0, 15.~December~1997. \bibitem{Reichert} Reichert, Axel: \hbox{\verb||} Usenet message ID \bibitem{Reichert2} Reichert, Axel: \hbox{\verb||} Usenet message ID \end{thebibliography} \end{document}