diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/endfloat/endfloat.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/endfloat/endfloat.dtx | 1611 |
1 files changed, 1016 insertions, 595 deletions
diff --git a/Master/texmf-dist/source/latex/endfloat/endfloat.dtx b/Master/texmf-dist/source/latex/endfloat/endfloat.dtx index a7ca418bf38..11f1d79f971 100644 --- a/Master/texmf-dist/source/latex/endfloat/endfloat.dtx +++ b/Master/texmf-dist/source/latex/endfloat/endfloat.dtx @@ -1,9 +1,9 @@ \def\filename{endfloat} -\def\fileversion{v2.4i} -\def\filedate{1995/10/11} -\def\docdate {1995/10/11} +\def\fileversion{v2.5b} +\def\filedate{2011/12/05} +\def\docdate{2011/12/05} % -% \CheckSum{596} +% \CheckSum{611} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -25,9 +25,10 @@ %% Description: LaTeX style to put figures and tables at end of article %% Keywords: LaTeX, style-option, float, figure, table %% Authors: James Darrell McCauley <jdm5548@diamond.tamu.edu>, -%% Jeff Goldberg <j.goldberg@cranfield.ac.uk> -%% Maintainer: Jeff Goldberg <J.Goldberg@Cranfield.ac.uk> -%% Latest Version: Version 2.4i <October 1995> +%% Jeff Goldberg <jeffrey@goldmark.org>, +%% Axel Sommerfeldt <axel.sommerfeldt@f-m.fm> +%% Maintainer: Jeff Goldberg <jeffrey@goldmark.org> +%% Latest Version: Version 2.5 <November 2011> % \fi % % \DoNotIndex{\documentclass,\usepackage,\hfuzz,\small,\tt,\begin,\end} @@ -59,23 +60,28 @@ % \newcommand*{\file}[1]{\texttt{#1}} % \newcommand*{\cls}[1]{\textsl{#1}} % \newcommand{\bs}{\texttt{\char'134}} +% \newcommand*\x{\discretionary{-}{}{}} % % \title{The \texttt{\filename} package\thanks{This file % has version number \fileversion, last % revised \filedate, documentation dated \docdate.}} % \author{James Darrell McCauley -% \and Jeff Goldberg\thanks{JPG (J.Goldberg@Cranfield.ac.uk) +% \and Jeff Goldberg\thanks{JPG (jeffrey@goldmark.org) % is responsible for all modifications % from version 2.1 upwards. Since there is almost no original code % left, he has claimed co-authorship from version 2.4. He is -% also the current maintainer.}} +% also the current maintainer.} +% \and Axel Sommerfeldt\thanks{Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% is responsible for all modifications +% from version 2.5 upwards.} +% } % % \date{\docdate} % % \maketitle % % \begin{abstract} -% The purpose of this style is to put all figures on pages by themselves +% The purpose of this package is to put all figures on pages by themselves % at the end of an article in a section named Figures. Likewise for tables. % Markers, like ``[Figure 3 about here]'' appear in the text (by default) % near where the figure (or table) would normally have occurred. @@ -106,6 +112,13 @@ % by me (jpg). Also, where you find spelling and typographical % errors, you are likely to be reading my text. % +% Axel Sommerfeldt has added a section about dealing with +% other floating environments than |figure| and |table|, and +% made adaptions to other sections affected by the +% changes of version 2.5. Furthermore he has added paragraphs +% about his \pkg{caption} package in section \ref{sec:removingcaptions} +% ``Removing captions''. +% % This documentation is long. Most users won't need to read beyond % the first few pages, but there are a number of ways to customize % the behavior of \pkg{endfloat} and these are detailed as the @@ -144,9 +157,9 @@ % \subsection{Loading} % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} % Just include the package in your preamble -% \begin{verbatim} -% \usepackage[...]{endfloat} -%\end{verbatim} +% \begin{quote} +% |\usepackage[|\ldots|]{endfloat}| +% \end{quote} % % Note that versions 2.1 and beyond will no longer work with % \LaTeX209. Get your administrator to upgrade your site @@ -173,9 +186,9 @@ % The floats are processed using |\baselinestretch{1}| irrespective % of what is used in the document as a whole. This can be % reset to, say 1.4, by using -% \begin{verbatim} -% \AtBeginDelayedFloats{\renewcommand{\baselinestretch}{1.4}} -%\end{verbatim} +% \begin{quote} +% |\AtBeginDelayedFloats{\renewcommand{\baselinestretch}{1.4}}| +% \end{quote} % which is available from version 2.4. See section~\ref{sec:hooks} % for more discussion. % @@ -191,9 +204,11 @@ % version.\footnote{I (jpg) very stupidly introduced a bug in version 2.2 % which wrecked |figure*|. It has been brought to my attention and % fixed. I offer my thanks and my apologies.} +% \iffalse % commented out by Axel Sommerfeldt since not true for version >= 2.4 % However, it must be noted that what actually gets processed at the % end is always with the star, since in single column mode the % |*| is harmless. +% \fi % % \subsection{Options} \label{sec:options} % @@ -223,12 +238,14 @@ % |notabhead| & on & & no `Tables' section header\\ % |noheads| & & |nofighead|, |notabhead| & neither of the headers\\ % |fighead| & off & & `Figures' section header\\ -% |tabhead| & off & & `tables' section header\\ +% |tabhead| & off & & `Tables' section header\\ % |heads| & & |fighead|, |tabhead| & Both section headers\\ % |markers| & on & & Place markers in the text\\ % |nomarkers| & off & & no markers in text\\ % |tablesfirst| & off & & Put tables before figures\\ % |figuresfirst| & on & & Put figures before tables\\ +% |tablesonly| & & & Disregard figures\\ +% |figuresonly| & & & Disregard tables\\ % \hline % \end{tabular} % \end{table} @@ -255,18 +272,28 @@ % % Normally the figures at the end appear before the tables. % This can be changed by using the option \texttt{tablesfirst}. -% The default is \texttt{figuresfirst}.\footnote{It is hoped that +% The default is \texttt{figuresfirst}. +% \iffalse % Commented out by Axel Sommerfeldt +% \footnote{It is hoped that % future versions will allow new kinds of float or environment % to be delayed, in which case an entirely new mechanism will % need to be introduced for ordering their appearance.} +% \fi +% +% If nothing else if specified, both figures and tables will be handled +% by the \pkg{endfloat} package. +% This can be altered by usage of the options |tables|\x|only| +% resp. |figures|\x|only|. % +% \medskip +% % A typical usage might be something like -% \begin{verbatim} -%\documentclass[a4paper,12pt]{article} -%\usepackage[nolists,tablesfirst]{endfloat} -%... -%\begin{document} -%\end{verbatim} +% \begin{quote} +% |\documentclass[a4paper,12pt]{article}|\\ +% |\usepackage[nolists,tablesfirst]{endfloat}|\\ +% \ldots\\ +% |\begin{document}| +% \end{quote} % which would suppress the list of tables and figures as well as % the corresponding section headers, and would have the tables % precede the figures. @@ -280,19 +307,25 @@ % can be overruled by explicitly stating the |nofighead| option. % % \begin{enumerate} +% \iffalse % commented out by Axel Sommerfeldt % \item \label{rule:default} % When two entirely conflicting options are both specified % the one corresponding to the default wins. % (e.g., if both |markers| and |nomarkers| are specified then % |markers| will be in effect). Here the notion of default is % determined by inspecting the second column of table~\ref{tab:options}. +% \fi % \item \label{rule:elsewhere} % When one option is more specific than the other the more specific % one holds true, and the more general will only partially hold. % So specifying \texttt{fighead} and \texttt{noheads} will be the % same as saying \texttt{fighead} and \texttt{notabhead}. % \item +% \iffalse % changed by Axel Sommerfeldt % The order in which the options appear is not relevant. +% \else +% The order in which the options appear is relevant. +% \fi % \item % If some of the obsolete commands for these options are used % all bets are off on these interactions. @@ -307,47 +340,45 @@ % R.Kappert@urc.kun.nl} % \DescribeMacro{\tableplace} % \DescribeMacro{\figureplace} +% \DescribeMacro{\floatplace} % Announcements in any language can be generated by -% using |\renewcommand| to redefine |\tableplace| and -% |\figureplace| +% using |\re|\x|new|\x|command| to redefine |\table|\x|place| and +% |\figure|\x|place|, or by redefining |\float|\x|place|. % % The defaults are % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% \begin{verbatim} -%\newcommand{\figureplace}{% -% \begin{center} -% [\figurename~\thepostfig\ about here.] -% \end{center}} -%\newcommand{\tableplace}{% -% \begin{center} -% [\tablename~\theposttbl\ about here.] -% \end{center}} -%\end{verbatim} +% \begin{quote} +% |\newcommand\figureplace{\floatplace{figure}}|\\ +% |\newcommand\tableplace{\floatplace{table}}|\\ +% \\ +% |\newcommand\floatplace[1]{%|\\ +% | \begin{center}|\\ +% | [\csname #1name\endcsname~\csname thepost#1\endcsname\ about here.]|\\ +% | \end{center}}| +% \end{quote} % % These redefinitions may be placed in the \file{endfloat.cfg} % file (see section~\ref{sec:extra} for more information). % -% WARNING! The name of the counters |posttbl| and |postfig| -% are very likely to change in future versions, possibly -% to |efloattttctr| and |efloatfffctr|, but whatever they -% change to, the names will be a function of either the -% file extension names |ttt| or |fff|, or the environment -% names |table| and |figure|. The purpose is so that the -% counters can be automatically created for new float types. +% WARNING! The name of the counters |post|\x|tbl| and |post|\x|fig| +% have been changed to |post|\x|table| and |post|\x|figure| in version 2.5. +% However, |\the|\x|post|\x|tbl| and |\the|\x|post|\x|fig| are still available for +% usage inside redefined versions of |\table|\x|place| and |\figure|\x|place| +% so old documents (hopefully) will still work. % % Hooks for the \texttt{babel} package are not (yet) provided, so % you will have to do things by hand: -% \begin{verbatim} -% \renewcommand{\figurename}{Abra} % if no babel -% \renewcommand{\figureplace}{% -% \begin{center} -% [A(z) \thepostfig.~\figurename itt legyen.] -% \end{center}} -%\end{verbatim} +% \begin{quote} +% |\renewcommand{\figurename}{Abra} % if no babel|\\ +% |\renewcommand{\figureplace}{%|\\ +% | \begin{center}|\\ +% | [A(z) \thepostfigure.~\figurename itt legyen.]|\\ +% | \end{center}}| +% \end{quote} % % If you wish to change the name of the figure or table section -% heading, you can to that in the usual way (via the \texttt{babel} -% package, or by redefining \verb"\figuresection" and \verb"tablesection" +% heading, you can do that in the usual way (via the \texttt{babel} +% package, or by redefining |\figure|\x|section| and |\table|\x|section| % directly). % % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} @@ -362,18 +393,18 @@ % \DescribeMacro{\AtBeginTables} % \DescribeMacro{\AtBeginDelayedFloats} % If you wish to have some more control over how the tables and figures -% are processed, you can make use of the commands |\AtBeginDelayedFloats|, -% |\AtBeginFigures| and -% |\AtBeginTables|. If you wanted to ensure that the tables begin +% are processed, you can make use of the commands |\At|\x|Begin|\x|Delayed|\x|Floats|, +% |\At|\x|Begin|\x|Figures| and +% |\At|\x|Begin|\x|Tables|. If you wanted to ensure that the tables begin % on a recto page, you could for example say something like -% |\AtBeginTables{\cleardoublepage}| in the preamble of your +% |\At|\x|Begin|\x|Tables{\clear|\x|double|\x|page}| in the preamble of your % document.\footnote{It is difficult for me to imagine a situation where % one would be using \pkg{endfloat} and the class option \texttt{twoside}, % without which \texttt{\bslash cleardoublepage} % is the same as \texttt{\bslash clearpage}, together. % Another, more realistic example would be to adjust the % \texttt{\bslash baselinestretch} for table and figure processing.} -% Material in |\AtBeginTables| and |\AtBeginFigures| is processed after +% Material in |\At|\x|Begin|\x|Tables| and |\At|\x|Begin|\x|Figures| is processed after % the list of tables or list of figures (if those options are set) and % just before the files with the delayed material in input. These are % also processed after the original definitions of the table and figure @@ -399,9 +430,9 @@ % \item If you use the |lists| option you will get a list of all % tables and figures in the document. Not just the ones for % the current chapter. Using lists may have other odd consequences. -% \item It is your responsibility to set |\tableplace| and -% |\figureplace| correctly, as well as to possibly reset -% the counters |\theposttbl| and |\thepostfig| (section~\ref{sec:language}) +% \item It is your responsibility to set |\table|\x|place| and +% |\figure|\x|place| correctly, as well as to possibly reset +% the counters |\the|\x|post|\x|table| and |\the|\x|post|\x|figure| (section~\ref{sec:language}) % as you wish. If you do not reset them, they will continue to % increase throughout the document. % \end{enumerate} @@ -415,9 +446,9 @@ % \verb"\renewcommand" to redefine \verb"\efloatseparator" as you wish. % One possibility, suggested by a user, % is -% \begin{verbatim} -% \renewcommand{\efloatseparator}{\mbox{}} -%\end{verbatim} +% \begin{quote} +% |\renewcommand{\efloatseparator}{\mbox{}}| +% \end{quote} % It makes most sense to place such a redefinition in the configuration % file (see section~\ref{sec:extra}). % @@ -442,7 +473,7 @@ % is found, it will be included after \pkg{endfloat} is loaded. % The purpose of this configuration file is to allow the user to % include additional definitions related to \pkg{endfloat}. -% For example, any redefinition of \verb"\figureplace" can +% For example, any redefinition of \verb"\floatplace" can % go in this file, so that the preamble does not need to % be filled with material that only makes sense when % \pkg{endfloat} is loaded.\footnote{However, if you find yourself @@ -458,47 +489,145 @@ % The configuration file can also provided % so that the user could specify environments other % than |figure| and |table| (and their |*|-ed counterparts) which can -% be delayed until the end of the document. At the moment that would +% be delayed until the end of the document. +% \iffalse % commented out by Axel Sommerfeldt +% At the moment that would % be very difficult to do with environments which are not processed with % tables of figures (ie, those environments that should have a different % ``list-of'', different counters, and different temporary files from % those used by tables and figures); but the plan is to make even that % ever more easier. +% \fi % % \subsection{Modified figures and tables} % % As stated in section~\ref{sec:envnames}, \pkg{endfloat} will % utterly fail if one does something like -% \begin{verbatim} -%\newenvironment{foo}{...\begin{table}...} -% {...\end{table}...} -%\end{verbatim} +% \begin{quote} +% |\newenvironment{foo}{...\begin{table}...}|\\ +% | {...\end{table}...}| +% \end{quote} % because \pkg{endfloat} will make |\begin{table}| go into a verbatim % like mode and look for the literal string |\end{table}|, which it % will not see in |\end{foo}|. % +% \iffalse % However, for those who know \LaTeX\ internals fairly well, it is % not impossible to tell \pkg{endfloat} to also treat the |foo| environment % as a delayed table. It is however, not easy, although my goal % is to make this easier in subsequent versions. It will take % a fair amount of understanding of the implementation to see how to % do this. And the best thing to do is to follow an example. +% \else +% However, inserting the following code into the document preamble +% may be worth a try: +% \begin{quote} +% |\DeclareDelayedFloatFlavor{foo}{table}| +% \end{quote} +% This tells the \pkg{endfloat} package that |foo| should be treated as |table|, +% at least from \pkg{endfloat}'s point of view. +% If you keep your fingers crossed this may actually work. +% \fi % -% \subsection{Sideways figures and tables} +% \subsection{Environments based on figures and tables} % % The \pkg{rotating} package\cite{RahBar:rotating} % contains definitions of environments -% |sidewaysfigure| and |sidewaystable|,\footnote{These -% require support from the dvi driver, such as \texttt{dvips}.} +% |side|\x|ways|\x|figure| and |side|\x|ways|\x|table|\footnote{These +% require support from the dvi driver, such as \texttt{dvips}.}, % and it would be nice to have these work in documents which also -% use \pkg{endfloat}. Appropriate redefinitions of these so that -% they work with \pkg{endfloat} +% use \pkg{endfloat}. +% \iffalse % changed by Axel Sommerfeldt +% \par +% Appropriate redefinitions of these so that they work with \pkg{endfloat} % are given in the file \file{efxmpl.cfg}. If you wish to use % that file, you should include it as a package (possibly renamed) % \emph{after} you include \pkg{endfloat}. Or you could simple rename -% it to \file{endfloat.cfg} and \pkg{endfloat} will include it automatically. -% +% it to \file{endfloat.cfg} and \pkg{endfloat} will include it automatically.\par % For a description of those commands see section~\ref{sec:config}. +% \else +% This can be archived with +% \begin{quote} +% |\DeclareDelayedFloatFlavor{sidewaysfigure}{figure}|\\ +% |\DeclareDelayedFloatFlavor{sidewaystable}{table}| +% \end{quote} +% after loading both, the \pkg{endfloat} and \pkg{rotating} package. +% The general syntax of |\Declare|\x|Delayed|\x|Float|\x|Flavor| is +% \begin{quote} +% |\DeclareDelayedFloatFlavo|(|u|)|r|\marg{environment}\marg{is a variant of} +% \end{quote} +% so for example +% \begin{quote} +% |\usepackage{endfloat,threeparttable}|\\ +% |\DeclareDelayedFloatFlavour{threeparttable}{table}| +% \end{quote} +% makes the |three|\x|part|\x|table| environment known to the \pkg{endfloat} package +% as a variant of the floating environment |table|. +% +% This works with the |long|\x|table| environment as well: +% \begin{quote} +% |\usepackage{endfloat,longtable}|\\ +% |\DeclareDelayedFloatFlavour*{longtable}{table}| +% \end{quote} +% Note that we use the starred variant of |\Declare|\x|Delayed|\x|Float|\x|Flavor| +% here which only redefines |long|\x|table| but leaves the unnumbered +% |long|\x|table*| intact. +% \fi +% +% \subsection{Other floating environments} +% +% By using |\new|\x|float| offered by the \pkg{float} package\cite{Lingnau:float}, +% or |\Declare|\x|New|\x|Float|\x|Type| offered by the \pkg{floatrow} package\cite{Lapko:floatrow}, +% or |\Declare|\x|Floating|\x|Environment| offered by the \pkg{newfloat} +% package\cite{Sommerfeldt:newfloat} +% one can define new floating environments. These environments +% can be made supported by the \pkg{endfloat} package, too, e.g. +% \begin{quote} +% |\usepackage{newfloat,endfloat}|\\ +% |\DeclareFloatingEnvironment{map}|\\ +% |\DeclareDelayedFloat{map}{Maps}| +% \end{quote} +% will define a new floating environment called ``map'' and +% set up the \pkg{endfloat} package to handle this environment, too. +% +% The trick is using the command +% \begin{quote} +% |\DeclareDelayedFloat|\marg{float}\oarg{file extension}\marg{heading} +% \end{quote} +% which makes the new floating environment known to the \pkg{endfloat} package. +% +% The \meta{file extension} specifies the file where the floating environments +% will be stored, like |fff| for figures and |ttt| for tables. +% If no \meta{file extension} is given, |ef|\meta{float} will be used, e.g. |efmap| +% will be used as file extension in the code example above. +% +% The \meta{heading} will be used for the section header, if selected. +% If |\list|\meta{float}|name| is not defined, it will be used for the list heading, too. +% +% The package options |nolists|, |lists|, |noheads|, and |heads| will be respected +% for new environments, too. But if you would like to set individual options for +% them, you can do so by using +% \begin{quote} +% |\SetupDelayedFloat|\marg{float}\marg{options} +% \end{quote} +% where options are |nolist|, |list|, |nohead|, and |head| analogous to the package +% options for figures and tables specified in section \ref{sec:options}. +% +% By the way, |\Setup|\x|Delayed|\x|Float| works for the environments |figure| and +% |table|, too, so +% \begin{quote} +% |\usepackage[nofiglist,fighead]{endfloat}| +% \end{quote} +% is identical to +% \begin{quote} +% |\usepackage{endfloat}|\\ +% |\SetupDelayedFloat{figure}{nolist,head}| +% \end{quote} +% and (if you prefer using key-value options instead) +% \begin{quote} +% |\usepackage{endfloat}|\\ +% |\SetupDelayedFloat{figure}{list=false,head=true}| +% \end{quote} % % \subsection[Changing list and caption appearance] % {Changing the appearence of ``lists of'' and captions} @@ -520,11 +649,28 @@ % using and non-\pkg{endfloat} using \LaTeX\ source documents is minimal. % % \subsubsection{Removing captions} +% \label{sec:removingcaptions} +% +% \DescribeMacro{\captionsetup} +% If you have included the \pkg{caption} package in your document +% you can omit the caption text by adding +% \begin{quote} +% |\captionsetup{labelsep=none,textformat=empty}| +% \end{quote} +% to the preamble of your document.~\footnote{% +% This needs at least version $3.2c$ of the \pkg{caption} package.} +% If this should be done for figures (or tables) only one can use the +% optional argument of |\caption|\x|setup|, e.g.: +% \begin{quote} +% |\captionsetup[figure]{labelsep=none,textformat=empty}| +% \end{quote} +% See \pkg{caption} package documentation for details and alternatives. % % \DescribeMacro{\@makecaption} -% The simplest thing is to provide a simple redefinition of |\@makecaption|. -% You should model your redefinition after the one described in -% \file{classes.dtx} for your release of \LaTeX\ instead of blindly +% If the \pkg{caption} package is not used, the simplest thing +% is to provide a redefinition of |\@makecaption|. +% You should model your redefinition after the one used in the +% document class you actually use instead of blindly % following what is here. |\@makecaption| takes two arguments, the % first will be something like ``figure 3'' and the second will % be the caption text. We will simply ignore the second argument. @@ -536,26 +682,37 @@ % very narrow \texttt{\bs textwidth}, % then you will have to use a more complicated version.} % Your redefinition of |\@makecaption| may look like -% \begin{verbatim} -%\renewcommand{\@makecaption}[2]{% -% \vskip\abovecaptionskip -% \hbox to \hsize{\hfil #1\hfil}% -% \vskip\belowcaptionskip} -%\end{verbatim} +% \begin{quote} +% |\renewcommand{\@makecaption}[2]{%|\\ +% | \vskip\abovecaptionskip|\\ +% | \hbox to \hsize{\hfil #1\hfil}%|\\ +% | \vskip\belowcaptionskip}| +% \end{quote} % % \DescribeMacro{\caption} % This still leaves one problem. If you use -% \begin{verse}\ttfamily -% \bs caption[\textit{short caption text}]\{\textit{full caption text}\} -%\end{verse} +% \begin{quote}\ttfamily +% |\caption|\oarg{short caption text}\marg{full caption text} +% \end{quote} % only the short caption text will ever appear in the list of tables or % figures. The following redefinition of |\caption| will take care of % that. +% +% Again, first of all a solution for usage with the \pkg{caption} package:~\footnote{% +% This needs at least version $3.2f$ of the \pkg{caption} package.} +% \begin{quote} +% |\captionsetup{list-entry=heading}| +% \end{quote} +% +% If the \pkg{caption} package is not used, +% the following code should be used instead: +% \iffalse % First save the original definition of |\caption| -% \begin{verbatim} -% \let\OrigCaption\caption -% \renewcommand{\caption}[2][X]{\OrigCaption[#2]{}} -%\end{verbatim} +% \fi +% \begin{quote} +% |\let\OrigCaption\caption|\\ +% |\renewcommand{\caption}[2][X]{\OrigCaption[#2]{}}| +% \end{quote} % % \subsubsection{Eliminating numbers from lists of tables and figures} % @@ -574,24 +731,24 @@ % The real only trick here is that |\l@figure| is defined to take % two arguments, but the second is never used. The way it will be % called will give it something like -% \begin{verbatim} -% {\numberline {3} Caption of that figure}{85} -%\end{verbatim} +% \begin{quote} +% |{\numberline {3} Caption of that figure}{85}| +% \end{quote} % as arguments, where the second argument is the page number. % The |\numberline| command will make use of the \LaTeX\ register % |\@tempdima| for the width of the box containing the table % or figure number. So we need to set that. % The rest is pretty unsophisticated. You can, of course, modify it % at will. -%\begin{verbatim} -%\renewcommand*{\l@figure}[2]{% -% \setlength\@tempdima{2.3em}% -% \noindent\hspace*{1.5em}#1\hfil\newline } -%\end{verbatim} +% \begin{quote} +% |\renewcommand*{\l@figure}[2]{%|\\ +% | \setlength\@tempdima{2.3em}%|\\ +% | \noindent\hspace*{1.5em}#1\hfil\newline }| +% \end{quote} % And for tables: -% \begin{verbatim} -%\let\l@table\l@figure -%\end{verbatim} +% \begin{quote} +% |\let\l@table\l@figure| +% \end{quote} % \end{macro} % \end{macro} % @@ -614,9 +771,9 @@ % % When floats are being read, \LaTeX\ is in verbatim mode. Among % other things, this means that the lines like -% \begin{verbatim} -%\end{figure} -%\end{verbatim} +% \begin{quote} +% |\end{figure}| +% \end{quote} % must appear on lines by themselves without any whitespace before % or after them. A complete reimplementation of the most difficult % part of the package is required to fix this limitation, but @@ -634,9 +791,9 @@ % names be used. That is, you cannot simply define a new environment which % calls \texttt{figure} or \texttt{table} since the former must % look for the literal string -% \begin{verbatim} -% \end{figure} -%\end{verbatim} +% \begin{quote} +% |\end{figure}| +% \end{quote} % in the document, while doing no expansion of control sequences. % The latter does the same, but wants |table| instead of % |figure|. This caution generally applies to all `verbatim-like' @@ -652,6 +809,7 @@ % what I have done for \verb"\sidewaystable" in the sample configuration % file (section~\ref{sec:extra}). % +% \iffalse % commented out by Axel Sommerfeldt % Steps are slowly being taken to allow for new delayed environments % to be added. That will be version~3, but I (jpg) still have % a long way to go to get there. Each new minor release of @@ -665,6 +823,7 @@ % word ``float'' may not be the best expression, since there will % be no reason to expect that only floating environments are % delayed. +% \fi % % \subsection{The Environment's environment}\label{sec:envenv} % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} @@ -674,25 +833,25 @@ % processed at the end of the document, it will be the state of % \TeX\ at the end which will matter. For example, a document % with something like -% \begin{verbatim} -% \newcommand{\XXX}{YYY} -% ... -% \begin{table} -% ... -% ... \XXX ... -% ... -% \end{table} -% ... -% \renewcommand{\XXX}{ZZZ} -% ... -% \end{document} -%\end{verbatim} +% \begin{quote} +% |\newcommand{\XXX}{YYY}|\\ +% \ldots\\ +% |\begin{table}|\\ +% \ldots\\ +% \ldots |\XXX| \ldots\\ +% \ldots\\ +% |\end{table}|\\ +% \ldots\\ +% |\renewcommand{\XXX}{ZZZ}|\\ +% \ldots\\ +% |\end{document}| +% \end{quote} % will process the table with |\XXX| expanding to |ZZZ|. % % In any particular instance, the user can use either re-redefine % |\XXX| before the end of document, or can re-redefine it using -% on of the hooks, |\AtBeginDelayedFloats|, |\AtBeginTables|, or -% |\AtBeginFigures|, which are discussed in section~\ref{sec:hooks}. +% on of the hooks, |\At|\x|Begin|\x|Delayed|\x|Floats|, |\At|\x|Begin|\x|Tables|, +% or |\At|\x|Begin|\x|Figures|, which are discussed in section~\ref{sec:hooks}. % % \subsection{Verbatim in delayed floats}\label{sec:verbatim} % @@ -733,6 +892,7 @@ % \changes{v2.1}{1994/06/25}{Use AtEndDocument. jpg} % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} +% % \subsubsection{General ordering and wish list}\label{sec:order} % % I believe that the output of a \LaTeXe\ run should be independent @@ -743,11 +903,11 @@ % like |\ExecuteAtEndDocument| would be called by the user after % all such packages are loaded, with tags for each thing in the % packages, so something like -% \begin{verbatim} -% \usepackage{lastpage} -% \usepackage{endfloat,xyzzy} -% \ExecuteAtEndDocument{endfloat,xyzzy,lastpage} -%\end{verbatim} +% \begin{quote} +% |\usepackage{lastpage}|\\ +% |\usepackage{endfloat,xyzzy}|\\ +% |\ExecuteAtEndDocument{endfloat,xyzzy,lastpage}| +% \end{quote} % and the order of End Document material would be the \pkg{endfloat} % material, followed by \textsf{xyzzy}, and finally by \pkg{lastpage}. % The package \pkg{xyzzy} is fictitious, while the @@ -759,7 +919,7 @@ % to comply with it. Until then % I will include a message % which begins with \texttt{AED} -% in every usage of |\AtEndDocument|, and try to minimize any side +% in every usage of |\At|\x|End|\x|Document|, and try to minimize any side % effects my usage may have. % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % @@ -768,7 +928,7 @@ % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % % One option is to not have packages like \pkg{endfloat} actually call -% |\AtEndDocument|, but merely define a user level command which +% |\At|\x|End|\x|Document|, but merely define a user level command which % would make the call itself. This way, the order of those particular % commands would matter, but not the ordering of the package loading. % @@ -862,22 +1022,30 @@ % % \begin{itemize} % \item |\listoftables| and |\listoffigurers| are left undefined -% in class \cls{elsart}. But this is because Elsevier does -% not want those lists. Elsevier, bless them, does not want -% floats at the end for submissions to its journals. So -% there is no reason to use \pkg{endfloat} (with or without lists) -% with class \cls{elsart}. Let's hope that other publishers -% will follow Elsevier's lead in understanding that the -% submission rules which were created were created for a reason, -% and when those reasons no longer apply, the rules should be changed. -% -% I look forward to the day when \pkg{endfloat} will serve -% no purpose. +% in class \cls{elsart}. But this is because Elsevier does +% not want those lists. Elsevier, bless them, does not want +% floats at the end for submissions to its journals. So +% there is no reason to use \pkg{endfloat} (with or without lists) +% with class \cls{elsart}. Let's hope that other publishers +% will follow Elsevier's lead in understanding that the +% submission rules which were created were created for a reason, +% and when those reasons no longer apply, the rules should be changed. +% +% I look forward to the day when \pkg{endfloat} will serve +% no purpose. % % \item The \pkg{float} package appears to work in my limited tests. -% Although, only tables and figures get moved to end. -% The success is due to the robustness with which \pkg{float} -% is written. +% \iffalse % commented out by Axel Sommerfeldt +% Although, only tables and figures get moved to end. +% The success is due to the robustness with which \pkg{float} +% is written. +% \fi +% +% \item The \pkg{floatrow} package appears to work in my limited tests. +% But please note that the \pkg{endfloat} package needs to be loaded +% \emph{after} the \pkg{floatrow} package. +% +% \item The \pkg{newfloat} package appears to work in my limited tests, too. % % \end{itemize} % @@ -890,7 +1058,7 @@ % do what you want. If something goes wrong look over % section~\ref{sec:caveats}. But if you need to get in touch % with the maintainer, you should send email to me at -% \texttt{J.Goldberg@Cranfield.ac.uk}. +% \texttt{jeffrey@goldmark.org}. % % \section{History}\label{sec:history} % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} @@ -918,11 +1086,50 @@ % guts are adapted from % \texttt{comment.sty} by Victor Eijkhout (eijkhout@csrd.uiuc.edu). % So, although Jeff -% Goldberg (J.Goldberg@Cranfield.ac.uk) now maintains this, he should not +% Goldberg (jeffrey@goldmark.org) now maintains this, he should not % be credited with writing the package, but only with extending and % maintaining it. He has contributed enough so that by version~2.4 % he claimed co-authorship. % +% \subsection{Version 2.5} +% +% Version 2.5 was build by Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% with permission of Jeff Goldberg, and introduces the following changes: +% \begin{itemize} +% \item +% New commands +% |\Declare|\x|Delayed|\x|Float| and |\Declare|\x|Delayed|\x|Float|\x|Flavor| +% for handling floating environments other than |figure| and |table|, +% and |\Setup|\x|Delayed|\x|Float| for setting options. +% To make this possible a lot of internal code had to be reorganized, +% but by trying to keep original versions of macros and trying to leave the +% operational sequence itself as original as possible this hopefully won't break +% compatibility with existing documents or extensions written for the +% \pkg{endfloat} package. +% +% \item +% New package options |tables|\x|only| and |figures|\x|only| have been added +% to allow better control over which floating environments +% will be handled by the \pkg{endfloat} package. +% +% \item +% The \pkg{endfloat} package should cooperate with +% the \pkg{floatrow} package now, at least if you load it \emph{after} +% the \pkg{floatrow} package. +% +% \item +% Older versions of the \pkg{endfloat} package used to process |figure| and +% |table| as starred variant always, but at least version $2.4$ did not. +% It had stored all of them as starred variant into the temporary files, but had +% processed them as non-starred always. +% To make this more consistent the version $2.5$ does store the environments +% as they are now, and processes them the same way, i.e.~non-starred +% variants will be stored and processed as non-starred, and starred variants +% will be stored and processed as starred. +% \end{itemize} +% If you notice a change in behaviour after updating the \pkg{endfloat} +% package to version 2.5, please contact me (Axel) and I'll try to fix this. +% % \subsection{Version 2.4} % % Version 2.4 involves the largest set of additional features @@ -932,9 +1139,9 @@ % % \item % This version adds various user hooks, both as commands: -% |\AtBeginFigures|, |\AtBeginTables|, and -% |\AtBeginDelayedFloats| (section~\ref{sec:hooks}), -% and |\efloatseparator| (section~\ref{sec:separator}). +% |\At|\x|Begin|\x|Figures|, |\At|\x|Begin|\x|Tables|, and +% |\At|\x|Begin|\x|Delayed|\x|Floats| (section~\ref{sec:hooks}), +% and |\efloat|\x|separator| (section~\ref{sec:separator}). % % \item % Most importantly, there is the addition of a configuration file @@ -1096,14 +1303,15 @@ % \section{Wish list} % % I doubt that I will really work on this wish list in the near future -% but in addition to solving the know bugs, there are two major sorts of -% changes that I (jpg) would like to see. -% \begin{enumerate} +% but in addition to solving the know bugs, there is one major sort of +% change that I (jpg) would like to see: +% \begin{itemize} % \item % Updating the verbatim writing by using the tools in the % |verbatim| standard packages, and the |moreverb| package. % Since they provide more generalized an cleaner verbatim code % then this which dates back to the earliest days of \LaTeX. +% \iffalse % commented out by Axel Sommerfeldt % \item % Integrate with the |float| package which (among other things) % enables the user to define new floating environments. @@ -1111,7 +1319,8 @@ % the end, not all types of potential floats. Nor does it allow % the user to specify which of the two types it does recognize % to be placed at the end. -% \end{enumerate} +% \fi +% \end{itemize} % % \begin{thebibliography}{1} % @@ -1134,7 +1343,19 @@ % \bibitem{Lingnau:float} % Anselm Lingnau. % \newblock An Improved Environment for Floats -% \newblock June 1994 (version~1.2) +% \newblock August 2001 (version~1.3) +% \newblock Electronic Documentation +% +% \bibitem{Lapko:floatrow} +% Olga Lapko. +% \newblock The floatrow package +% \newblock August 2009 (version~0.3) +% \newblock Electronic Documentation +% +% \bibitem{Sommerfeldt:newfloat} +% Axel Sommerfeldt. +% \newblock The newfloat package +% \newblock November 2011 (version~1.0) % \newblock Electronic Documentation % % \bibitem{RahBar:rotating} @@ -1145,6 +1366,7 @@ % \end{thebibliography} % %\StopEventually{\PrintIndex\PrintChanges} +% \clearpage % % \section{The documentation driver file} % @@ -1159,9 +1381,9 @@ \setlength\hfuzz{2pt} % ignore small overfulls \CodelineIndex \EnableCrossrefs -%\DisableCrossrefs % Say \DisableCrossrefs if index is ready -%\RecordChanges % Gather update information -%\OnlyDescription % comment out for implementation details + %\DisableCrossrefs % Say \DisableCrossrefs if index is ready + %\RecordChanges % Gather update information + %\OnlyDescription % comment out for implementation details \begin{document} \DocInput{endfloat.dtx} \end{document} @@ -1171,6 +1393,7 @@ % % \section{The implementation} % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} +% % \subsection{File and package identification} % % We start by checking if this file was already loaded. If not we @@ -1185,7 +1408,6 @@ % \changes{v2.1}{1994/06/25}{Use LaTeX2e package form. jpg} % % \subsection{How it was written} -% % [this subsection mostly based on jdm's original text.] % % Overview: redefine the figure and table environment following @@ -1206,133 +1428,106 @@ % and Brian Junker (see change log below). \emph{Thanks guys!} % % \subsection{Define warning message} +% % Since I, JPG, am making the commands options, I want to warn users % to use the options, since these commands should be discontinued % in future versions. +% % \begin{macrocode} -\newcommand{\ef@OldCmd}[2]{\PackageWarning{endfloat} +\newcommand{\ef@OldCmd}[2]{\PackageWarning{endfloat}% {The command \protect#1 is obsolete and will be\MessageBreak omitted from future releases of the endfloat package.\MessageBreak Use the package option `#2' instead.}} % \end{macrocode} +% % \subsection{Flags} +% % Put all of the newifs for the user options and flags here. +% Note that these are global flags only, +% the ones bound to a specific environment will be defined +% inside |\Declare|\x|Delayed|\x|Float| instead. +% +% I (as) have added the definition of |\Setup|\x|Delayed|\x|Float| +% here in version 2.5. +% % \begin{macrocode} \newif\if@domarkers -\newif\if@tablist % bj \newif\if@figlist % bj -\newif\if@tabhead \newif\if@fighead \newif\if@tablesfirst +\newif\ifefloat@figures % as +\newif\ifefloat@tables % as % \end{macrocode} % % \subsubsection{Default values} -% Set default values of all of the flags here. +% +% Set default values of all of the (global) flags here. +% % \begin{macrocode} \@domarkerstrue -\@tablisttrue -\@figlisttrue -\@tabheadfalse +\@figlisttrue % bj \@figheadfalse \@tablesfirstfalse +\efloat@figurestrue % as +\efloat@tablestrue % as % \end{macrocode} % -% \begin{macro}{\markersintext} -% \begin{macro}{\nomarkersintext} -% First set up flags and defaults. First set for flagging -% whether markers appear in text. -% \changes{v1.99}{1992/05/27}{extensive changes by bj} -% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% \changes{v2.2a}{1994/10/07}{Create new options} +% \begin{macro}{\SetupDelayedFloat} +% \changes{v2.5}{2011/11/26}{This command added. as} +% While global flags will be set using package options, +% environment specific flags will be set with |\Setup|\x|Delayed|\x|Float|. % \begin{macrocode} -\DeclareOption{nomarkers}{\@domarkersfalse } -\DeclareOption{markers}{\@domarkerstrue } +\RequirePackage{keyval} % \end{macrocode} % \begin{macrocode} -\newcommand{\markersintext}{\@domarkerstrue - \ef@OldCmd{\markersintext}{markers}} -\newcommand{\nomarkersintext}{\@domarkersfalse - \ef@OldCmd{\nomarkersintext}{nomarkers}} +\newcommand*\SetupDelayedFloat[2]{% + \def\efloat@type{#1}% + \setkeys{endfloat}{#2}} % \end{macrocode} -% -% \end{macro} -% \end{macro} -% \begin{macro}{\dotablist} -% \begin{macro}{\notablist} -% Options for creating lists of Tables \ldots -% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} -% \changes{v1.99}{1992/05/27}{extensive changes by bj} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% % \begin{macrocode} -\newcommand{\dotablist}{\@tablisttrue \ef@OldCmd{\dotablist}{tablist}} -\newcommand{\notablist}{\@tablistfalse \@tabheadtrue - \ef@OldCmd{\notablist}{notablist}} +\define@key{endfloat}{list}[true]{\efloat@setkey{list}{#1}} +\define@key{endfloat}{nolist}[]{\efloat@setkey{list}{false}} +\define@key{endfloat}{head}[true]{\efloat@setkey{head}{#1}} +\define@key{endfloat}{nohead}[]{\efloat@setkey{head}{false}} % \end{macrocode} -% \end{macro} -% \end{macro} -% \begin{macro}{\dofiglist} -% \begin{macro}{\nofiglist} -% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} -% \changes{v1.99}{1992/05/27}{extensive changes by bj} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% \ldots and Figures % \begin{macrocode} -\newcommand{\dofiglist}{\@figlisttrue \ef@OldCmd{\dofiglist}{figlist}} -\newcommand{\nofiglist}{\@figlistfalse \@figheadtrue - \ef@OldCmd{\nofiglist}{nofiglist}} +\newcommand*\efloat@setkey{% + \@expandtwoargs\efloat@@setkey\efloat@type} +\newcommand*\efloat@@setkey[3]{% + \@ifundefined{ef@ext@#1}% + {\PackageError{endfloat}% + {Unknown environment `#1'}% + {Only environments known to the `endfloat' package are allowed here.}}% + {\efloat@setflag{#1#2}{#3}}} % \end{macrocode} % \end{macro} -% \end{macro} % -% Now we make options |tablist| and |notablist| and |figlist| and -% |nofiglist|. Note that options will be processed in order of -% the |\DeclareOption| commands in this file. So by placing -% |list| after |nolist| we ensure that if both are specified, |list| -% is in effect. -% -% First two new options +% \begin{macro}{\efloat@ifflag} +% |\efloat@ifflag|\marg{flag}\marg{yes-code}\marg{no-code} +% tests if a flag has been set. +% \changes{v2.5a}{2011/12/04}{This macro added. as} % \begin{macrocode} -\DeclareOption{nolists}{\@tablistfalse \@figlistfalse } -\DeclareOption{lists}{\@tablisttrue \@figlisttrue } +\newcommand*\efloat@ifflag[1]{% + \@nameuse{ef@if@#1}} % \end{macrocode} -% Now the more specific ones, which must come after the more -% general options to get the right interactions between semi-conflicting -% options. -% \begin{macrocode} -\DeclareOption{notablist}{\@tablistfalse } -\DeclareOption{nofiglist}{\@figlistfalse } -\DeclareOption{tablist}{\@tablisttrue } -\DeclareOption{figlist}{\@figlisttrue } -% \end{macrocode} -% -% The \texttt{notablist} and \texttt{nofiglist} options still leave -% a section header at the beginning of the tables and figures. +% \end{macro} % -% Note again the role that order plays, by placing |fighead| after -% |noheads| it ensures that |fighead| will be in effect if both -% are specified. -% \begin{macrocode} -\DeclareOption{heads}{\@figheadtrue \@tabheadtrue } -\DeclareOption{noheads}{\@figheadfalse \@tabheadfalse } -\DeclareOption{fighead}{\@figheadtrue } -\DeclareOption{tabhead}{\@tabheadtrue } -\DeclareOption{nofighead}{\@figheadfalse } -\DeclareOption{notabhead}{\@tabheadfalse } -% \end{macrocode} -% Also need option for putting tables first +% \begin{macro}{\efloat@setflag} +% |\efloat@setflag|\marg{flag}\marg{value} +% sets a flag to the given boolean value. +% \changes{v2.5a}{2011/12/04}{This macro added. as} % \begin{macrocode} -\DeclareOption{tablesfirst}{\@tablesfirsttrue } -\DeclareOption{figuresfirst}{\@tablesfirstfalse } -% \end{macrocode} -% Other option stuff -% \begin{macrocode} -\DeclareOption*{% - \PackageWarning{endfloat}{Unknown option `\CurrentOption'}} -\ProcessOptions +\newcommand*\efloat@setflag[2]{% + \@nameuse{if#2}% + \global\expandafter\let\csname ef@if@#1\endcsname\@firstoftwo + \else + \global\expandafter\let\csname ef@if@#1\endcsname\@secondoftwo + \fi}% % \end{macrocode} +% \end{macro} +% % \subsection{Other preliminaries} +% % I (jpg) have been slowly working at making more and more of the % code for processing tables and figures common, with the idea % that once I have factored out all that is common with them @@ -1340,51 +1535,51 @@ % I have still a very long way to go, but common code created % for version 2.3 is here. % -% \begin{macro}{\efloat@openpost} +% I (as) have added the definition of |\Declare|\x|Delayed|\x|Float| +% and |\Declare|\x|Delayed|\x|Float|\x|Flavor| here in version 2.5. +% % \begin{macro}{\efloat@newwrite} % attempt to reduce old |\@openpostfigs| and |\@openposttbls| to % one command % The first one calls |\newwrite| so, |\efloat@newwrite{ttt}| % will have the effect of |\newwrite\efloat@postttt|. % \begin{macrocode} -\def\efloat@newwrite#1{% +\newcommand*\efloat@newwrite[1]{% \expandafter\newwrite\csname efloat@post#1\endcsname} % \end{macrocode} % \end{macro} +% +% \begin{macro}{\efloat@openpost} % |\efloat@openpost{ttt}| will be the same as -% \begin{verbatim} -% \immediate\openout\efloat@postttt=\jobname.ttt\relax -%\end{verbatim} -% while also calling |\ef@setct{ttt}{1}| to set a flag +% \begin{quote} +% |\immediate\openout\efloat@postttt=\jobname.ttt\relax| +% \end{quote} +% while also calling |\efloat@setflag{ttt}{true}| to set a flag % (|@ef@tttopen|) in the case of |ttt|. +% \changes{v2.5a}{2011/12/04}{\cs{ef@setct} replaced by \cs{efloat@setflag}. as} % \begin{macrocode} -\def\efloat@openpost#1{\expandafter\immediate\expandafter\openout +\newcommand*\efloat@openpost[1]{% + \expandafter\immediate\expandafter\openout \csname efloat@post#1\endcsname =\jobname.#1\relax - \ef@setct{#1}{1} + \efloat@setflag{#1open}{true}% \message{(\jobname.#1)}} % \end{macrocode} -% \begin{macro}{\ef@setct} -% \begin{macro}{\ef@newct} -% |\ef@newct{ttt}| will create a new counter called |\@ef@tttopen| -% and |\ef@setct{ttt}{1}| would set it to 1. -% \begin{macrocode} -\def\ef@newct#1{% - \expandafter \newcount \csname @ef@#1open\endcsname} -\def\ef@setct#1#2{\expandafter\global\csname @ef@#1open\endcsname=#2\relax} -% \end{macrocode} -% \end{macro} % \end{macro} +% +% \begin{macro}{\efloat@condopen} % Conditionally open a file +% \changes{v2.5a}{2011/12/04}{\cs{ifnum} replaced by \cs{efloat@ifflag}. as} % \begin{macrocode} -\def\efloat@condopen#1{% - \expandafter\ifnum \csname @ef@#1open\endcsname>0 \relax \else - \efloat@openpost{#1}\fi} +\newcommand*\efloat@condopen[1]{% + \efloat@ifflag{#1open}{}{\efloat@openpost{#1}}} % \end{macrocode} +% \end{macro} +% +% \begin{macro}{\efloat@iwrite} % Immediate write to one of these files. % \begin{macrocode} -\def\efloat@iwrite#1#2{% - \expandafter\immediate\expandafter\write\csname efloat@post#1\endcsname - {#2}} +\newcommand\efloat@iwrite[1]{% + \expandafter\immediate\expandafter\write\csname efloat@post#1\endcsname} % \end{macrocode} % \end{macro} % @@ -1399,78 +1594,392 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\postfig} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% Counters -% \changes{v1.99}{1992/05/27}{extensive changes by bj} +% \begin{macro}{\ef@makeinnocent} % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} +% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % \begin{macrocode} -\newcounter{postfig} +\newcommand*{\ef@makeinnocent}[1]{\catcode`#1=12 } % \end{macrocode} % \end{macro} % -% Code for opening the |\jobname.fff| +% \begin{macro}{\figurename} +% \begin{macro}{\tablename} +% Make sure that |\tablename| and |\figurename| are defined. % \begin{macrocode} -\efloat@newwrite{fff} -\ef@newct{fff} +\providecommand{\figurename}{Figure} +\providecommand{\tablename}{Table} % \end{macrocode} -% \begin{macro}{\posttbl} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\floatplace} +% Place marker. +% \changes{v1.0b}{1992/03/10}{adaptation for LaTeX 2.09 and +% international namegiving by Ronald Kappert +% R.Kappert@urc.kun.nl} % \changes{v1.99}{1992/05/27}{extensive changes by bj} % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} -% \changes{v2.3c}{1995/03/08}{Remove some tbl specific stuff -jpg} -% Same stuff but for tables -% \begin{macrocode} -\newcounter{posttbl} +% \changes{v2.5}{2011/11/26}{universalized by as} +% \begin{macrocode} +\newcommand{\floatplace}[1]{% + \begin{center} + [\csname #1name\endcsname~\csname thepost#1\endcsname\ about here.] + \end{center}} % \end{macrocode} % \end{macro} % -% Commands for opening |\jobname.ttt| -% This sets up new write for tables +% \begin{macro}{\DeclareDelayedFloat} +% This one prepares the given environment for cooperation with the \pkg{endfloat} +% package, i.e.~|figure| resp.~|table|. +% \changes{v2.5}{2011/11/26}{This command added. as} +% \changes{v2.5a}{2011/12/04}{\cs{ef@newct} replaced by \cs{efloat@setflag}. as} +% \changes{v2.5b}{2011/12/05}{Starred variant added. as} % \begin{macrocode} -\efloat@newwrite{ttt} -\ef@newct{ttt} +\newcommand*\DeclareDelayedFloat{% + \@ifstar{\efloat@declare{*}}{\efloat@declare{}}} +\@onlypreamble\DeclareDelayedFloat % \end{macrocode} -% \begin{macro}{\ef@makeinnocent} +% \begin{macrocode} +\newcommand*\efloat@declare[2]{% + \@testopt{\efloat@@declare{#1}{#2}}{ef#2}} +\@onlypreamble\efloat@declare +% \end{macrocode} +% \begin{macrocode} +\def\efloat@@declare#1#2[#3]#4{% +% \end{macrocode} +% Flags: Set default values of all of the flags here. +% \begin{macrocode} + \efloat@setflag{#2list}{@figlist}% + \efloat@setflag{#2head}{@fighead}% +% \end{macrocode} +% Counters +% \changes{v1.99}{1992/05/27}{extensive changes by bj} % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % \begin{macrocode} -\newcommand*{\ef@makeinnocent}[1]{\catcode`#1=12 } + \newcounter{post#2}% +% \end{macrocode} +% Remember the file extension in |\ef@ext@|\meta{environment}. +% \begin{macrocode} + \edef\@tempa{#3}% + \edef\@tempb{\@nameuse{ext@#2}}% + \ifx\@tempa\@tempb + \PackageError{endfloat}% + {File extension `\@tempa' is already used by the List}% + {Try using a different file extension here, e.g. `ef\expandafter\@gobbletwo\@tempa'.}% + \else + \expandafter\let\csname ef@ext@#2\endcsname\@tempa + \fi +% \end{macrocode} +% Code for opening the |\jobname.fff| +% \begin{macrocode} + \efloat@newwrite{#3}% + \efloat@setflag{#3open}{false}% +% \end{macrocode} +% Place marker +% (Note: The \pkg{float} package uses |\fname@|\textit{X} as float name, +% but we need |\|\textit{X}|name| in |\float|\x|place|.) +% \begin{macrocode} + \@ifundefined{#2name}{\@namedef{#2name}{\@nameuse{fname@#2}}}{}% + \@namedef{#2place}{\floatplace{#2}}% +% \end{macrocode} +% Re-define float. +% \begin{macrocode} + \DeclareDelayedFloatFlavor#1{#2}{#2}% +% \end{macrocode} +% Define the heading title. (Only relevant if option |fighead| is set.) +% \begin{macrocode} + \expandafter\providecommand\csname #2section\endcsname{#4}% +% \end{macrocode} +% \begin{macrocode} +% \end{macrocode} +% Here we set-up the hooks for getting stuff into |\process...| +% commands easily. +% \begin{macrocode} + \@namedef{efloat@#2@hook}{}% + \edef\@tempb{\def\noexpand\@tempa{\@car#2\@nil}}% + \uppercase\expandafter{\@tempb}% + \edef\@tempb{% + \noexpand\g@addto@macro\noexpand\@tempa{\@cdr#2\@nil}}% + \@tempb + \@namedef{AtBegin\@tempa s}{% + \expandafter\g@addto@macro\csname efloat@#2@hook\endcsname}% + \@namedef{AtBegin\@tempa es}{% + \expandafter\g@addto@macro\csname efloat@#2@hook\endcsname}% +% \end{macrocode} +% \begin{macrocode} + \@namedef{process#2s}{\efloat@process{#3}{#2}}% + \@namedef{process#2es}{\@nameuse{process#2s}}% +% \end{macrocode} +% Finally add the environment to the list of delayed floats +% \begin{macrocode} + \@cons\efloat@list{{#2}}} +\@onlypreamble\efloat@@declare +% \end{macrocode} +% \begin{macrocode} +\newcommand*\efloat@list{} % \end{macrocode} % \end{macro} -% \begin{macro}{\figureplace} -% \begin{macro}{\tableplace} -% Place markers. -% \changes{v1.0b}{1992/03/10}{adaptation for LaTeX 2.09 and -% international namegiving by Ronald Kappert -% R.Kappert@urc.kun.nl} +% +% \begin{macro}{\DeclareDelayedFloatFlavor} +% \begin{macro}{\DeclareDelayedFloatFlavour} +% This one redefines the given environment, i.e. |figure| resp. |table|. +% While the non-starred variant redefines both variants (non-starred and starred), +% the starred variant only redefines the environment as given.\par +% We do this |\At|\x|Begin|\x|Document| so we are (hopefully) redefining this +% environment as the very last package. +% (Otherwise \pkg{endfloat} would not work with \pkg{floatrow}.) +% \changes{v2.5b}{2011/12/05}{This command added. as} +% \begin{macrocode} +\newcommand*\DeclareDelayedFloatFlavor{% + \@ifstar{\efloat@declareflavor\@gobble}% + {\efloat@declareflavor\@iden}} +\@onlypreamble\DeclareDelayedFloatFlavor +\let\DeclareDelayedFloatFlavour\DeclareDelayedFloatFlavor +\@onlypreamble\DeclareDelayedFloatFlavour +% \end{macrocode} +% \begin{macrocode} +\newcommand*\efloat@declareflavor[3]{% + \@ifundefined{ef@ext@#3}% + {\PackageError{endfloat}% + {Unknown environment `#3'}% + {Only environments known to the `endfloat' package are allowed here.}}% + {\AtBeginDocument{% + \efloat@@declareflavor{#2}{#3}% + #1{\efloat@@declareflavor{#2*}{#3}}}}} +\@onlypreamble\efloat@declareflavor +% \end{macrocode} +% \begin{macrocode} +\newcommand*\efloat@@declareflavor[2]{% + \def\@tempa{\@efloat{#2}{#1}}% + \@ifundefined{efloat@#1@ORI}% +% \end{macrocode} +% Save old definition of the environment. +% \begin{macrocode} + {\expandafter\expandafter\expandafter\let\expandafter + \csname efloat@#1@ORI\expandafter\endcsname + \csname #1\endcsname +% \end{macrocode} +% Restore old definition of the environment at |\efloat@restore|\x|floats|. +% \begin{macrocode} + \expandafter\g@addto@macro\expandafter\efloat@restorefloats\expandafter{% + \expandafter\let + \csname #1\expandafter\endcsname + \csname efloat@#1@ORI\endcsname}% +% \end{macrocode} +% Re-define float. +% \begin{macrocode} + \expandafter\let\csname#1\endcsname\@tempa}% +% \end{macrocode} +% \begin{macrocode} + {\expandafter\ifx\csname#1\endcsname\@tempa \else + \PackageError{endfloat}% + {The environment `#1' was already redefined}% + {You can't use \noexpand\DeclareDelayedFloatFlavor twice for a given environment.}% + \fi}} +\@onlypreamble\efloat@@declareflavor +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\efloat@restorefloats} +% Restore the original definition of all environments (floats and flavors) +% known to the \pkg{endfloat} package. +% This macro will be filled with life by |\Declare|\x|Delayed|\x|Float|\x|Flavor|. +% \changes{v2.5}{2011/11/26}{This macro added by as} +% \begin{macrocode} +\newcommand*\efloat@restorefloats{} +% \end{macrocode} +% \end{macro} +% +% \subsection{Options and (obsolete) Commands} +% +% \begin{macro}{\efloat@SetOption} +% Sets an option (via |\efloat@Setup|) for all environments known to +% the \pkg{endfloat} package. +% \changes{v2.5}{2011/11/26}{This macro added. as} +% \begin{macrocode} +\newcommand*\efloat@SetOption[1]{% + \def\@elt##1{\efloat@Setup{##1}{#1}}% + \efloat@list + \let\@elt\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\efloat@Setup} +% Within option code we can't use |\Setup|\x|Delayed|\x|Float| since +% |figure| and |table| are not declared as delayed floating environments yet. +% So we use |\efloat@Setup| instead which will simply collect the settings for +% execution at a later stage. +% \changes{v2.5a}{2011/12/03}{This macro added. as} +% \begin{macrocode} +\newcommand\efloat@Setup[2]{% + \g@addto@macro\efloat@ProcessOptions{\SetupDelayedFloat{#1}{#2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\efloat@ProcessOptions} +% Processes options setup with |\efloat@Setup|. +% \changes{v2.5a}{2011/12/03}{This macro added. as} +% \begin{macrocode} +\newcommand\efloat@ProcessOptions{% + \let\efloat@SetOption\@undefined + \let\efloat@Setup\@undefined + \let\efloat@ProcessOptions\@undefined} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\markersintext} +% \begin{macro}{\nomarkersintext} +% First set up flags and defaults. First set for flagging +% whether markers appear in text. % \changes{v1.99}{1992/05/27}{extensive changes by bj} % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% -% \begin{macro}{\figurename} -% \begin{macro}{\tablename} -% Make sure that |\tablename| and |\figurename| are defined. +% \changes{v2.2a}{1994/10/07}{Create new options} % \begin{macrocode} -\providecommand{\figurename}{Figure} -\providecommand{\tablename}{Table} +\DeclareOption{nomarkers}{\@domarkersfalse} +\DeclareOption{markers}{\@domarkerstrue} +% \end{macrocode} +% \begin{macrocode} +\newcommand{\markersintext}{\@domarkerstrue + \ef@OldCmd{\markersintext}{markers}} +\newcommand{\nomarkersintext}{\@domarkersfalse + \ef@OldCmd{\nomarkersintext}{nomarkers}} % \end{macrocode} % \end{macro} % \end{macro} +% +% \begin{macro}{\dotablist} +% \begin{macro}{\notablist} +% Options for creating lists of Tables \ldots +% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} % \changes{v1.99}{1992/05/27}{extensive changes by bj} +% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} +% \changes{v2.5}{2011/11/26}{We use \cs{SetupDelayedFloat} now. as} % \begin{macrocode} -\newcommand{\figureplace}{% - \begin{center} - [\figurename~\thepostfig\ about here.] - \end{center}} -\newcommand{\tableplace}{% - \begin{center} - [\tablename~\theposttbl\ about here.] - \end{center}} +\newcommand{\dotablist}{% + \SetupDelayedFloat{table}{list=true}% + \ef@OldCmd{\dotablist}{tablist}} +\newcommand{\notablist}{% + \SetupDelayedFloat{table}{list=false,head=true}% + \ef@OldCmd{\notablist}{notablist}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\dofiglist} +% \begin{macro}{\nofiglist} +% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} +% \changes{v1.99}{1992/05/27}{extensive changes by bj} +% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} +% \changes{v2.5}{2011/11/26}{We use \cs{SetupDelayedFloat} now. as} +% \ldots and Figures +% \begin{macrocode} +\newcommand{\dofiglist}{% + \SetupDelayedFloat{figure}{list=true}% + \ef@OldCmd{\dofiglist}{figlist}} +\newcommand{\nofiglist}{% + \SetupDelayedFloat{figure}{list=false,head=true}% + \ef@OldCmd{\nofiglist}{nofiglist}} % \end{macrocode} % \end{macro} % \end{macro} +% +% Now we make options |tablist| and |notablist| and |figlist| and +% |nofiglist|. Note that options will be processed in order of +% the |\DeclareOption| commands in this file. So by placing +% |list| after |nolist| we ensure that if both are specified, |list| +% is in effect. +% +% First two new options +% \begin{macrocode} +\DeclareOption{nolists}{\@figlistfalse \efloat@SetOption{list=false}} +\DeclareOption{lists}{\@figlisttrue \efloat@SetOption{list=true}} +% \end{macrocode} +% Now the more specific ones, which must come after the more +% general options to get the right interactions between semi-conflicting +% options. +% \begin{macrocode} +\DeclareOption{notablist}{\efloat@Setup{table}{list=false}} +\DeclareOption{nofiglist}{\efloat@Setup{figure}{list=false}} +\DeclareOption{tablist}{\efloat@Setup{table}{list=true}} +\DeclareOption{figlist}{\efloat@Setup{figure}{list=true}} +% \end{macrocode} +% +% The \texttt{notablist} and \texttt{nofiglist} options still leave +% a section header at the beginning of the tables and figures. +% +% Note again the role that order plays, by placing |fighead| after +% |noheads| it ensures that |fighead| will be in effect if both +% are specified. +% \begin{macrocode} +\DeclareOption{heads}{\@figheadtrue \efloat@SetOption{head=true}} +\DeclareOption{noheads}{\@figheadfalse \efloat@SetOption{head=false}} +% \end{macrocode} +% \begin{macrocode} +\DeclareOption{fighead}{\efloat@Setup{figure}{head=true}} +\DeclareOption{tabhead}{\efloat@Setup{table}{head=false}} +\DeclareOption{nofighead}{\efloat@Setup{figure}{head=true}} +\DeclareOption{notabhead}{\efloat@Setup{table}{head=false}} +% \end{macrocode} +% Also need option for putting tables first +% \begin{macrocode} +\DeclareOption{tablesfirst}{\@tablesfirsttrue} +\DeclareOption{figuresfirst}{\@tablesfirstfalse} +% \end{macrocode} +% \changes{v2.5a}{2011/12/03}{Options `tablesonly' and `figuresonly' added. as} +% \begin{macrocode} +\DeclareOption{tablesonly}{\efloat@figuresfalse \efloat@tablestrue} +\DeclareOption{figuresonly}{\efloat@figurestrue \efloat@tablesfalse} +% \end{macrocode} +% Other option stuff +% \begin{macrocode} +\DeclareOption*{% + \PackageWarning{endfloat}{Unknown option `\CurrentOption'}} +% \end{macrocode} +% Process (global) options +% \begin{macrocode} +\ProcessOptions* +% \end{macrocode} +% Declare `figure' and `table' as delayed floating environment, if requested +% \begin{macrocode} +\if@tablesfirst + \ifefloat@tables + \DeclareDelayedFloat{table}[ttt]{Tables} + \fi + \ifefloat@figures + \DeclareDelayedFloat{figure}[fff]{Figures} + \fi +\else + \ifefloat@figures + \DeclareDelayedFloat{figure}[fff]{Figures} + \fi + \ifefloat@tables + \DeclareDelayedFloat{table}[ttt]{Tables} + \fi +\fi +% \end{macrocode} +% Process environment specific options +% \begin{macrocode} +\efloat@ProcessOptions +% \end{macrocode} +% +% \begin{macro}{\thepostfig} +% \begin{macro}{\theposttbl} +% For compatibility reasons we still offer the old counters +% |postfig| and |posttbl|, so existing redefinitions of |\figure|\x|place| +% and |\table|\x|place| resp. existing extensions to the \pkg{endfloat} package +% will still work. +% \begin{macrocode} +\let\c@postfig\c@postfigure +\let\c@posttbl\c@posttable +\newcommand\thepostfig{\thepostfigure} +\newcommand\theposttbl{\theposttable} +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsection{Parsing \texttt{figure} and \texttt{table}} % \changes{v1.99}{1992/05/27}{extensive changes by bj} % @@ -1478,22 +1987,14 @@ % get unmodified code into files. % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} % \begin{macrocode} -%\def\@gobbleuntilnext[#1]{} % Not used (jpg) -\let\@bfig\figure % bj -\let\@btab\table % bj \let\efloat@float\relax % \end{macrocode} % -% \begin{macro}{\figure} +% \begin{macro}{\@efloat} % the {blank space } appearing with |\nomarkersintext| was fixed by adding % a percent sign (|%|) at strategic locations, determined by setting % |\tracingcommands=1| ---Darrell -% \changes{v2.0}{1992/06/02}{Corrected problem of extra blank spaces in -% the output when nomarkersintext was in effect -% (bug reported by schultz@unixg.ubc.ca). -% jdm} % -% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} % As mentioned by the jdm above, the following is based % on \texttt{comment.sty}. It appears that the idea is to % turn off all control sequence processing and read in from @@ -1501,269 +2002,248 @@ % |\end{figure}|. Thus the actual name of the environment % is hardcoded into the use of the macros % (see section~\ref{sec:envnames}). ---jpg] -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % \changes{v1.1}{1992/03/13}{verified that floats were % used before a section was % created for them. jdm} % \changes{v1.2}{1992/03/14}{corrected typo that may have caused figures not % to be printed. jdm} -% % \changes{v1.99}{1992/05/27}{extensive changes by bj} +% \changes{v2.0}{1992/06/02}{Corrected problem of extra blank spaces in +% the output when nomarkersintext was in effect +% (bug reported by schultz@unixg.ubc.ca). +% jdm} % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} +% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} +% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} +% \changes{v2.5}{2011/11/26}{universalized by as} +% \changes{v2.5b}{2011/12/05}{revised by as} % \begin{macrocode} -\def\figure{% +\newcommand*\@efloat[1]{% + \expandafter\@@efloat\expandafter{\csname ef@ext@#1\endcsname}{#1}} % \end{macrocode} -% If we have already done one table then the file we write to -% is already open, and there is nothing to do, else open it up. % \begin{macrocode} - \efloat@condopen{fff} +\newcommand*\@@efloat[3]{% % \end{macrocode} -% -% We have read a |\begin{figure}| to get here. We need to write that -% into the file. -% -% -% I (jpg) would add the |[htb]| parameters to what -% gets written, but that leaves any float specifiers that had -% been employed by the user wandering around in the floated material. -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % \begin{macrocode} - \efloat@iwrite{fff}{\string\begin{figure*}}% +% If we have already done one table then the file we write to +% is already open, and there is nothing to do, else open it up. +% \begin{macrocode} + \efloat@condopen{#1}% % \end{macrocode} % Since the figures are not actually processed until much later, we don't % use \LaTeX's figure numbering mechanism, but we use our own. Also % put marker in text (if option set). In the future, I may combine % the counter for the markers and the counter used as a flag for % whether the file is open into one thing. -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % \begin{macrocode} - \if@domarkers% - \addtocounter{postfig}{1}% % bj - \figureplace% % bj - \fi% + \if@domarkers + \stepcounter{post#2}% % bj + \@nameuse{#2place}% % bj + \fi % \end{macrocode} -% \begin{macro}{\@currenvir} % |\@currenvir| (current environment) it set to fool % latex into expecting the end of this environment % to match the environment name. It will be used more extensively % when dealing with % the problem discussed in section~\ref{sec:envnames}. -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % \begin{macrocode} - \def\@currenvir{efloat@float}% + \def\@currenvir{efloat@float}% % \end{macrocode} -% \end{macro} % Now we set up catcodes for reading in text without processing % things. But need to make |^^M| special since we want to read % line by line. -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % \begin{macrocode} - \begingroup% - \let\do\ef@makeinnocent \dospecials% - \ef@makeinnocent\^^L% and whatever other special cases - \endlinechar`\^^M \catcode`\^^M=12 \ef@xfigure}% + \begingroup + \let\do\ef@makeinnocent \dospecials + \ef@makeinnocent\^^L% and whatever other special cases + \endlinechar`\^^M \catcode`\^^M=12 % +% \end{macrocode} +% Patch |\ef@endfiguretest| so it contains the actual environment name. +% \begin{macrocode} + \efloat@patch\ef@endfiguretest{#3}% as +% \end{macrocode} +% We have read a |\begin{figure}| to get here. We need to write that +% into the file. \par +% I (jpg) would add the |[htb]| parameters to what +% gets written, but that leaves any float specifiers that had +% been employed by the user wandering around in the floated material. +% \begin{macrocode} + \def\next{\ef@xfigure{#1}}% + \next\string\begin{#3}}% % \end{macrocode} % \end{macro} +% % \begin{macro}{\efloat@foundend} % When |\ef@xfigure| is verbatim-like reading the figure it has to % do some clean-up after it as found the |\end{figure}| or -% |\end{figure*}|. This is it. [this part written by jpg v2.2] +% |\end{figure*}|. This is it. [this part written by jpg v2.2]\par +% Note that this macro will not be used by the \pkg{endfloat} package +% itself anymore, but we'll leave it here so extensions written for the +% \pkg{endfloat} package which uses it will still work. % \begin{macrocode} -\def\efloat@foundend#1#2{\def\next{\endgroup\end{efloat@float}% - \efloat@iwrite{#1}{\string\end{#2}}% - \efloat@iwrite{#1}{\string\efloatseparator}% - \efloat@iwrite{#1}{ }}}% +\newcommand*\efloat@foundend[2]{% + \efloat@iwrite{#1}{\string\end{#2}}% + \efloat@found@end{#1}} % \end{macrocode} % \end{macro} +% +% \begin{macro}{\efloat@found@end} +% This is the new version of \cs{efloat@foundend}, actually used +% by this package. +% \changes{v2.5}{2011/11/26}{This variant of \cs{efloat@foundend} added by as} +% \begin{macrocode} +\newcommand*\efloat@found@end[1]{% + \def\next{\endgroup\end{efloat@float}% + \efloat@iwrite{#1}{\string\efloatseparator}% + \efloat@iwrite{#1}{ }}}% +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\ef@xfigure} % |\ef@xfigure| reads line by line, checking whether each line % is the |\end{figure}|. If it is, then write out end stuff % to the file. Otherwise write out read in line to the % file and do the |\next| line. -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} +% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} +% \changes{v2.5}{2011/11/26}{universalized by as} +% \changes{v2.5}{2011/11/26}{\cs{long} added. as} % \begin{macrocode} {\catcode`\^^M=12 \endlinechar=-1 % - \gdef\ef@xfigure#1^^M{\def\test{#1}% + \long\gdef\ef@xfigure#1#2^^M{\def\test{#2}% % \end{macrocode} -% Test for |\end{figure}| +% We have a line of text in the +% body of the figure which should be written to the file. % \begin{macrocode} - \ifx\test\ef@endfiguretest - \efloat@foundend{fff}{figure*} + \efloat@iwrite{#1}{#2}% % \end{macrocode} -% Test for |\end{figure*}| -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} +% Test for |\end{figure}| % \begin{macrocode} - \else\ifx\test\ef@enddblfiguretest - \efloat@foundend{fff}{figure*} + \ifx\test\ef@endfiguretest + \efloat@found@end{#1}% % \end{macrocode} -% Finally, if none of the above, we have a line of text in the -% body of the figure which should be written to the file. -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} % \begin{macrocode} - \else% - \efloat@iwrite{fff}{#1}% - \let\next\ef@xfigure% - \fi \fi \next}% -}% + \fi \next}} % \end{macrocode} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} +% \end{macro} +% % \begin{macro}{\ef@endfiguretest} -% \begin{macro}{\ef@enddblfiguretest} +% \iffalse % Generalizing these end\ldots{}test so that they % can be used for user specified floating environments will % require more |\expandafter|s then you can shake a stick at. % I am not looking forward to taking on that task. I should % look at the version control package to see what I can % lift from there, since it must be the same problem. +% \fi +% I (as) have generalized this end\ldots{}test so it can be +% used for user specific floating environments as well. +% I did this by simply replacing |figure| with |X|, this will be patched +% to the correct environment name in |\@efloat| by using |\efloat@patch|. +% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} +% \changes{v2.5}{2011/11/26}{`figure' replaced by 'X' and documentation modified. as} % \begin{macrocode} {\escapechar=-1% - \xdef\ef@endfiguretest{\string\\end\string\{figure\string\}}% - \xdef\ef@enddblfiguretest{\string\\end\string\{figure*\string\}}% -}% -% \end{macrocode} -% \end{macro} -% \end{macro} -% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} -% \end{macro} -% \begin{macro}{\table} -% |\table| is the same as |\figure|. But I am not going to -% document it as much. -% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg} -% \changes{v1.99}{1992/05/27}{extensive changes by bj} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% \begin{macrocode} -\def\table{\efloat@condopen{ttt} - \efloat@iwrite{ttt}{\string\begin{table*}}% - \if@domarkers - \addtocounter{posttbl}{1} % bj - \tableplace % bj - \fi - \def\@currenvir{efloat@float}% - \begingroup - \let\do\ef@makeinnocent \dospecials - \ef@makeinnocent\^^L% and whatever other special cases - \endlinechar`\^^M \catcode`\^^M=12 \ef@xtable} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ef@xtable} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} -% \begin{macrocode} -{\catcode`\^^M=12 \endlinechar=-1 % - \gdef\ef@xtable#1^^M{\def\test{#1} - \ifx\test\ef@enddbltabletest - \efloat@foundend{ttt}{table*} - \else\ifx\test\ef@endtabletest - \efloat@foundend{ttt}{table*} - \else - \efloat@iwrite{ttt}{#1}% - \let\next\ef@xtable - \fi \fi \next} + \xdef\ef@endfiguretest{\string\\end\string\{X\string\}} } % \end{macrocode} -% \end{macro} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} % \begin{macrocode} -{\escapechar=-1 - \xdef\ef@enddbltabletest{\string\\end\string\{table*\string\}} - \xdef\ef@endtabletest{\string\\end\string\{table\string\}} -} -% \end{macrocode} -% Define starred floats. -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% \begin{macrocode} -\@namedef{figure*}{\figure} -\@namedef{table*}{\table} +\newcommand*\efloat@patch[2]{% + \def\x##1X##2\@nil{\def#1{##1#2##2}}% + \expandafter\x#1\@nil} % \end{macrocode} +% \end{macro} +% % \subsection{Processing Figures and Tables} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% \begin{macrocode} -\providecommand{\figuresection}{Figures} -\providecommand{\tablesection}{Tables} -% \end{macrocode} -% \begin{macro}{\AtBeginFigures} -% \begin{macro}{\AtBeginTables} +% % \begin{macro}{\AtBeginDelayedFloats} % Here we set-up the hooks for getting stuff into |\process...| % commands easily. The command |\g@addto@macro| is defined % in \file{classes.dtx}. I was about to write it myself, when I realized that % it must already exist for things like |\AtBeginDocument|. % \begin{macrocode} -\newcommand{\processfigures@hook}{\@empty} -\def\AtBeginFigures{\g@addto@macro\processfigures@hook} -\newcommand{\processtables@hook}{\@empty} -\def\AtBeginTables{\g@addto@macro\processtables@hook} -\newcommand{\processdelayedfloats@hook}{\@empty} +\newcommand{\processdelayedfloats@hook}{} \def\AtBeginDelayedFloats{% \g@addto@macro\processdelayedfloats@hook} -\newcommand{\processotherdelayedfloats}{\@empty} +\newcommand{\processotherdelayedfloats}{} % \end{macrocode} -% \end{macro}\end{macro}\end{macro} -% \begin{macro}{\processfigures} +% \end{macro} +% +% \begin{macro}{\efloat@process} +% |\efloat@process|\marg{file extension}\marg{environment name} % \changes{v1.99}{1992/05/27}{extensive changes by bj} % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} +% \changes{v2.5}{2011/11/26}{universalized by as} +% \changes{v2.5a}{2011/12/04}{\cs{ifnum} replaced by \cs{efloat@ifflag}. as} +% \changes{v2.5a}{2011/12/04}{\cs{ef@setct} replaced by \cs{efloat@setflag}. as} % \begin{macrocode} -\def\processfigures{% +\newcommand*\efloat@process[2]{% % \end{macrocode} -% First test to see if there are any figures to process. If so -% do it. +% First test to see if there are any figures to process. +% If so do it. % \begin{macrocode} - \expandafter\ifnum \csname @ef@fffopen\endcsname>0 + \efloat@ifflag{#1open}{% % \end{macrocode} % Close the file for writing. Set a flag saying so. % \begin{macrocode} - \immediate\closeout\efloat@postfff \ef@setct{fff}{0} + \expandafter\immediate\expandafter\closeout\csname efloat@post#1\endcsname + \efloat@setflag{#1open}{false}% % \end{macrocode} % Deal with headers and list of figures if necessary % \begin{macrocode} - \clearpage % bj - \if@figlist % bj - {\normalsize\listoffigures} % bj - \clearpage % bj - \fi - \if@fighead - \section*{\figuresection} % bj + \clearpage % bj + \efloat@ifflag{#2list}{% % bj + {\normalsize\efloat@listof{#2}}% % bj + \clearpage % bj + }{}% + \efloat@ifflag{#2head}{% + \section*{\@nameuse{#2section}}% % bj % \end{macrocode} % See the discussion in section~\ref{sec:place} for what problem % the |suppressfloats[t]| is here to solve. If I understand the % \textit{Companion} correctly (page 144), this was not available % in previous versions of \LaTeX. % \begin{macrocode} - \suppressfloats[t] % jpg - \fi - \markboth{\uppercase{\figuresection}}{\uppercase{\figuresection}}% bj + \suppressfloats[t]% % jpg + }{}% + \markboth % bj + {\expandafter\uppercase\expandafter{\csname #2section\endcsname}}% bj + {\expandafter\uppercase\expandafter{\csname #2section\endcsname}}% bj % \end{macrocode} % Use any user defined hooks just before inputting the file. % \begin{macrocode} - \processfigures@hook \@input{\jobname.fff} - \fi} + \@nameuse{efloat@#2@hook}% + \@input{\jobname.#1}% + }{}} % \end{macrocode} % \end{macro} -% \begin{macro}{\processtables} -% \changes{v1.99}{1992/05/27}{extensive changes by bj} -% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg} -% Just like |\processfigures|, only not so well documented. -% \begin{macrocode} -\def\processtables{% - \expandafter\ifnum \csname @ef@tttopen\endcsname>0 - \immediate\closeout\efloat@postttt \ef@setct{ttt}{0} - \clearpage % bj - \if@tablist % bj - {\normalsize\listoftables} % bj - \clearpage % bj - \fi - \if@tabhead - \section*{\tablesection} % bj - \suppressfloats[t] % jpg - \fi - \markboth{\uppercase{\tablesection}}{\uppercase{\tablesection}}% bj - \processtables@hook \@input{\jobname.ttt} - \fi} +% +% \begin{macro}{\efloat@listof} +% This one will do the ``List of Figures'' resp. ``List of Tables''. +% \changes{v2.5}{2011/11/26}{This macro added} +% \begin{macrocode} +\newcommand*\efloat@listof[1]{% +% \end{macrocode} +% If no name is given for the list we set it to ``List of \textit{X}'' where +% \textit{X} is the heading given as second mandatory argument +% to |\Declare|\x|Delayed|\x|Float|. +% \begin{macrocode} + \expandafter\providecommand\csname list#1name\endcsname + {List of \@nameuse{#1section}}% +% \end{macrocode} +% If |\listof|\textit{X}|s| is defined, we use it here. +% Otherwise we try using |\listof| (defined by the \pkg{float} and \pkg{floatrow} +% package) instead. If this will fail, too, we have to give up (and issue an error message). +% \begin{macrocode} + \@ifundefined{listof#1s}% + {\@ifundefined{listof}% + {\PackageError{endfloat}% + {Don't know how to make List of `#1'}% + {You could try defining \protect\listof#1s on your own}}% + {\listof{#1}{\@nameuse{list#1name}}}}% + {\@nameuse{listof#1s}}} % \end{macrocode} % \end{macro} % @@ -1788,37 +2268,44 @@ % \end{macrocode} % % \subsubsection{Calling the processing commands} +% +% \begin{macro}{\processdelayedfloats} % Note that there is an extra set |{| and |}| so that the % restoration of the original definitions is in a group and is \emph{not} % global. If, for some reason, you wish them to be global then use % something like -% \begin{verbatim} -% \makeatletter -% \AtBeginDelayedFloats{\global\let\table\@btab \global\let\figure\@bfig} -% \makeatother -%\end{verbatim} -% \begin{macro}{\processdelayedfloats} +% \begin{quote} +% |\makeatletter|\\ +% |\g@addto@macro\processdelayedfloats{\efloat@restorefloats}|\\ +% |\makeatother| +% \end{quote} +% \changes{v2.5}{2011/11/26}{Process float list instead of |figure| and |table|. as} % \begin{macrocode} \newcommand{\processdelayedfloats}{{% % \end{macrocode} % Here we reset stuff to apply while end stuff is being processed. -% Prior to version 2.4, these were in |\processtablels| and |\processfigures|. +% Prior to version 2.4, these were in |\processtables| and |\processfigures|. % \begin{macrocode} \def\baselinestretch{1}\normalsize - \let\figure\@bfig - \let\table\@btab + \efloat@restorefloats % \end{macrocode} % The hook comes after those settings so as to override them if desired. % \begin{macrocode} - \processdelayedfloats@hook + \processdelayedfloats@hook % \end{macrocode} % Process tables, figures, and others (or figures, tables, others) % \begin{macrocode} - \if@tablesfirst \processtables\processfigures - \else \processfigures\processtables \fi - \processotherdelayedfloats}} + \efloat@processfloats + \processotherdelayedfloats}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\efloat@processfloats{% + \let\@tempa\@empty + \def\@elt##1{\g@addto@macro\@tempa{\@nameuse{process##1es}}}% + \efloat@list + \let\@elt\relax + \@tempa} % \end{macrocode} -% \end{macro} % \changes{v1.99}{1992/05/27}{extensive changes by bj} % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg} % \changes{v2.1}{1994/06/25}{Use AtEndDocument. jpg} @@ -1828,10 +2315,15 @@ \onecolumn \processdelayedfloats } % \end{macrocode} +% \end{macro} +% % Use, or don't use, configuration file. % \begin{macrocode} \InputIfFileExists{endfloat.cfg}{% \typeout{*** Using endfloat.cfg ***}}{} +% \end{macrocode} +% +% \begin{macrocode} %</package> % \end{macrocode} % @@ -1839,6 +2331,7 @@ % % \subsection{Getting new delayed environments} % +% \iffalse % changed by Axel Sommerfeldt % I have been promising to make it easy to define new sorts % of environments which can be delayed. I don't expect to deliver % on that promise any time soon; so until I do, I will provide a @@ -1849,121 +2342,49 @@ % among other things provides environments |sidewaystable| and % |sidewaysfigure|. With the following definitions, these should % also work properly with \pkg{endfloat}. +% \else +% This section used to offer a configuration file which was able +% to integrate the environments |side|ways|figure| and |side|ways|table| +% offered by the \pkg{rotating} package\cite{RahBar:rotating} +% into the \pkg{endfloat} package.\par +% For compatibility reasons we still do, so existing documents +% including |efxmpl.cfg| will still work,~e.g. +% \begin{quote} +% \ldots\\ +% |\usepackage{endfloat}|\\ +% |\makeatletter|\\ +% |\input{efxmpl.cfg}|\\ +% |\makeatother|\\ +% \ldots +% \end{quote} +% \fi % % \begin{macrocode} %<*config> -% Warning! This configuration file is experimental and -% will probably only work with the version of endfloat.sty -% with which it is distributed. It is fully expected that the -% mechanism by which the stuff here is done will change radically -% in future versions. For detailed comments on this code see -% endfloat.dtx. % \end{macrocode} % -% Setting up sidewaystable and sidewaysfigure is fairly easy since they -% will use the same counters as table and figure, and more importantly -% the same temporary files. So, no special |\processsideways...| needs -% to be created. -% % We must, of course, have use of the rotating package. % \begin{macrocode} \RequirePackage{rotating} % \end{macrocode} -% First save the definitions from |rotating| of the environments -% in question, since they will need to be restored when they are -% processed at the end. -% \begin{macrocode} -\let\efsaved@sidewaysfigure\sidewaysfigure -\let\efsaved@sidewaystable\sidewaystable -% \end{macrocode} % -% And to restore them when the time comes. These hooks are called by -% |\processtables| and |\processfigures|. We use the hooks to -% restore the original definitions of |sideways...|. -% \begin{macrocode} -\AtBeginTables{\let\sidewaystable=\efsaved@sidewaystable\relax} -\AtBeginFigures{\let\sidewaysfigure=\efsaved@sidewaysfigure\relax} -% \end{macrocode} -% \begin{macro}{\sidewaystable} -% This redefinition of |sidewaystable| is very similar to the redefinition -% of |\table| in |endfloat| proper. When a |\begin{sidewaystable}| is -% expanded, it will write |\begin{sidewaystable}| to |\jobname.ttt| and -% otherwise do what it does for a |\begin{table}|, except of course that -% it is looking for an |\end{sidewaystable}|. +% We declare |side|\x|ways|\x|figure| and |side|\x|ways|\x|table| as +% variants of the |figure| resp.~|table| environments. % \begin{macrocode} -\def\sidewaystable{\efloat@condopen{ttt} - \efloat@iwrite{ttt}{\string\begin{sidewaystable}}% - \if@domarkers - \addtocounter{posttbl}{1} - \tableplace - \fi - \def\@currenvir{efloat@float}% - \begingroup - \let\do\ef@makeinnocent \dospecials - \ef@makeinnocent\^^L% and whatever other special cases - \endlinechar`\^^M \catcode`\^^M=12 \ef@xsidetable} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ef@xsidetable} -% The definition of |\ef@xsidetable| is similar to the definition of -% |\ef@xtable| in |endfloat| proper. It is a little bit simpler, since -% there is no need to worry about the |*|-ed versions. Note that it -% writes out verbatim the environment to the |.ttt| file. When -% it finds a line that satisfies the |\ef@endsidetabletest| it -% will call a macro that will write |\end{sidewaystable}| to the -% |\jobname.ttt| file. -% \begin{macrocode} -{\catcode`\^^M=12 \endlinechar=-1 % - \gdef\ef@xsidetable#1^^M{\def\test{#1} - \ifx\test\ef@endsidetabletest - \efloat@foundend{ttt}{sidewaystable} - \else - \efloat@iwrite{ttt}{#1}% - \let\next\ef@xsidetable - \fi \next} -} -% \end{macrocode} -% \end{macro} -% -% Now figures -% \begin{macro}{\sidewaysfigure} -% \begin{macrocode} -\def\sidewaysfigure{\efloat@condopen{fff} - \efloat@iwrite{fff}{\string\begin{sidewaysfigure}}% - \if@domarkers - \addtocounter{postfig}{1} - \figureplace - \fi - \def\@currenvir{efloat@float}% - \begingroup - \let\do\ef@makeinnocent \dospecials - \ef@makeinnocent\^^L% and whatever other special cases - \endlinechar`\^^M \catcode`\^^M=12 \ef@xsidefigure} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ef@xsidefigure} -% \begin{macrocode} -{\catcode`\^^M=12 \endlinechar=-1 % - \gdef\ef@xsidefigure#1^^M{\def\test{#1} - \ifx\test\ef@endsidefiguretest - \efloat@foundend{fff}{sidewaysfigure} - \else - \efloat@iwrite{fff}{#1}% - \let\next\ef@xsidefigure - \fi \next} -} -% \end{macrocode} -% \end{macro} -% We need the strings to test for ends of the sideways things. -% \begin{macrocode} -{\escapechar=-1% - \xdef\ef@endsidefiguretest{\string\\end\string\{sidewaysfigure\string\}}% - \xdef\ef@endsidetabletest{\string\\end\string\{sidewaystable\string\}}}% +\DeclareDelayedFloatFlavor{sidewaysfigure}{figure} +\DeclareDelayedFloatFlavor{sidewaystable}{table} % \end{macrocode} % % \begin{macrocode} %</config> % \end{macrocode} +% +% \emph{Note:} +% If you would like to add support of given floating environments to +% the \pkg{endfloat} package, please do not use configuration files +% but |\Declare|\x|Delayed|\x|Float| and |\Declare|\x|Delayed|\x|Float|\x|Flavor| +% instead. +% % \Finale % \endinput |