Debian Codegraph @

texmf-dist/source/latex/endfloat/endfloat.dtx

raw
1 \def\filename{endfloat}
2 \def\fileversion{v2.7}
3 \def\filedate{2019/04/15}
4 \def\docdate{2019/04/15}
5 %
6 % \CheckSum{872}
7 %% \CharacterTable
8 %% {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
9 %% 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
10 %% Digits \0\1\2\3\4\5\6\7\8\9
11 %% Exclamation \! Double quote \" Hash (number) \#
12 %% Dollar \$ Percent \% Ampersand \&
13 %% Acute accent \' Left paren \( Right paren \)
14 %% Asterisk \* Plus \+ Comma \,
15 %% Minus \- Point \. Solidus \/
16 %% Colon \: Semicolon \; Less than \<
17 %% Equals \= Greater than \> Question mark \?
18 %% Commercial at \@ Left bracket \[ Backslash \\
19 %% Right bracket \] Circumflex \^ Underscore \_
20 %% Grave accent \` Left brace \{ Vertical bar \|
21 %% Right brace \} Tilde \~}
22 %%
23 %
24 % \iffalse
25 %% Description: LaTeX style to put figures and tables at end of article
26 %% Keywords: LaTeX, style-option, float, figure, table
27 %% Authors: James Darrell McCauley <[email protected]>,
28 %% Jeff Goldberg <[email protected]>,
29 %% Axel Sommerfeldt <[email protected]>
30 %% Maintainer: -none-
31 %% Latest Version: Version 2.7 <April 2019>
32 % \fi
33 %
34 % \DoNotIndex{\documentclass,\usepackage,\hfuzz,\small,\tt,\begin,\end}
35 % \DoNotIndex{\NeedsTeXFormat,\filedate,\fileversion,\DoNotIndex}
36 % \DoNotIndex{\def,\edeg,\xdef,\gdef,\let,\divide,\advance,\multiply}
37 % \DoNotIndex{\",\-,\H,\',\\,\{,\},\^,\ }
38 % \DoNotIndex{\begingroup,\endgroup,\catcode,\global,\relax,\space}
39 % \DoNotIndex{\string,\immediate}
40 % \DoNotIndex{\normalsize,\large,\Large,\small,\tiny,\bf}
41 % \DoNotIndex{\@z}
42 % \DoNotIndex{\ifthenelse,\and,\equal,\whiledo,\if,\fi,\else}
43 % \DoNotIndex{\CodelineIndex,\EnableCrossrefs,\DisableCrossrefs}
44 % \DoNotIndex{\DocInput,\AltMacroFont}
45 % \DoNotIndex{\RecordChanges,\OnlyDescription}
46 % \DoNotIndex{\@input,\@namedef,\@whilesw,\clearpage,\ifnum,\ifx}
47 % \DoNotIndex{\jobname,\message,\MessageBreak,\newcommand}
48 % \DoNotIndex{\protect,\providecommand,\ProvidesPackage,\renewcommand}
49 % \DoNotIndex{\section,\setlength}
50 %
51 % \changes{v0.1}{1992/02/25}{created by Darrell McCauley (jdm)}
52 % \changes{v1.0}{1992/03/01}{cleaned up and released jdm}
53 % \changes{v2.0}{1992/06/02}{incorporated changes made by bj (see v1.99). jdm}
54 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
55 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
56 % \changes{v2.1c}{1994/07/20}{Modify documentation -jpg}
57 % \changes{v2.3}{1995/03/05}{Fix figure* bug and docs -jpg}
58 %
59 % \newcommand*{\pkg}[1]{\textsf{#1}}
60 % \newcommand*{\file}[1]{\texttt{#1}}
61 % \newcommand*{\cls}[1]{\textsl{#1}}
62 % \newcommand{\bs}{\texttt{\char'134}}
63 % \newcommand*\x{\discretionary{-}{}{}}
64 %
65 % \title{The \texttt{\filename} package\thanks{This file
66 % has version number \fileversion, last
67 % revised \filedate, documentation dated \docdate.}}
68 % \author{James Darrell McCauley
69 % \and Jeff Goldberg\thanks{JPG ([email protected])
70 % is responsible for all modifications
71 % from version 2.1 upwards. Since there is almost no original code
72 % left, he has claimed co-authorship from version 2.4.}
73 % \and Axel Sommerfeldt\thanks{Axel Sommerfeldt ([email protected])
74 % is responsible for all modifications from version 2.5 to 2.7.}
75 % }
76 %
77 % \date{\docdate}
78 %
79 % \maketitle
80 %
81 % \begin{abstract}
82 % The purpose of this package is to put all figures on pages by themselves
83 % at the end of an article in a section named Figures. Likewise for tables.
84 % Markers, like ``[Figure 3 about here]'' appear in the text (by default)
85 % near where the figure (or table) would normally have occurred.
86 % This is usually required when preparing submissions to journals.
87 %
88 % A number of package options and other mechanisms are provided to
89 % give the user control over various aspects of the package's behavior.
90 %
91 % Loading this package will change the output of \LaTeX.
92 % \end{abstract}
93 %
94 % \tableofcontents
95 % \section{In many voices}
96 %
97 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
98 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
99 % This documentation was put in its current form by Jeff Goldberg,
100 % who has tried to indicate when he is (when
101 % I am) speaking. See \autoref{sec:history} for more detail.
102 % However, both the original author, Darrell McCauley, and
103 % a major contributor, Brian Junker, use the first person
104 % singular. In this version I no longer work to keep it clear
105 % who wrote what portions of the documentation and the code, but
106 % have allowed things to blend together a little more, since the
107 % constant interpolations were hindering readability. Generally
108 % the user documentation was written by Darrell MaCauley (jdm),
109 % but anything that refers to \LaTeXe\ features was added
110 % by me (jpg). Also, where you find spelling and typographical
111 % errors, you are likely to be reading my text.
112 %
113 % Axel Sommerfeldt has added a section about dealing with
114 % other floating environments than |figure| and |table|, and
115 % made adaptions to other sections affected by the
116 % changes of version 2.5, 2.6, and 2.7.
117 % Furthermore he has added paragraphs about his \pkg{caption}
118 % package in section \ref{sec:removingcaptions} ``Removing captions''.
119 %
120 % This documentation is long. Most users won't need to read beyond
121 % the first few pages, but there are a number of ways to customize
122 % the behavior of \pkg{endfloat} and these are detailed as the
123 % documentation progresses. The package is unusual in the way
124 % it does its job, so it can interact with other packages and
125 % other aspects of \LaTeX\ in ways that may be surprising.
126 % Although the package is flexible in some respects, it is
127 % highly limited in others.
128 % Tools and hints are provided to help you control these interactions,
129 % but these do require some reading. But you only need to take
130 % a look at these sections when the need arises.
131 %
132 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
133 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
134 %
135 % \section{Why write this package?}
136 %
137 % Many journals require tables and figures to be separated from the text
138 % when you submit those ugly double spaced copies. They also usually want
139 % a list of figures/tables before these sections (capability added in v2.0,
140 % control through package options added in v2.2).
141 %
142 % I (jdm) am writing a set of styles that look exactly like a journal, but just
143 % by adding one style option, I wanted the user to meet the requirements
144 % for formatting submissions. I encourage others to do the
145 % same.\footnote{Note that jdm, working in old \LaTeX209
146 % did not have the distinction between class, package and package
147 % options available to him at the time he made his comment.
148 % The most coherent way to do what is needed is to use a class,
149 % let's say \cls{submit}, which would load \pkg{endfloat} and
150 % presumably some double spacing packages among other things. Once
151 % that class is defined, then other classes which are specific
152 % to particular journals can be defined.}
153 %
154 % \section{Usage}
155 % \subsection{Loading}
156 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
157 % Just include the package in your preamble
158 % \begin{quote}
159 % |\usepackage[|\ldots|]{endfloat}|
160 % \end{quote}
161 %
162 % Note that versions 2.1 and beyond will no longer work with
163 % \LaTeX209. Get your administrator to upgrade your site
164 % to the new standard, \LaTeXe. Although version~2.0 (a \LaTeX209 version)
165 % will usually work with \LaTeXe, it will not do so in combination
166 % with certain other packages.
167 %
168 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
169 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
170 %
171 % \subsection{What it does}
172 %
173 % Merely loading the package will get it working. Loading it will
174 % have \LaTeX\ produce two extra files with
175 % \texttt{.ttt} and \texttt{.fff} extensions
176 % (for tables and figures, respectively).
177 %
178 % This puts all figures and tables at the end of your document
179 % each on a page by itself\footnote{This
180 % is the default. See \autoref{sec:separator} to see how
181 % to have multiple floats per page.}
182 % and creates a List of Figures and/or List of Tables section
183 % at the end (when appropriate and controllable by options).
184 % The floats are processed using |\baselinestretch{1}| irrespective
185 % of what is used in the document as a whole. This can be
186 % reset to, say 1.4, by using
187 % \begin{quote}
188 % |\AtBeginDelayedFloats{%|\\
189 % | \renewcommand{\baselinestretch}{1.4}}|
190 % \end{quote}
191 % which is available from version 2.4. See \autoref{sec:hooks}
192 % for more discussion.
193 %
194 % It also leaves notes in the text (i.e., ``[Figure 4 about here.]'').
195 % If you would rather not have these, this can be turned off by
196 % using the |nomarkers| options. If you
197 % do not like the look of this marker, you can change
198 % their text and appearance
199 % (see \autoref{sec:language}).
200 %
201 % \subsection{Starred floats}
202 % The |figure*| and |table*| versions are supported by the current
203 % version.\footnote{I (jpg) very stupidly introduced a bug in version 2.2
204 % which wrecked |figure*|. It has been brought to my attention and
205 % fixed. I offer my thanks and my apologies.}
206 %
207 % \subsection{Options} \label{sec:options}
208 %
209 % Under version 2.2 and higher,
210 % the \pkg{endfloat} package uses package options. The options
211 % are summarized in table~\ref{tab:options}. In addition to these
212 % options, see sections~\ref{sec:extra} and~\ref{sec:hooks} for more
213 % advanced ways of controlling output.
214 %
215 % \begin{table}
216 % \caption{Options and defaults} \label{tab:options}
217 % \smallskip
218 % \begin{tabular}{lcll}
219 % \hline
220 % \multicolumn{1}{c}{Option} &
221 % \multicolumn{1}{c}{Default}&
222 % \multicolumn{1}{c}{Default implication} &
223 % \multicolumn{1}{c}{Descriptions} \\
224 % \hline
225 % |nofiglist| & off & & no list of figures \\
226 % |notablist| & off & & no list of tables \\
227 % |nolists| & & |nofiglist|, |notablist| & neither list \\
228 % |figlist| & on & & list of figures \\
229 % |tablist| & on & & list of tables \\
230 % |lists| & & |figlist|, |tablist| & list of tables and figures \\
231 % |nofighead| & on & & no `Figures' section header \\
232 % |notabhead| & on & & no `Tables' section header \\
233 % |noheads| & & |nofighead|, |notabhead| & neither of the headers \\
234 % |fighead| & off & & `Figures' section header \\
235 % |tabhead| & off & & `Tables' section header \\
236 % |heads| & & |fighead|, |tabhead| & Both section headers \\
237 % |markers| & on & & Place markers in the text \\
238 % |nomarkers| & off & & no markers in text \\
239 % |tablesfirst| & off & & Put tables before figures \\
240 % |figuresfirst| & on & & Put figures before tables \\
241 % |tablesonly| & off & & Handle tables only \\
242 % |figuresonly| & off & & Handle figures only \\
243 % |notables| & off & & Disregard tables \\
244 % |nofigures| & off & & Disregard figures \\
245 % |disable| & & & Disables the package \\
246 % \hline
247 % \end{tabular}
248 % \end{table}
249 %
250 % The list of tables and figures can be suppressed by using the
251 % \texttt{nofiglist} and \texttt{notablist} options. Both
252 % can be suppressed with the \texttt{nolists} option.\footnote{In
253 % versions prior to 2.2 the command for turning off the lists turned
254 % on the headers (the equivalent of the |heads| option). That is
255 % not the case with these options. The |lists| and the |heads|
256 % options are entirely orthogonal.}
257 % The default is \texttt{lists}.
258 %
259 % A section header for `Tables' and `Figures' can be produced by using
260 % the option |tabhead|, |fighead|, respectively, and |heads| for both.
261 % The defaults are |notabhead| and |nofighead|.
262 %
263 % If you want the headers instead of the lists you would need to
264 % use both the |nolists| and the |heads| options.
265 %
266 % If you want to suppress the markers in the text, use the
267 % option \texttt{nomarkers}. The default is
268 % \texttt{markers}.
269 %
270 % Normally the figures at the end appear before the tables.
271 % This can be changed by using the option \texttt{tablesfirst}.
272 % The default is \texttt{figuresfirst}.
273 %
274 % If nothing else if specified, both figures and tables will be handled
275 % by the \pkg{endfloat} package.
276 % This can be altered by usage of the options |tables|\x|only|
277 % resp. |figures|\x|only|.
278 %
279 % \medskip
280 %
281 % A typical usage might be something like
282 % \begin{quote}
283 % |\documentclass[a4paper,12pt]{article}|\\
284 % |\usepackage[nolists,tablesfirst]{endfloat}|\\
285 % \ldots\\
286 % |\begin{document}|
287 % \end{quote}
288 % which would suppress the list of tables and figures as well as
289 % the corresponding section headers, and would have the tables
290 % precede the figures.
291 %
292 % \subsubsection{Contradictions and dilemmas}
293 %
294 % It is not recommended that one specify conflicting options, but
295 % if you insist, here are the rules. In table~\ref{tab:options} the third
296 % column indicates what other options are implied by default. That
297 % is |heads| turns on |fighead| by default, but that implication
298 % can be overruled by explicitly stating the |nofighead| option.
299 %
300 % \begin{enumerate}
301 % \item \label{rule:elsewhere}
302 % When one option is more specific than the other the more specific
303 % one holds true, and the more general will only partially hold.
304 % So specifying \texttt{fighead} and \texttt{noheads} will be the
305 % same as saying \texttt{fighead} and \texttt{notabhead}.
306 % \item
307 % The order in which the options appear is relevant.
308 % \item
309 % If some of the obsolete commands for these options are used
310 % all bets are off on these interactions.
311 % \end{enumerate}
312 %
313 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
314 %
315 % \section{Modifying marker text}\label{sec:language}
316 %
317 % \changes{v1.0b}{1992/03/10}{adaptation for LaTeX 2.09 and
318 % international namegiving by Ronald Kappert
319 % [email protected]}
320 % \DescribeMacro{\tableplace}
321 % \DescribeMacro{\figureplace}
322 % \DescribeMacro{\floatplace}
323 % Announcements in any language can be generated by
324 % using |\re|\x|new|\x|command| to redefine |\table|\x|place| and
325 % |\figure|\x|place|, or by redefining |\float|\x|place|.
326 %
327 % The defaults are
328 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
329 % \begin{quote}
330 % |\newcommand\figureplace{\floatplace{figure}}|\\
331 % |\newcommand\tableplace{\floatplace{table}}|\\
332 % \\
333 % |\newcommand\floatplace[1]{%|\\
334 % | \begin{center}|\\
335 % | [\csname #1name\endcsname~%|\\
336 % | \csname thepost#1\endcsname\ about here.]|\\
337 % | \end{center}}|
338 % \end{quote}
339 %
340 % These redefinitions may be placed in the \file{endfloat.cfg}
341 % file (see \autoref{sec:extra} for more information).
342 %
343 % WARNING! The name of the counters |post|\x|tbl| and |post|\x|fig|
344 % have been changed to |post|\x|table| and |post|\x|figure| in version 2.5.
345 % However, |\the|\x|post|\x|tbl| and |\the|\x|post|\x|fig| are still available for
346 % usage inside redefined versions of |\table|\x|place| and |\figure|\x|place|
347 % so old documents (hopefully) will still work.
348 %
349 % Hooks for the \texttt{babel} package are not (yet) provided, so
350 % you will have to do things by hand:
351 % \begin{quote}
352 % |\renewcommand{\figurename}{Abra} % if no babel|\\
353 % |\renewcommand{\figureplace}{%|\\
354 % | \begin{center}|\\
355 % | [A(z) \thepostfigure.~\figurename itt legyen.]|\\
356 % | \end{center}}|
357 % \end{quote}
358 %
359 % If you wish to change the name of the figure or table section
360 % heading, you can do that in the usual way (via the \texttt{babel}
361 % package, or by redefining |\figure|\x|section| and |\table|\x|section|
362 % directly).
363 %
364 % \DescribeMacro{\efloatheading}
365 % Endfloat uses |\efloat|\x|heading| for applying this heading.
366 % By default it is defined to use |\mark|\x|both| for that purpose:
367 % \begin{quote}
368 % |\newcommand\efloatheading[1]{%|\\
369 % | \markboth{\uppercase{#1}}{\uppercase{#1}}}|
370 % \end{quote}
371 % forcing the headings applied in uppercase. You may change this by using
372 % |\re|\x|new|\x|command| to redefine |\efloat|\x|heading| as you wish:
373 % \begin{quote}
374 % |\renewcommand\efloatheading[1]{|\meta{code that applies \#1 as heading}|}|
375 % \end{quote}
376 % It makes most sense to place such a redefinition in the configuration
377 % file (see \autoref{sec:extra}).
378 %
379 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
380 % \changes{v1.0b}{1992/03/10}{adaptation for LaTeX 2.09 and
381 % international namegiving by Ronald Kappert
382 % [email protected]}
383 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
384 %
385 % \section{Commands before processing delayed material} \label{sec:hooks}
386 %
387 % \DescribeMacro{\AtBeginFigures}
388 % \DescribeMacro{\AtBeginTables}
389 % \DescribeMacro{\AtBeginDelayedFloats}
390 % If you wish to have some more control over how the tables and figures
391 % are processed, you can make use of the commands |\At|\x|Begin|\x|Delayed|\x|Floats|,
392 % |\At|\x|Begin|\x|Figures|, and |\At|\x|Begin|\x|Tables|.
393 % If you wanted to ensure that the tables begin
394 % on a recto page, you could for example say something like
395 % |\At|\x|Begin|\x|Tables{\clear|\x|double|\x|page}| in the preamble of your
396 % document.\footnote{It is difficult for me to imagine a situation where
397 % one would be using \pkg{endfloat} and the class option \texttt{twoside},
398 % without which \texttt{\bslash cleardoublepage}
399 % is the same as \texttt{\bslash clearpage}, together.
400 % Another, more realistic example would be to adjust the
401 % \texttt{\bslash baselinestretch} for table and figure processing.}
402 % Material in |\At|\x|Begin|\x|Tables| and |\At|\x|Begin|\x|Figures| is processed after
403 % the list of tables or list of figures (if those options are set) and
404 % just before the files with the delayed material in input. These are
405 % also processed after the original definitions of the table and figure
406 % environments are restored.
407 %
408 % These commands can be used either in the preamble of your document,
409 % or in the \file{endfloat.cfg} file (see \autoref{sec:extra}).
410 %
411 % \section{Insert own code into the delayed material} \label{sec:addto}
412 %
413 % \DescribeMacro{\addtodelayedfloat}
414 % |\addtodelayedfloat| will add own code to delayed floats.
415 % For example
416 % \begin{quote}
417 % |\addtodelayedfloat{figure}{\clearpage}|
418 % \end{quote}
419 % will add |\clear|\x|page| to the delayed figures.
420 %
421 % Note: The argument will be stored detokenized to the intermediate
422 % file.
423 % If this is not what you want, use the starred variant
424 % |\add|\x|to|\x|delayed|\x|float*| instead, for example
425 % \begin{quote}
426 % |\addtodelayedfloat{figure}{\sometext}|
427 % \end{quote}
428 % will add |\some|\x|text| to the delayed figures while
429 % \begin{quote}
430 % |\addtodelayedfloat*{figure}{\sometext}|
431 % \end{quote}
432 % will add the current content of |\some|\x|text| to the delayed
433 % figures.
434 %
435 % \section{Processing delayed floats before the end}
436 %
437 % \DescribeMacro{\processdelayedfloats}
438 % If you wish to process
439 % the floats prior to the end of the document, you may do so with the
440 % |\processdelayedfloats| command, which has been made available from
441 % version~2.4 onward. This will process all of the
442 % unprocessed tables and figures up to that point. You may wish
443 % to use this command at the end of every chapter for example.
444 %
445 % If you do use this, there are several points which should be noted.
446 % \begin{enumerate}
447 % \item All outstanding floats will be processed at the
448 % end of the document.
449 % \item If you use the |lists| option you will get a list of all
450 % tables and figures in the document. Not just the ones for
451 % the current chapter. Using lists may have other odd consequences.
452 % \item It is your responsibility to set |\table|\x|place| and
453 % |\figure|\x|place| correctly, as well as to possibly reset
454 % the counters |\the|\x|post|\x|table| and |\the|\x|post|\x|figure| (\autoref{sec:language})
455 % as you wish. If you do not reset them, they will continue to
456 % increase throughout the document.
457 % \end{enumerate}
458 %
459 % \section{Several floats per page}\label{sec:separator}
460 %
461 % \DescribeMacro{\efloatpreamble}
462 % Endfloat applies |\efloat|\x|preamble| before typesetting the very first
463 % (delayed) float in their respective files.
464 % By default it is defined to do nothing.
465 % You may change this by using
466 % |\re|\x|new|\x|command| to redefine |\efloat|\x|preamble| as you wish.
467 %
468 % \medskip
469 %
470 % \DescribeMacro{\efloatseparator}
471 % Endfloat places |\efloat|\x|separator| between the floats in their
472 % respective files. By default it is defined to be |\clear|\x|page|
473 % forcing one float per page. You may change this by using
474 % |\re|\x|new|\x|command| to redefine |\efloat|\x|separator| as you wish.
475 % One possibility, suggested by a user, is
476 % \begin{quote}
477 % |\renewcommand{\efloatseparator}{\mbox{}}|
478 % \end{quote}
479 %
480 % \DescribeMacro{\efloatpostamble}
481 % Endfloat applies |\efloat|\x|postamble| after typesetting the very last
482 % (delayed) float in their respective files.
483 % By default it is defined to be |\efloat|\x|separator|.
484 % You may change this by using
485 % |\re|\x|new|\x|command| to redefine |\efloat|\x|postamble| as you wish.
486 %
487 % \iffalse
488 % \medskip
489 % It makes most sense to place such redefinitions in the configuration
490 % file (see \autoref{sec:extra}).
491 % \fi
492 %
493 % \medskip
494 %
495 % \DescribeMacro{\efloattype}
496 % If you need to know what floats are actually processed, you could draw on
497 % |\efloat|\x|type| which is set to the environment type currently processed,
498 % for example |figure| or |table|.
499 %
500 % \section{Other customizations}\label{sec:customizations}
501 %
502 % \DescribeMacro{\efloatbegin}
503 % \DescribeMacro{\efloatend}
504 % |\efloat|\x|begin| will be typeset before the processing of each delayed
505 % float while |\efloat|\x|end| will be typeset after each processing.
506 % By default the first is defined to be |\clear|\x|page|, the second is
507 % defined to do nothing.
508 %
509 % \medskip
510 %
511 % \DescribeMacro{\efloatbeginlist}
512 % \DescribeMacro{\efloatendlist}
513 % |\efloat|\x|begin|\x|list| will be typeset before each list of delayed floats
514 % while |\efloat|\x|end|\x|list| will be typeset after each list.
515 % By default the first is defined to be |\normal|\x|size|, the second is
516 % defined to be |\clear|\x|page|.
517 %
518 % \section{Configuration file and other end environments}\label{sec:extra}
519 %
520 % Many users have suggested options to the package which are
521 % often journal specific. Many of the suggestion options are
522 % also not specific to how \pkg{endfloat} itself works, but to how
523 % captions and lists of figures and tables are to appear.
524 % Instead of burdening the package with options that, in the
525 % end, are specific to particular journals, I have added a
526 % configuration file for \pkg{endfloat} which will allow
527 % you to make many of these redefinitions without
528 % having to further increase the size of \pkg{endfloat} itself.
529 %
530 % As of version 2.4 \pkg{endfloat} will look for a file
531 % called \file{endfloat.cfg} in \TeX's input path. If it
532 % is found, it will be included after \pkg{endfloat} is loaded.
533 % The purpose of this configuration file is to allow the user to
534 % include additional definitions related to \pkg{endfloat}.
535 % For example, any redefinition of \verb"\floatplace" can
536 % go in this file, so that the preamble does not need to
537 % be filled with material that only makes sense when
538 % \pkg{endfloat} is loaded.\footnote{However, if you find yourself
539 % placing other material (such as double spacing or modification
540 % of title page and abstract) into \file{endfloat.cfg} to
541 % simulate a journal submission class, you should really
542 % do the right thing and create a journal submission class.
543 % Creating a minor class (one that loads an existing class
544 % such as \cls{article} is not difficult. See the
545 % \textit{Class Guide}\cite{LT3:ClassGuide} for instructions. Future versions
546 % of the \pkg{endfloat} documentation may include a sample.}
547 %
548 % The configuration file can also provided
549 % so that the user could specify environments other
550 % than |figure| and |table| (and their |*|-ed counterparts) which can
551 % be delayed until the end of the document.
552 %
553 % \subsection{Modified figures and tables}
554 %
555 % As stated in \autoref{sec:envnames}, \pkg{endfloat} will
556 % utterly fail if one does something like
557 % \begin{quote}
558 % |\newenvironment{foo}{...\begin{table}...}|\\
559 % | {...\end{table}...}|
560 % \end{quote}
561 % because \pkg{endfloat} will make |\begin{table}| go into a verbatim
562 % like mode and look for the literal string |\end{table}|, which it
563 % will not see in |\end{foo}|.
564 %
565 % However, inserting the following code into the document preamble
566 % may be worth a try:
567 % \begin{quote}
568 % |\DeclareDelayedFloatFlavor{foo}{table}|
569 % \end{quote}
570 % This tells the \pkg{endfloat} package that |foo| should be treated as |table|,
571 % at least from \pkg{endfloat}'s point of view.
572 % If you keep your fingers crossed this may actually work.
573 %
574 % \subsection{Environments based on figures and tables}\label{sec:flavor}
575 %
576 % The \pkg{rotating} package\cite{RahBar:rotating}
577 % contains definitions of environments
578 % |side|\x|ways|\x|figure| and |side|\x|ways|\x|table|\footnote{These
579 % require support from the dvi driver, such as \texttt{dvips}.},
580 % and it would be nice to have these work in documents which also
581 % use \pkg{endfloat}.
582 %
583 % This can be archived with
584 % \begin{quote}
585 % |\DeclareDelayedFloatFlavor{sidewaysfigure}{figure}|\\
586 % |\DeclareDelayedFloatFlavor{sidewaystable}{table}|
587 % \end{quote}
588 % after loading both, the \pkg{endfloat} and \pkg{rotating} package.
589 %
590 % The general syntax of |\Declare|\x|Delayed|\x|Float|\x|Flavor| is
591 % \begin{quote}
592 % |\DeclareDelayedFloatFlavo|(|u|)|r|\marg{environment}\marg{is a variant of}
593 % \end{quote}
594 % so for example
595 % \begin{quote}
596 % |\usepackage{endfloat,threeparttable}|\\
597 % |\DeclareDelayedFloatFlavour{threeparttable}{table}|
598 % \end{quote}
599 % makes the |three|\x|part|\x|table| environment known to the \pkg{endfloat} package
600 % as a variant of the floating environment |table|.
601 %
602 % This works with the |long|\x|table| environment as well:
603 % \begin{quote}
604 % |\usepackage{endfloat,longtable}|\\
605 % |\DeclareDelayedFloatFlavour*{longtable}{table}|
606 % \end{quote}
607 % Note that we use the starred variant |\Declare|\x|Delayed|\x|Float|\x|Flavor*|
608 % here which only redefines |long|\x|table| to be delayed, but leaves the unnumbered
609 % |long|\x|table*| environment (provided by the \pkg{caption} resp.~\pkg{ltcaption} package)
610 % unchanged.
611 %
612 % \subsubsection{The ctable package}\label{sec:ctable}
613 %
614 % Since |\ctable| offered by the \pkg{ctable} package\cite{Dekker:ctable}
615 % is a command and not an environment, it cannot be declared as delayed
616 % environment straight-ahead, i.e.
617 % \begin{quote}
618 % |\DeclareDelayedFloatFlavor{ctable}{table}|
619 % \end{quote}
620 % is not sufficient here since the \pkg{endfloat} package is only
621 % capable of delaying environments.
622 % A dirty (but working) solution is using |ctable| as environment
623 % and not as command. An example document:
624 % \begin{quote}
625 % |\documentclass{book}|\\
626 % |\usepackage{ctable}|\\
627 % |\usepackage{endfloat}|\\
628 % |\DeclareDelayedFloatFlavor{ctable}{table}|\\
629 % |\begin{document}|\\
630 % ||\\
631 % |\begin{ctable}[|\\
632 % | cap=Test,|\\
633 % | caption=Test,|\\
634 % | ]{cc}{|\\
635 % | \tnote[]{}|\\
636 % | }{\FL|\\
637 % | A & B \ML|\\
638 % | 1 & 2 \NN|\\
639 % | 3 & 4 \LL}|\\
640 % |\end{ctable}|\\
641 % ||\\
642 % |\end{document}|
643 % \end{quote}
644 %
645 % \subsection{Other floating environments}\label{sec:other}
646 %
647 % By using |\new|\x|float| offered by the \pkg{float} package\cite{Lingnau:float},
648 % or |\Declare|\x|New|\x|Float|\x|Type| offered by the \pkg{floatrow} package\cite{Lapko:floatrow},
649 % or |\Declare|\x|Floating|\x|Environment| offered by the \pkg{newfloat}
650 % package\cite{Sommerfeldt:newfloat}
651 % one can define new floating environments. These environments
652 % can be made supported by the \pkg{endfloat} package, too, e.g.
653 % \begin{quote}
654 % |\usepackage{newfloat,endfloat}|\\
655 % |\DeclareFloatingEnvironment{map}|\\
656 % |\DeclareDelayedFloat{map}{Maps}|
657 % \end{quote}
658 % will define a new floating environment called ``map'' and
659 % set up the \pkg{endfloat} package to handle this environment, too.
660 %
661 % The trick is using the command
662 % \begin{quote}
663 % |\DeclareDelayedFloat|\marg{float}\oarg{file extension}\marg{heading}
664 % \end{quote}
665 % which makes the new floating environment known to the \pkg{endfloat} package.
666 %
667 % The \meta{file extension} specifies the file where the floating environments
668 % will be stored, like |fff| for figures and |ttt| for tables.
669 % If no \meta{file extension} is given, |ef|\meta{float} will be used, e.g. |efmap|
670 % will be used as file extension in the code example above.
671 %
672 % The \meta{heading} will be used for the section header, if selected.
673 % If |\list|\meta{float}|name| is not defined, it will be used for the list heading, too.
674 %
675 % The package options |nolists|, |lists|, |noheads|, and |heads| will be respected
676 % for new environments, too. But if you would like to set individual options for
677 % them, you can do so by using
678 % \begin{quote}
679 % |\SetupDelayedFloat|\marg{float}\marg{options}
680 % \end{quote}
681 % where options are |nolist|, |list|, |nohead|, and |head| analogous to the package
682 % options for figures and tables specified in section \ref{sec:options}.
683 %
684 % By the way, |\Setup|\x|Delayed|\x|Float| works for the environments |figure| and
685 % |table|, too, so
686 % \begin{quote}
687 % |\usepackage[nofiglist,fighead]{endfloat}|
688 % \end{quote}
689 % is identical to
690 % \begin{quote}
691 % |\usepackage{endfloat}|\\
692 % |\SetupDelayedFloat{figure}{nolist,head}|
693 % \end{quote}
694 % and (if you prefer using key-value options instead)
695 % \begin{quote}
696 % |\usepackage{endfloat}|\\
697 % |\SetupDelayedFloat{figure}{list=false,head=true}|
698 % \end{quote}
699 %
700 % \subsection[Changing list and caption appearance]
701 % {Changing the appearence of ``lists of'' and captions}
702 %
703 % When the |lists| option is used, the \LaTeX\ commands |\list|\-|of|\-|tables|
704 % and |\list|\-|of|\-|figures| are called. These produce lists indicating
705 % the page number that each table or figure appear on. With \pkg{endfloat}
706 % in use this information is usually superfluous, and -- rumor has it --
707 % undesirable by at least some journals.
708 % What seems to be required
709 % when using lists is that either the list does not the figure or table number,
710 % and/or the caption doesn't not contain the caption text.
711 %
712 % This section provides a few rudimentary samples of what you might
713 % put into the configuration file to get these effects. I have chosen
714 % not to make these package options, because they are often too journal
715 % specific. The availability of the configuration file means that
716 % you can put this things there, and the differences between \pkg{endfloat}
717 % using and non-\pkg{endfloat} using \LaTeX\ source documents is minimal.
718 %
719 % \subsubsection{Removing captions}
720 % \label{sec:removingcaptions}
721 %
722 % \DescribeMacro{\captionsetup}
723 % If you have included the \pkg{caption} package in your document
724 % you can omit the caption text by adding
725 % \begin{quote}
726 % |\captionsetup{labelsep=none,textformat=empty}|
727 % \end{quote}
728 % to the preamble of your document.~\footnote{%
729 % This needs at least version $3.2$ of the \pkg{caption} package.}
730 % If this should be done for figures (or tables) only one can use the
731 % optional argument of |\caption|\x|setup|, e.g.:
732 % \begin{quote}
733 % |\captionsetup[figure]{labelsep=none,textformat=empty}|
734 % \end{quote}
735 % See \pkg{caption} package documentation for details and alternatives.
736 %
737 % \DescribeMacro{\@makecaption}
738 % If the \pkg{caption} package is not used, the simplest thing
739 % is to provide a redefinition of |\@makecaption|.
740 % You should model your redefinition after the one used in the
741 % document class you actually use instead of blindly
742 % following what is here. |\@makecaption| takes two arguments, the
743 % first will be something like ``figure 3'' and the second will
744 % be the caption text. We will simply ignore the second argument.
745 % Most of the tricky bit of the definition
746 % is about testing whether the caption is longer than a line. Since
747 % we will only be using the first argument, we can safely assume that
748 % the caption will fit on one line.\footnote{If you have
749 % \texttt{\bs figurename} as something absurdly long or a
750 % very narrow \texttt{\bs textwidth},
751 % then you will have to use a more complicated version.}
752 % Your redefinition of |\@makecaption| may look like
753 % \begin{quote}
754 % |\renewcommand{\@makecaption}[2]{%|\\
755 % | \vskip\abovecaptionskip|\\
756 % | \hbox to \hsize{\hfil #1\hfil}%|\\
757 % | \vskip\belowcaptionskip}|
758 % \end{quote}
759 %
760 % \DescribeMacro{\caption}
761 % This still leaves one problem. If you use
762 % \begin{quote}\ttfamily
763 % |\caption|\oarg{short caption text}\marg{full caption text}
764 % \end{quote}
765 % only the short caption text will ever appear in the list of tables or
766 % figures. The following redefinition of |\caption| will take care of
767 % that.
768 %
769 % Again, first of all a solution for usage with the \pkg{caption} package:~\footnote{%
770 % This needs at least version $3.3$ of the \pkg{caption} package.}
771 % \begin{quote}
772 % |\captionsetup{list-entry=heading}|
773 % \end{quote}
774 %
775 % If the \pkg{caption} package is not used,
776 % the following code should be used instead:
777 % \begin{quote}
778 % |\let\OrigCaption\caption|\\
779 % |\renewcommand{\caption}[2][X]{\OrigCaption[#2]{}}|
780 % \end{quote}
781 %
782 % \subsubsection{Eliminating numbers from lists of tables and figures}
783 %
784 % This is a bit trickier, and I have heard that it doesn't work
785 % with all versions of \LaTeXe, but I am unwilling to reinstall
786 % and older version for debugging this.
787 % A user [get the name] suggested that page numbers be suppressed
788 % in the lists of figures and tables.
789 %
790 % \begin{macro}{\l@figure}
791 % \begin{macro}{\l@table}
792 % All this requires is a redefinition of |\l@figure| and |\l@table|
793 % which are defined in \texttt{classes.txt}. Also see section~2.4.1 of the
794 % \emph{Companion} to see how these macros are called.
795 %
796 % The real only trick here is that |\l@figure| is defined to take
797 % two arguments, but the second is never used. The way it will be
798 % called will give it something like
799 % \begin{quote}
800 % |{\numberline {3} Caption of that figure}{85}|
801 % \end{quote}
802 % as arguments, where the second argument is the page number.
803 % The |\numberline| command will make use of the \LaTeX\ register
804 % |\@tempdima| for the width of the box containing the table
805 % or figure number. So we need to set that.
806 % The rest is pretty unsophisticated. You can, of course, modify it
807 % at will.
808 % \begin{quote}
809 % |\renewcommand*{\l@figure}[2]{%|\\
810 % | \setlength\@tempdima{2.3em}%|\\
811 % | \noindent\hspace*{1.5em}#1\hfil\newline }|
812 % \end{quote}
813 % And for tables:
814 % \begin{quote}
815 % |\let\l@table\l@figure|
816 % \end{quote}
817 % \end{macro}
818 % \end{macro}
819 %
820 % \section{Obsolete commands}\label{sec:obsolete}
821 %
822 % Versions of the package prior to 2.2 had some commands which the
823 % user could specify in the preamble to do what \emph{some} of the
824 % options do now. Although I would like to eventually remove those
825 % commands, they are documented in the \textit{Companion}; so they
826 % will remain for quite some time.
827 %
828 % \section{Caveats}\label{sec:caveats}
829 %
830 % Some of the things that are listed here may be considered bugs,
831 % design errors, interactions to watch out for, or just the
832 % way life is sometimes. They are, at least, a matter of concern, and you
833 % should watch out for them.
834 %
835 % \subsection{Literal strings}
836 %
837 % When floats are being read, \LaTeX\ is in verbatim mode. Among
838 % other things, this means that the lines like
839 % \begin{quote}
840 % |\end{figure}|
841 % \end{quote}
842 % or
843 % \begin{quote}
844 % |\end{figure}%|
845 % \end{quote}
846 % must appear on lines by themselves without any whitespace before
847 % or after them. A complete reimplementation of the most difficult
848 % part of the package is required to fix this limitation, but
849 % it is among the distant goals I have.
850 %
851 % \subsection{Extra files}
852 % This creates two extra files: \texttt{\meta{jobname}.fff} and
853 % \texttt{\meta{jobname}.ttt}. Any files by those names
854 % in the current directory will be overwritten.
855 %
856 % \subsection{Environment names} \label{sec:envnames}
857 %
858 % Because of how the redefinitions of \texttt{figure} and \texttt{table}
859 % are actually implemented, it is crucial that these environment
860 % names be used. That is, you cannot simply define a new environment which
861 % calls \texttt{figure} or \texttt{table} since the former must
862 % look for the literal string
863 % \begin{quote}
864 % |\end{figure}|
865 % \end{quote}
866 % in the document, while doing no expansion of control sequences.
867 % The latter does the same, but wants |table| instead of
868 % |figure|. This caution generally applies to all `verbatim-like'
869 % environments
870 %
871 % Although I haven't been able to confirm this yet, the
872 % \LaTeX\ system ScientificWord\footnote{A registered trademark.
873 % Write to [email protected] for more information.}
874 % may automatically put floats
875 % inside a macro called \verb"\FFRAME". If so, I hope
876 % that either someone from ScientificWord or one of its
877 % users will create something for \verb"\FFRAME" similarly to
878 % what I have done for \verb"\sidewaystable" in the sample configuration
879 % file (\autoref{sec:extra}).
880 %
881 % \subsection{The Environment's environment}\label{sec:envenv}
882 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
883 %
884 % Because no \TeX\ expansion is done while the material in these
885 % floats are read in, but is delayed until the floats are
886 % processed at the end of the document, it will be the state of
887 % \TeX\ at the end which will matter. For example, a document
888 % with something like
889 % \begin{quote}
890 % |\newcommand{\XXX}{YYY}|\\
891 % \ldots\\
892 % |\begin{table}|\\
893 % \ldots\\
894 % \ldots |\XXX| \ldots\\
895 % \ldots\\
896 % |\end{table}|\\
897 % \ldots\\
898 % |\renewcommand{\XXX}{ZZZ}|\\
899 % \ldots\\
900 % |\end{document}|
901 % \end{quote}
902 % will process the table with |\XXX| expanding to |ZZZ|.
903 %
904 % In any particular instance, the user can use either re-redefine
905 % |\XXX| before the end of document, or can re-redefine it using
906 % on of the hooks, |\At|\x|Begin|\x|Delayed|\x|Floats|, |\At|\x|Begin|\x|Tables|,
907 % or |\At|\x|Begin|\x|Figures|, which are discussed in \autoref{sec:hooks}.
908 %
909 % \subsection{Verbatim in delayed floats}\label{sec:verbatim}
910 %
911 % There should be no problem with verbatim text within a
912 % float unless that verbatim text contains an |\end{figure}| or
913 % |\end{table}| in a figure or table respectively. I don't see
914 % a fix for this. All I can imagine is that you create a new
915 % delayed type which behaves exactly like |figure| (or |table|)
916 % (even writing |\begin{figure}| and |\end{figure}| to the
917 % \texttt{.fff} file. [\textit{mutatis mutandis} for |table|])
918 % In future versions, I may create a sample like this in the
919 % sample configuration file, but it is a low priority since
920 % the only time one would write such a figure or table would
921 % be in a document about \LaTeX\ and it is difficult to imagine
922 % circumstances where a document about \LaTeX\ would need to
923 % be subject to \pkg{endfloat}.
924 %
925 % \subsection{Ordering End Document material}\label{sec:enddocument}
926 %
927 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
928 %
929 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
930 % \changes{v2.1}{1994/06/25}{Use AtEndDocument. jpg}
931 %
932 % Version 2.1 uses the \LaTeXe\ directive |\AtEndDocument|. This
933 % makes it \LaTeXe\ specific, but it means that it can be used
934 % with other packages that use that directive. Previous versions
935 % of \pkg{endfloat} redefined |\enddocument|. Now several
936 % packages or commands can add stuff at the ends of documents
937 % and still work together. This does mean that \emph{the order
938 % of loading packages can be important!} If you use several
939 % packages that may use the |\AtEndDocument| directive and you
940 % get funny results, try loading them in a different order.
941 % It that doesn't work, complain to the maintainer of the packages
942 % so that they will work out a way for the packages to interact
943 % correctly.
944 %
945 % \changes{v2.1}{1994/06/25}{Use AtEndDocument. jpg}
946 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
947 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
948 %
949 % \subsubsection{General ordering and wish list}\label{sec:order}
950 %
951 % I believe that the output of a \LaTeXe\ run should be independent
952 % of the order in which package are loaded. It would be possible
953 % to set this up, but it would take coordination of all package
954 % writers who use |\AtEndDocument|. The actual call to |\AtEndDocument|
955 % would not occur during package loading, but some new command,
956 % like |\ExecuteAtEndDocument| would be called by the user after
957 % all such packages are loaded, with tags for each thing in the
958 % packages, so something like
959 % \begin{quote}
960 % |\usepackage{lastpage}|\\
961 % |\usepackage{endfloat,xyzzy}|\\
962 % |\ExecuteAtEndDocument{endfloat,xyzzy,lastpage}|
963 % \end{quote}
964 % and the order of End Document material would be the \pkg{endfloat}
965 % material, followed by \textsf{xyzzy}, and finally by \pkg{lastpage}.
966 % The package \pkg{xyzzy} is fictitious, while the
967 % package \pkg{lastpage}\cite{Goldberg:lastpage} exists,
968 % it doesn't really matter what these do.
969 %
970 % I will have to wait until someone else develops such a system, but
971 % I will gladly modify the packages I am responsible for maintaining
972 % to comply with it. Until then
973 % I will include a message
974 % which begins with \texttt{AED}
975 % in every usage of |\At|\x|End|\x|Document|, and try to minimize any side
976 % effects my usage may have.
977 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
978 %
979 % \subsection{What are packages for?} \label{sec:monoton}
980 %
981 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
982 %
983 % One option is to not have packages like \pkg{endfloat} actually call
984 % |\At|\x|End|\x|Document|, but merely define a user level command which
985 % would make the call itself. This way, the order of those particular
986 % commands would matter, but not the ordering of the package loading.
987 %
988 % Another advantage of this is that packages could easily be things
989 % which make commands available, but do not actually entail
990 % a change in \texttt{.dvi} output themselves. It is classes,
991 % and options to classes which do that. That is, the actual
992 % loading of packages should have no visible effects, other than
993 % making new commands available. (Typeface changing
994 % packages, such as \textsf{times}, are obvious, and principled, exceptions.)
995 % The disadvantage is that it leads
996 % to two-step modifications (loading and calling) to change
997 % a document.
998 %
999 % I would propose any package (other than typeface changing
1000 % packages) which changes output instead of merely providing additional
1001 % commands, should be clearly labeled as doing such in the documentation
1002 % and in a message.
1003 %
1004 % \subsection{Float position specifiers} \label{sec:gobble}
1005 %
1006 % Float position specifiers are passed to the temporary files
1007 % and are used when those floats are processed. This may lead
1008 % to funny results, especially if the first figure or first table uses
1009 % |[p]| while the |heads| option is being used. This can lead to
1010 % that float, floating to the page after the header.
1011 % Most other float specifiers will not lead to any problems, because
1012 % the package mucks about the various float specification parameters.
1013 %
1014 % \subsection{Misplaced headers} \label{sec:buggyheads}
1015 %
1016 % Version 2.2c contains a partial fix to a problem with the placement
1017 % of floats around the section headers produced by the |heads| option.
1018 % There were two variants of the problem. In one the first float
1019 % after the header would float above the header. This has been fixed
1020 % by using the \LaTeXe\ command |\suppressfloats|. The other
1021 % problem is that that the first float may float to a page float
1022 % after the page with the header on it.
1023 %
1024 % This has been partially fixed, but
1025 % if users use the |[p]| specification on their first floats or if
1026 % there are large floats, the problem can still
1027 % show up. It is recommended that whenever the user wants a |[p]| that
1028 % an |[hp]| be used instead. In normal running (without \pkg{endfloat}),
1029 % this should only rarely effect the document, but it will help avoid
1030 % the problem with the floating end float. An |[h]| may also be needed for
1031 % large floats. There is only need to be concerned about the first
1032 % figure and first table.
1033 %
1034 % The natural solution to this problem will require that the bug
1035 % in described in \autoref{sec:gobble} be resolved.
1036 %
1037 % \subsection{Known incompatibilities}
1038 %
1039 % Above I have outlined sources of potential conflicts and incompatibilities
1040 % with other packages. Those sections contain a discussion of potential
1041 % work-arounds. Here I list where I know of specific incompatibilities
1042 % with distributed packages. This list is not complete. If you know
1043 % on an addition, please let me know.
1044 %
1045 % \subsubsection{Environment names}
1046 %
1047 % The packages listed here all have the problem described in
1048 % \autoref{sec:envnames}. The work-arounds are also described
1049 % there. \pkg{rotating}, \emph{Scientific Word}.
1050 %
1051 % \subsubsection{Ordering end material}
1052 %
1053 % The following packages put things at the end of the document, and
1054 % peculiar results are possible if you don't pay attention to the
1055 % order in which packages are loaded. This is described in
1056 % \autoref{sec:order}. The package \pkg{lastpage} is among
1057 % these, as are recent versions of the package \pkg{harvard}.
1058 %
1059 % \subsubsection{Conflicting \cs{enddocument}}
1060 %
1061 % Prior to \LaTeXe's provision of the hook |\AtEndDocument|, package
1062 % writers were forced to redefine |\enddocument|. Some did so
1063 % in ways that over wrote any other package's redefinition of the
1064 % same. When you encounter such a package you should try to get
1065 % its author to release a modified version. Version~2.0 of \pkg{endfloat}
1066 % was such a packages. So was the winter 1993 version of~\pkg{harvard}
1067 % (which has been fixed). But
1068 % for those using an old version of \pkg{harvard} you will encounter
1069 % problems.
1070 %
1071 % \subsubsection{Miscellaneous}
1072 %
1073 % There are several other potential conflicts that don't fall into
1074 % the broader categories.
1075 %
1076 % \begin{itemize}
1077 % \item |\listoftables| and |\listoffigurers| are left undefined
1078 % in class \cls{elsart}. But this is because Elsevier does
1079 % not want those lists. Elsevier, bless them, does not want
1080 % floats at the end for submissions to its journals. So
1081 % there is no reason to use \pkg{endfloat} (with or without lists)
1082 % with class \cls{elsart}. Let's hope that other publishers
1083 % will follow Elsevier's lead in understanding that the
1084 % submission rules which were created were created for a reason,
1085 % and when those reasons no longer apply, the rules should be changed.
1086 %
1087 % I look forward to the day when \pkg{endfloat} will serve
1088 % no purpose.
1089 %
1090 % \item The \pkg{float} package appears to work in my limited tests.
1091 %
1092 % \item The \pkg{floatrow} package appears to work in my limited tests.
1093 % But please note that the \pkg{endfloat} package needs to be loaded
1094 % \emph{after} the \pkg{floatrow} package.
1095 %
1096 % \item The \pkg{newfloat} package appears to work in my limited tests, too.
1097 %
1098 % \end{itemize}
1099 %
1100 % \section{Support}\label{sec:support}
1101 %
1102 % As is usual, this package is provided with no warranty whatsoever.
1103 % However, it is my desire to make it useful and usable, although
1104 % I may very well fail at that. If you
1105 % need a feature added, see whether the hooks will allow you to
1106 % do what you want. If something goes wrong look over
1107 % \autoref{sec:caveats}.
1108 % \iffalse % Currently this package has no active maintainer
1109 % But if you need to get in touch
1110 % with the maintainer, you should send email at
1111 % \texttt{[email protected]}.
1112 % \fi
1113 %
1114 % \section{History}\label{sec:history}
1115 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
1116 % \changes{v2.1}{1994/06/25}{Use AtEndDocument. jpg}
1117 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
1118 %
1119 % \subsection{The burden of history}
1120 %
1121 % By version 2.2 the file was getting so that most of the bytes
1122 % were things that had been commented out of previous versions,
1123 % and changelog messages. Instead of this making things clearer
1124 % to the maintainer, it turns out to be clutter. I (jpg) have started
1125 % to throw out some of history (it is not really useful to see
1126 % who corrected what typo or cleaned up what extraneous space
1127 % with a |%| in 1991. Although my purge of history is far
1128 % from complete, it should be noted that I do want to preserve
1129 % the spirit of the history. I have already been miscredited
1130 % with original authorship. I have made extensive modifications
1131 % and extensions, but the basic core (even if only a small amount
1132 % of version 2.0 code remains) and concept are JDM's.
1133 %
1134 % \subsection{Author}
1135 % The file was written by Darrell McCauley ([email protected])
1136 % in February and March 1992. He acknowledges that much of the
1137 % guts are adapted from
1138 % \texttt{comment.sty} by Victor Eijkhout ([email protected]).
1139 % So, although Jeff Goldberg ([email protected]) has maintained
1140 % this afterwards, he should not be credited with writing the package,
1141 % but only with extending and maintaining it.
1142 % He has contributed enough so that by version~2.4 he claimed
1143 % co-authorship.
1144 % The same applies to Axel Sommerfeldt ([email protected])
1145 % who build version 2.5 with permission of Jeff Goldberg and has
1146 % maintained this package from version 2.6 to version 2.7.
1147 %
1148 % \subsection{Version 2.7}
1149 %
1150 % Version 2.7 was build by Axel Sommerfeldt ([email protected]),
1151 % and introduces the following changes:
1152 % \begin{itemize}
1153 % \item
1154 % A new package option |disable| has been added which disables the
1155 % functionality of the \pkg{endfloat} package
1156 % (\autoref{sec:options}).
1157 % \item
1158 % A new command |\add|\x|to|\x|delayed|\x|float| has beed added
1159 % which adds code to a specific delayed float type
1160 % (\autoref{sec:addto}).
1161 % \item
1162 % More customization was introduced with the new macros
1163 % |\efloat|\x|begin|, |\efloat|\x|end|, |\efloat|\x|begin|\x|list|,
1164 % and |\efloat|\x|end|\x|list|.
1165 % They can be re-defined by the user to influence the process
1166 % of delayed floats and the typesetting of lists of delayed floats
1167 % (\autoref{sec:customizations}).
1168 % \item
1169 % Unfortunately the bugfix regarding the usage of UTF-8 characters
1170 % in floating environments introduced in version 2.6 was flawed,
1171 % this has been fixed.
1172 % \end{itemize}
1173 %
1174 % \subsection{Version 2.6}
1175 %
1176 % Version 2.6 was build by Axel Sommerfeldt ([email protected]),
1177 % and introduces the following changes:
1178 % \begin{itemize}
1179 % \item
1180 % New package options |no|\x|tables| and |no|\x|figures| have been added
1181 % to allow better control over which floating environments
1182 % will be handled by the \pkg{endfloat} package (\autoref{sec:options}).
1183 % \item
1184 % New macros called |\efloat|\x|type|, |\efloat|\x|heading|, |\efloat|\x|preamble|,
1185 % and |\efloat|\x|postamble| have been added which allow the user more control
1186 % over how the delayed floats are typeset (\autoref{sec:separator}).
1187 % \item
1188 % A percent sign (|%|) is now allowed at the end of |\end|\marg{environment}, too, e.g.:
1189 % \begin{quote}
1190 % |\begin{figure}|\\
1191 % | |\ldots\\
1192 % |\end{figure}%|
1193 % \end{quote}
1194 % \item
1195 % Two bugs have been fixed regarding the usage of UTF-8 characters in floating environments.
1196 % \end{itemize}
1197 %
1198 % \subsection{Version 2.5}
1199 %
1200 % Version 2.5 was build by Axel Sommerfeldt ([email protected])
1201 % with permission of Jeff Goldberg, and introduces the following changes:
1202 % \begin{itemize}
1203 % \item
1204 % New commands
1205 % |\Declare|\x|Delayed|\x|Float| and |\Declare|\x|Delayed|\x|Float|\x|Flavor|
1206 % for handling floating environments other than |figure| and |table|,
1207 % and |\Setup|\x|Delayed|\x|Float| for setting options
1208 % (\autoref{sec:flavor} and \autoref{sec:other}).
1209 % To make this possible a lot of internal code had to be reorganized,
1210 % but by trying to keep original versions of macros and trying to leave the
1211 % operational sequence itself as original as possible this hopefully won't break
1212 % compatibility with existing documents or extensions written for the
1213 % \pkg{endfloat} package.
1214 %
1215 % \item
1216 % New package options |tables|\x|only| and |figures|\x|only| have been added
1217 % to allow better control over which floating environments
1218 % will be handled by the \pkg{endfloat} package (\autoref{sec:options}).
1219 %
1220 % \item
1221 % The \pkg{endfloat} package should cooperate with
1222 % the \pkg{floatrow} package now, at least if you load it \emph{after}
1223 % the \pkg{floatrow} package.
1224 %
1225 % \item
1226 % Older versions of the \pkg{endfloat} package used to process |figure| and
1227 % |table| as starred variant always, but at least version $2.4$ did not.
1228 % It had stored all of them as starred variant into the temporary files, but had
1229 % processed them as non-starred always.
1230 % To make this more consistent the version $2.5$ does store the environments
1231 % as they are now, and processes them the same way, i.e.~non-starred
1232 % variants will be stored and processed as non-starred, and starred variants
1233 % will be stored and processed as starred.
1234 % \end{itemize}
1235 % If you notice a change in behaviour after updating the \pkg{endfloat}
1236 % package to version 2.5, please contact me (Axel) and I'll try to fix this.
1237 %
1238 % \subsection{Version 2.4}
1239 %
1240 % Version 2.4 involves the largest set of additional features
1241 % since at least version 2.2 (which added all the options). Some
1242 % of these are
1243 % \begin{itemize}
1244 %
1245 % \item
1246 % This version adds various user hooks, both as commands:
1247 % |\At|\x|Begin|\x|Figures|, |\At|\x|Begin|\x|Tables|, and
1248 % |\At|\x|Begin|\x|Delayed|\x|Floats| (\autoref{sec:hooks}),
1249 % and |\efloat|\x|separator| (\autoref{sec:separator}).
1250 %
1251 % \item
1252 % Most importantly, there is the addition of a configuration file
1253 % (\autoref{sec:extra}). An example configuration file contains
1254 % code which allows \pkg{endfloat} to work properly with
1255 % the \texttt{sidewaystable} environment of the \pkg{rotating}
1256 % package.
1257 %
1258 % \item
1259 % Additionally, all figures and tables are written as |figure*| and
1260 % |table*| in the temporary files, eliminating the need to force single
1261 % column mode when table and figures are processed.
1262 %
1263 % \item
1264 % There are a fair number of internal changes to the code (which
1265 % make it easier for the various hooks to work).
1266 %
1267 % \item
1268 % Also changed some internal command names, such as |\xtable|,
1269 % which did not include |@| to names that to include |@| such as
1270 % |\ef@extable|. Also renamed all commands |\end...| to something
1271 % else so as to not use up valuable environment name space.
1272 %
1273 % \item
1274 % Removed dead code. It was making this too hard to read.
1275 %
1276 % \item
1277 % Documentation changes to reflect user level changes. Also added
1278 % more to the Caveats section (\autoref{sec:caveats}).
1279 %
1280 % \end{itemize}
1281 %
1282 % During the past few months I have received a wonderful level
1283 % of feedback from users. Many made very useful suggestions.
1284 % Even those queries which resulted from a misunderstanding of
1285 % how to use the package have been lead me to modify the
1286 % documentation. I had intended to acknowledge all of you,
1287 % but the list has grown too long. You know who you are. Thanks,
1288 % and good luck with your journal submissions!
1289 %
1290 % \subsection{Version 2.3}
1291 %
1292 % Very minor changes in the organization of some parts of the
1293 % code, but I fixed a bug I introduced while ``cleaning up'' for
1294 % for version~2.2: I had misunderstood part of the original
1295 % code and commented out a necessary trick to allow for |figure*|
1296 % The bug was very real, so I am releasing this version~2.3 as soon
1297 % as I can document it, and am not waiting to include other planned
1298 % improvements.
1299 %
1300 % \subsection{Version 2.2}
1301 %
1302 % A user (Kate Hedstrom) pointed out a number of bugs and shortcomings,
1303 % which led me (jpg) to finally sit down and make some of the changes
1304 % I had been planning on making. The effect of the |tablesfirst| option
1305 % was specifically requested, and also work on the bug discussed
1306 % in \autoref{sec:buggyheads}. Although my bug fix is partial,
1307 % version 2.2 includes the means to suppress the headers altogether.
1308 %
1309 % \subsubsection{Package options}
1310 %
1311 % I, jpg, have used the package option facility of \LaTeXe\
1312 % to get other options (described in \autoref{sec:options}).
1313 % I also made some cosmetic changes (breaking up lines to reduce
1314 % the number of overfull boxes when printing the documentation,
1315 % line breaks and indentation to make the code more readable.
1316 % I also replaced some |\def|s with |\newcommand|s and
1317 % |\providecommand|s. This are not logged, because I actually
1318 % found that all of the logging information was hampering my
1319 % ability to read and modify the code.
1320 %
1321 % \subsubsection{Internal commands}
1322 %
1323 % In version 2.2, I also replaced some code internal
1324 % to |\xfigure| and |\xtable| with |\efloat@foundendfig|
1325 % and |\efloat@foundendtab|. This was merely a stylistic
1326 % change.
1327 %
1328 % I also deleted some some definitions
1329 % which are not used. These had had probably been left as hooks, but with
1330 % not enough for them to be useful hooks. There are some cases where
1331 % I have left these in when I could see what they could be used for.
1332 % I have tried to add a note as to their potential use.
1333 %
1334 % \subsubsection{Documentation}
1335 %
1336 % Massive changes to user documentation, and some to the code
1337 % documentation.
1338 %
1339 % \subsection{Version 2.1}
1340 %
1341 % I, Jeffrey Goldberg, in June 1994 wanted to use Darrell McCauley's
1342 % \file{endfloat.sty} with \LaTeXe. It worked fine until I
1343 % needed to use the \LaTeXe\ directive |\At|\x|End|\x|Document| for
1344 % some other function, and discovered that it was not functioning
1345 % and that it was because version 2.0 (and earlier) of
1346 % \texttt{endnotes.sty} redefined |\end|\x|document|. The
1347 % fix that I needed was trivial, but it made the file no
1348 % longer compatible with \LaTeX209. As a consequence, it seemed
1349 % that the only way I could make up for this crime was to make
1350 % it fully compatible with \LaTeXe.
1351 %
1352 % \subsection{Minor changes (version 2.0)}
1353 %
1354 % A series of changes and fixes were made in March 1992. Many
1355 % by the original author others by Ronald Kappert ([email protected])
1356 % who replaced literal strings with |\figurename|, and so on; and
1357 % by [email protected] who pointed out gobbling bug with
1358 % |\nomarkersintext|.
1359 %
1360 % \subsection{Brian Junker's modifications (version 2.0)}
1361 %
1362 % Brian Junker ([email protected]) made a number of fixes.
1363 % Here are his change comments:
1364 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
1365 %
1366 % \begin{enumerate}
1367 % \item Changed ``comment" to ``figure" and ``komment" to
1368 % ``table" throughout, to avoid collisions with other
1369 % style files' definitions of ``comment". Also
1370 % fixes |\begin{table}| ends with |\end{komment}|
1371 % error generated by my (older) version of PC\TeX.
1372 %
1373 % \item Fixed gobble of float position specifiers.
1374 % There are two ways to do this:
1375 % \begin{enumerate}
1376 % \item |\write\ifnextchar[{\gobbleuntilnext}{}|
1377 % into every
1378 % environment written to |\jobname.fff|, etc.;
1379 % \item save \LaTeX's old def's of |\figure| and |\table|
1380 % and re-use them when processing fig's and tables.
1381 % I chose the latter approach, for maximum
1382 % consistency with \LaTeX, other style files, etc.
1383 % \end{enumerate}
1384 %
1385 % \item Added def's of |\tablename| and |\figurename|,
1386 % which my version of PC-\TeX\ seemed to need.
1387 % [backward compatibility for earlier versions ---jdm]
1388 %
1389 % \item Moved formatting of figure and table markers to
1390 % |\figure|\x|place| and |\table|\x|place|.
1391 %
1392 % \item Style change: in-text markers are now
1393 % centered reminders like ``[Figure 4 about here.]".
1394 %
1395 % \item Style change: added list of tables and
1396 % figures to the table and figure sections.
1397 % Change back to old format with |\nofiglist| and
1398 % |\notablist|.
1399 %
1400 % \item Changed default to |\markersintext|.
1401 %
1402 % \item Fixed trivial typo in |\@openposttbls|
1403 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
1404 % \end{enumerate}
1405 % All changes marked |% bj| at end of line.
1406 % ---Brian Junker ([email protected])
1407 %
1408 % \section{Wish list}
1409 %
1410 % I doubt that I will really work on this wish list in the near future
1411 % but in addition to solving the know bugs, there is one major sort of
1412 % change that I (jpg) would like to see:
1413 % \begin{itemize}
1414 % \item
1415 % Updating the verbatim writing by using the tools in the
1416 % |verbatim| standard packages, and the |moreverb| package.
1417 % Since they provide more generalized an cleaner verbatim code
1418 % then this which dates back to the earliest days of \LaTeX.
1419 % \end{itemize}
1420 %
1421 % \begin{thebibliography}{1}
1422 %
1423 % \bibitem{Goldberg:lastpage}
1424 % Jeffrey Goldberg.
1425 % \newblock The \texttt{lastpage} package.
1426 % \newblock Electronic documentation
1427 %
1428 % \bibitem{A-W:GMS94}
1429 % Michel Goossens, Frank Mittelbach, and Alexander Samarin.
1430 % \newblock {\em The {\LaTeX} Companion}
1431 % \newblock Addison-Wesley, Reading, Massachusetts, 1994.
1432 %
1433 % \bibitem{LT3:ClassGuide}
1434 % The \LaTeX3 Project.
1435 % \newblock \emph{\LaTeXe\ for class and package writers}
1436 % \newblock (Preliminary draft) June 1994
1437 % \newblock Electronic Documentation
1438 %
1439 % \bibitem{Lingnau:float}
1440 % Anselm Lingnau.
1441 % \newblock An Improved Environment for Floats
1442 % \newblock August 2001 (version~1.3)
1443 % \newblock Electronic Documentation
1444 %
1445 % \bibitem{Lapko:floatrow}
1446 % Olga Lapko.
1447 % \newblock The floatrow package
1448 % \newblock August 2009 (version~0.3)
1449 % \newblock Electronic Documentation
1450 %
1451 % \bibitem{Sommerfeldt:newfloat}
1452 % Axel Sommerfeldt.
1453 % \newblock The newfloat package
1454 % \newblock November 2011 (version~1.0)
1455 % \newblock Electronic Documentation
1456 %
1457 % \bibitem{RahBar:rotating}
1458 % Sebastian Rahtz and Leonor Barroca.
1459 % \newblock A style option for rotated objects in \LaTeX{}
1460 % \newblock April 1994 (version~2)
1461 % \newblock Electronic Documentation
1462 %
1463 % \bibitem{Dekker:ctable}
1464 % Wybo Dekker.
1465 % \newblock The ctable package
1466 % \newblock October 2015 (version~1.31)
1467 % \newblock Electronic Documentation
1468 % \end{thebibliography}
1469 %
1470 % \StopEventually{\PrintIndex\PrintChanges}
1471 % \clearpage
1472 %
1473 % \section{The documentation driver file}
1474 %
1475 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
1476 % The next bit of code contains the documentation driver file for
1477 % \TeX{}, i.e., the file that will produce the documentation you are
1478 % currently reading. It will be extracted from this file by the
1479 % \texttt{docstrip} program.
1480 % \begin{macrocode}
1481 %<*driver>
1482 \documentclass{ltxdoc}
1483 \setlength\hfuzz{2pt} % ignore small overfulls
1484 %
1485 \usepackage{ifpdf}
1486 \ifpdf
1487 \usepackage{mathptmx,courier}
1488 \usepackage[scaled=0.90]{helvet}
1489 \fi
1490 %
1491 \usepackage{hypdoc}
1492 \ifpdf\usepackage{hypdestopt}\fi
1493 \hypersetup{pdfkeywords={LaTeX, package, endfloat},pdfstartpage={},pdfstartview={}}
1494 %
1495 \CodelineIndex
1496 \EnableCrossrefs
1497 %\DisableCrossrefs % Say \DisableCrossrefs if index is ready
1498 %\RecordChanges % Gather update information
1499 \OnlyDescription % comment out for implementation details
1500 \begin{document}
1501 \let\subsectionautorefname\sectionautorefname
1502 \let\subsubsectionautorefname\sectionautorefname
1503 \DocInput{endfloat.dtx}
1504 \end{document}
1505 %</driver>
1506 % \end{macrocode}
1507 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
1508 %
1509 % \section{The implementation}
1510 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
1511 %
1512 % \subsection{File and package identification}
1513 %
1514 % We start by checking if this file was already loaded. If not we
1515 % identify the current version.
1516 % \changes{v2.1}{1994/06/25}{Use LaTeX2e package form. jpg}
1517 % \begin{macrocode}
1518 %<*package>
1519 \NeedsTeXFormat{LaTeX2e}[1994/06/01]
1520 \ProvidesPackage{endfloat}[\filedate\space\fileversion\space
1521 LaTeX2e package puts figures and tables at end (jdm)]
1522 % \end{macrocode}
1523 % \changes{v2.1}{1994/06/25}{Use LaTeX2e package form. jpg}
1524 %
1525 % \subsection{How it was written}
1526 % [this subsection mostly based on jdm's original text.]
1527 %
1528 % Overview: redefine the figure and table environment following
1529 % the |comment| environment of
1530 % \texttt{comment.sty} written by Victor Eijkhout
1531 % \texttt{[email protected]}.
1532 %
1533 % Instead of processing what was between |\begin{...}| and |\end{...}|,
1534 % every line is written to a file (|\jobname.fff| for figures, |\jobname.ttt|
1535 % for tables). Then, when you do an |\end{document}|, the figure section
1536 % is processed, then the table section is processed. The |tablesfirst|
1537 % option changes this order.
1538 %
1539 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
1540 % \changes{v2.1}{1994/06/25}{Use AtEndDocument. jpg}
1541 %
1542 % After initial versions, I [jdm] received much help from Ronald Kappert
1543 % and Brian Junker (see change log below). \emph{Thanks guys!}
1544 %
1545 % \subsection{Define warning message}
1546 %
1547 % Since I, JPG, am making the commands options, I want to warn users
1548 % to use the options, since these commands should be discontinued
1549 % in future versions.
1550 %
1551 % Since these commands are available now for over two decades,
1552 % I, AS, think that it would be a bad idea removing them now.
1553 % So I decided to drop the warning message introduced by JPG instead.
1554 %
1555 % \subsection{Flags}
1556 %
1557 % Put all of the newifs for the user options and flags here.
1558 % Note that these are global flags only,
1559 % the ones bound to a specific environment will be defined
1560 % inside |\Declare|\x|Delayed|\x|Float| instead.
1561 %
1562 % I (as) have added the definition of |\Setup|\x|Delayed|\x|Float|
1563 % here in version 2.5.
1564 %
1565 % \begin{macrocode}
1566 \newif\if@domarkers
1567 \newif\if@tablist % bj
1568 \newif\if@figlist % bj
1569 \newif\if@tabhead
1570 \newif\if@fighead
1571 \newif\if@tablesfirst
1572 \newif\ifefloat@figures % as
1573 \newif\ifefloat@tables % as
1574 \newif\ifefloat@list % as
1575 \newif\ifefloat@head % as
1576 % \end{macrocode}
1577 %
1578 % \begin{macro}{\efloat@syncobsoleteflags}
1579 % The switches |\if@tablist|, |\if@figlist|, |\if@tabhead|, and |\if@fighead|
1580 % are obsolete, but still needed by some old (and unmaintained) document classes
1581 % and packages. So we still support them, and keep them in sync with the values
1582 % actually used by the \pkg{endfloat} package.
1583 % \changes{v2.5c}{2011/12/22}{This macro added. as}
1584 % \begin{macrocode}
1585 \newcommand*\efloat@syncobsoleteflags{%
1586 \efloat@ifflag{tablelist}{\@tablisttrue}{\@tablistfalse}%
1587 \efloat@ifflag{figurelist}{\@figlisttrue}{\@figlistfalse}%
1588 \efloat@ifflag{tablehead}{\@tabheadtrue}{\@tabheadfalse}%
1589 \efloat@ifflag{figurehead}{\@figheadtrue}{\@figheadfalse}}
1590 % \end{macrocode}
1591 % \end{macro}
1592 %
1593 %
1594 % \subsubsection{Default values}
1595 %
1596 % Set default values of all of the (global) flags here.
1597 %
1598 % \begin{macrocode}
1599 \@domarkerstrue
1600 \@tablisttrue
1601 \@figlisttrue
1602 \@tabheadfalse
1603 \@figheadfalse
1604 \@tablesfirstfalse
1605 \efloat@figurestrue % as
1606 \efloat@tablestrue % as
1607 \efloat@listtrue % as
1608 \efloat@headfalse % as
1609 % \end{macrocode}
1610 %
1611 % \begin{macro}{\SetupDelayedFloat}
1612 % While global flags will be set using package options,
1613 % environment specific flags will be set with |\Setup|\x|Delayed|\x|Float|.
1614 % \changes{v2.5}{2011/11/26}{This command added. as}
1615 % \changes{v2.5c}{2011/12/22}{Usage of \cs{efloat@syncobsoleteflags} added. as}
1616 % \changes{v2.7}{2019/04/14}{Text of error message changed. as}
1617 % \begin{macrocode}
1618 \RequirePackage{keyval}
1619 % \end{macrocode}
1620 % \begin{macrocode}
1621 \newcommand*\SetupDelayedFloat[2]{%
1622 \def\efloat@type{#1}%
1623 \setkeys{endfloat}{#2}}
1624 % \end{macrocode}
1625 % \begin{macrocode}
1626 \define@key{endfloat}{list}[true]{\efloat@setkey{list}{#1}}
1627 \define@key{endfloat}{nolist}[]{\efloat@setkey{list}{false}}
1628 \define@key{endfloat}{head}[true]{\efloat@setkey{head}{#1}}
1629 \define@key{endfloat}{nohead}[]{\efloat@setkey{head}{false}}
1630 % \end{macrocode}
1631 % \begin{macrocode}
1632 \newcommand*\efloat@setkey{%
1633 \@expandtwoargs\efloat@@setkey\efloat@type}
1634 \newcommand*\efloat@@setkey[3]{%
1635 \efloat@ifdelayed{#1}{%
1636 \efloat@setflag{#1#2}{#3}%
1637 \efloat@syncobsoleteflags}}
1638 % \end{macrocode}
1639 % \end{macro}
1640 %
1641 % \begin{macro}{\efloat@ifdelayed}
1642 % Check if the given environment is a delayed float type.
1643 % If yes, execute the given code.
1644 % If not, issue an error message.
1645 % \changes{v2.7}{2019/04/14}{This macro added. as}
1646 % \begin{macrocode}
1647 \newcommand\efloat@ifdelayed[2]{%
1648 \@ifundefined{ef@ext@#1}%
1649 {\PackageError{endfloat}%
1650 {`#1' is not a delayed float type}%
1651 {Only environments known to the `endfloat' package are allowed here.}}%
1652 {#2}}%
1653 % \end{macrocode}
1654 % \end{macro}
1655 %
1656 % \begin{macro}{\efloat@ifflag}
1657 % |\efloat@ifflag|\marg{flag}\marg{yes-code}\marg{no-code}
1658 % tests if a flag has been set.
1659 % \changes{v2.5a}{2011/12/04}{This macro added. as}
1660 % \begin{macrocode}
1661 \newcommand*\efloat@ifflag[1]{%
1662 \@nameuse{ef@if@#1}}
1663 % \end{macrocode}
1664 % \end{macro}
1665 %
1666 % \begin{macro}{\efloat@setflag}
1667 % |\efloat@setflag|\marg{flag}\marg{value}
1668 % sets a flag to the given boolean value.
1669 % \changes{v2.5a}{2011/12/04}{This macro added. as}
1670 % \begin{macrocode}
1671 \newcommand*\efloat@setflag[2]{%
1672 \@nameuse{if#2}%
1673 \global\expandafter\let\csname ef@if@#1\endcsname\@firstoftwo
1674 \else
1675 \global\expandafter\let\csname ef@if@#1\endcsname\@secondoftwo
1676 \fi}%
1677 % \end{macrocode}
1678 % \end{macro}
1679 %
1680 % \subsection{Other preliminaries}
1681 %
1682 % I (jpg) have been slowly working at making more and more of the
1683 % code for processing tables and figures common, with the idea
1684 % that once I have factored out all that is common with them
1685 % I will be then be able to set up code for other floats,
1686 % I have still a very long way to go, but common code created
1687 % for version 2.3 is here.
1688 %
1689 % I (as) have added the definition of |\Declare|\x|Delayed|\x|Float|
1690 % and |\Declare|\x|Delayed|\x|Float|\x|Flavor| here in version 2.5.
1691 %
1692 % \begin{macro}{\efloat@newwrite}
1693 % attempt to reduce old |\@openpostfigs| and |\@openposttbls| to
1694 % one command
1695 % The first one calls |\newwrite| so, |\efloat@newwrite{ttt}|
1696 % will have the effect of |\newwrite\efloat@postttt|.
1697 % \begin{macrocode}
1698 \newcommand*\efloat@newwrite[1]{%
1699 \expandafter\newwrite\csname efloat@post#1\endcsname}
1700 % \end{macrocode}
1701 % \end{macro}
1702 %
1703 % \begin{macro}{\efloat@openpost}
1704 % |\efloat@openpost{ttt}| will be the same as
1705 % \begin{quote}
1706 % |\immediate\openout\efloat@postttt=\jobname.ttt\relax|
1707 % \end{quote}
1708 % while also calling |\efloat@setflag{ttt}{true}| to set a flag
1709 % (|@ef@tttopen|) in the case of |ttt|.
1710 % \changes{v2.5a}{2011/12/04}{\cs{ef@setct} replaced by \cs{efloat@setflag}. as}
1711 % \changes{v2.5c}{2011/12/22}{\cs{efloat@setflag} replaced by \cs{ef@setct}. as}
1712 % \begin{macrocode}
1713 \newcommand*\efloat@openpost[1]{%
1714 \expandafter\immediate\expandafter\openout
1715 \csname efloat@post#1\endcsname =\jobname.#1\relax
1716 \ef@setct{#1}{1}%
1717 \message{(\jobname.#1)}}
1718 % \end{macrocode}
1719 % \end{macro}
1720 %
1721 % \begin{macro}{\efloat@closepost}
1722 % Close the file for writing. Set a flag saying so.
1723 % \changes{v2.6}{2018/03/24}{This macro added. as}
1724 % \begin{macrocode}
1725 \newcommand*\efloat@closepost[1]{%
1726 \expandafter\immediate\expandafter\closeout\csname efloat@post#1\endcsname
1727 \ef@setct{#1}{0}}
1728 % \end{macrocode}
1729 % \end{macro}
1730 %
1731 % \begin{macro}{\ef@newct}
1732 % \begin{macro}{\ef@setct}
1733 % \begin{macro}{\ef@ifct}
1734 % |\ef@newct{ttt}| will create a new counter called |\@ef@tttopen|
1735 % and |\ef@setct{ttt}{1}| would set it to 1.\par
1736 % To offer best compatibility to version $2.4$ we still use these counters
1737 % although using |\efloat@setflag{tttopen}{1}| would be a better alternative.
1738 % (Otherwise the \pkg{apa} document class would break.)
1739 % \changes{v2.5c}{2011/12/22}{\cs{ef@ifct} added by as}
1740 % \begin{macrocode}
1741 \newcommand*\ef@newct[1]{%
1742 \expandafter \newcount \csname @ef@#1open\endcsname}
1743 \newcommand*\ef@setct[2]{%
1744 \expandafter\global\csname @ef@#1open\endcsname=#2\relax}
1745 \newcommand*\ef@ifct[1]{%
1746 \expandafter\ifnum \csname @ef@#1open\endcsname>0 \relax
1747 \expandafter\@firstoftwo
1748 \else
1749 \expandafter\@secondoftwo
1750 \fi}
1751 % \end{macrocode}
1752 % \end{macro}
1753 % \end{macro}
1754 % \end{macro}
1755 %
1756 % \begin{macro}{\efloat@condopen}
1757 % Conditionally open a file
1758 % \changes{v2.5a}{2011/12/04}{\cs{ifnum} replaced by \cs{efloat@ifflag}. as}
1759 % \begin{macrocode}
1760 \newcommand*\efloat@condopen[1]{%
1761 \ef@ifct{#1}{}{\efloat@openpost{#1}}}
1762 % \end{macrocode}
1763 % \end{macro}
1764 %
1765 % \begin{macro}{\efloat@iwrite}
1766 % Immediate write to one of these files.
1767 % |\protected@iwrite| was taken from https://tex.stackexchange.com/questions/75951/
1768 % \changes{v2.6}{2018/03/18}{Bugfix: Uses \cs{protected@write} now. as}
1769 % \changes{v2.7}{2019/04/14}{Bugfix: Uses \cs{protected@iwrite} now. as}
1770 % \begin{macrocode}
1771 \providecommand\protected@iwrite[3]{%
1772 \begingroup
1773 \let\thepage\relax
1774 #2%
1775 \let\protect\@unexpandable@protect
1776 \edef\reserved@a{\immediate\write #1{#3}}%
1777 \reserved@a
1778 \endgroup
1779 \if@nobreak\ifvmode\nobreak\fi\fi}
1780 % \end{macrocode}
1781 % \begin{macrocode}
1782 \newcommand\efloat@iwrite[1]{%
1783 \expandafter\protected@iwrite\csname efloat@post#1\endcsname{}}
1784 % \end{macrocode}
1785 % \end{macro}
1786 %
1787 % \begin{macro}{\addtodelayedfloat}
1788 % Immediate write to one of these files.
1789 % While |\efloat@iwrite| is for internal use, this one if for usage in end-user documents.
1790 % \changes{v2.7}{2019/04/14}{This macro added. as}
1791 % \changes{v2.7}{2019/04/15}{Starred variant added. as}
1792 % \begin{macrocode}
1793 \newcommand\addtodelayedfloat{%
1794 \@ifstar{\efloat@addto\@firstofone}{\efloat@addto\detokenize}}
1795 % \end{macrocode}
1796 % \begin{macrocode}
1797 \newcommand\efloat@addto[3]{%
1798 \efloat@ifdelayed{#2}{%
1799 \expandafter\efloat@@addto\expandafter{\csname ef@ext@#2\endcsname}{#1{#3}}}}
1800 % \end{macrocode}
1801 % \begin{macrocode}
1802 \newcommand\efloat@@addto[1]{%
1803 \efloat@condopen{#1}\efloat@iwrite{#1}}
1804 % \end{macrocode}
1805 % \end{macro}
1806 %
1807 % \begin{macro}{\efloatheading}
1808 % This macro changes the page headings.
1809 % By default it is defined to use |\markboth| for this purpose,
1810 % but you may redefine this command in the configuration file or preamble.
1811 % \changes{v2.6}{2018/03/18}{This macro added. as}
1812 % \begin{macrocode}
1813 \providecommand\efloatheading[1]{%
1814 \markboth{\uppercase{#1}}{\uppercase{#1}}}
1815 % \end{macrocode}
1816 % \end{macro}
1817 %
1818 % \begin{macro}{\efloatpreamble}
1819 % |\efloat|\x|preamble| will be typeset in front of the delayed floating environments.
1820 % By default it does nothing; if you want it to be something else,
1821 % you may redefine this command in the configuration file or preamble.
1822 % \changes{v2.6}{2018/03/24}{This macro added. as}
1823 % \begin{macrocode}
1824 \providecommand\efloatpreamble{}
1825 % \end{macrocode}
1826 % \end{macro}
1827 %
1828 % \begin{macro}{\efloatseparator}
1829 % A user suggested that in some cases we may not wish
1830 % to force \pkg{endfloat} to put each float on a page by itself.
1831 % By default that is what it does, by defining |\efloat|\x|separator|
1832 % to be |\clear|\x|page|. If you want it to be something else,
1833 % you may redefine this command in the configuration file or preamble.
1834 % \changes{v2.6}{2018/03/24}{Use \cs{providecommand} instead of \cs{newcommand} to define this macro. as}
1835 % \begin{macrocode}
1836 \providecommand\efloatseparator{\clearpage}
1837 % \end{macrocode}
1838 % \end{macro}
1839 %
1840 % \begin{macro}{\efloatpostamble}
1841 % |\efloat|\x|postamble| will be typeset at the end of the delayed floating environments.
1842 % By default that is what it does, by defining |\efloat|\x|postamble|
1843 % to be |\efloat|\x|separator|. If you want it to be something else,
1844 % you may redefine this command in the configuration file or preamble.
1845 % \changes{v2.6}{2018/03/24}{This macro added. as}
1846 % \begin{macrocode}
1847 \providecommand\efloatpostamble{\efloatseparator}
1848 % \end{macrocode}
1849 % \end{macro}
1850 %
1851 % \begin{macro}{\efloatbegin}
1852 % |\efloatbegin| will be typeset when the processing of the delayed float begins.
1853 % \changes{v2.7}{2019/04/15}{This macro added. as}
1854 % \begin{macrocode}
1855 \providecommand\efloatbegin{\clearpage}
1856 % \end{macrocode}
1857 % \end{macro}
1858 %
1859 % \begin{macro}{\efloatend}
1860 % |\efloatend| will be typeset when the processing of the delayed float ends.
1861 % \changes{v2.7}{2019/04/15}{This macro added. as}
1862 % \begin{macrocode}
1863 \providecommand\efloatend{}
1864 % \end{macrocode}
1865 % \end{macro}
1866 %
1867 % \begin{macro}{\efloatbeginlist}
1868 % |\efloatbeginlist| will be typeset before the list of a delayed float.
1869 % \changes{v2.7}{2019/04/15}{This macro added. as}
1870 % \begin{macrocode}
1871 \providecommand\efloatbeginlist{\normalsize}
1872 % \end{macrocode}
1873 % \end{macro}
1874 %
1875 % \begin{macro}{\efloatendlist}
1876 % |\efloatendlist| will be typeset after the list of a delayed float.
1877 % \changes{v2.7}{2019/04/15}{This macro added. as}
1878 % \begin{macrocode}
1879 \providecommand\efloatendlist{\clearpage}
1880 % \end{macrocode}
1881 % \end{macro}
1882 %
1883 % \begin{macro}{\ef@makeinnocent}
1884 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
1885 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
1886 % \begin{macrocode}
1887 \newcommand*{\ef@makeinnocent}[1]{\catcode`#1=12 }
1888 % \end{macrocode}
1889 % \end{macro}
1890 %
1891 % \begin{macro}{\figurename}
1892 % \begin{macro}{\tablename}
1893 % Make sure that |\tablename| and |\figurename| are defined.
1894 % \begin{macrocode}
1895 \providecommand{\figurename}{Figure}
1896 \providecommand{\tablename}{Table}
1897 % \end{macrocode}
1898 % \end{macro}
1899 % \end{macro}
1900 %
1901 % \begin{macro}{\floatplace}
1902 % Place marker.
1903 % \changes{v1.0b}{1992/03/10}{adaptation for LaTeX 2.09 and
1904 % international namegiving by Ronald Kappert
1905 % [email protected]}
1906 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
1907 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
1908 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
1909 % \changes{v2.5}{2011/11/26}{universalized by as}
1910 % \begin{macrocode}
1911 \newcommand{\floatplace}[1]{%
1912 \begin{center}
1913 [\csname #1name\endcsname~\csname thepost#1\endcsname\ about here.]
1914 \end{center}}
1915 % \end{macrocode}
1916 % \end{macro}
1917 %
1918 % \begin{macro}{\DeclareDelayedFloat}
1919 % This one prepares the given environment for cooperation with the \pkg{endfloat}
1920 % package, i.e.~|figure| resp.~|table|.
1921 % \changes{v2.5}{2011/11/26}{This command added. as}
1922 % \changes{v2.5a}{2011/12/04}{\cs{ef@newct} replaced by \cs{efloat@setflag}. as}
1923 % \changes{v2.5b}{2011/12/05}{Starred variant added. as}
1924 % \changes{v2.5c}{2011/12/22}{\cs{efloat@setflag} replaced by \cs{ef@newct}. as}
1925 % \begin{macrocode}
1926 \newcommand*\DeclareDelayedFloat{%
1927 \@ifstar{\efloat@declare{*}}{\efloat@declare{}}}
1928 \@onlypreamble\DeclareDelayedFloat
1929 % \end{macrocode}
1930 % \begin{macrocode}
1931 \newcommand*\efloat@declare[2]{%
1932 \@testopt{\efloat@@declare{#1}{#2}}{ef#2}}
1933 \@onlypreamble\efloat@declare
1934 % \end{macrocode}
1935 % \begin{macrocode}
1936 \def\efloat@@declare#1#2[#3]#4{%
1937 % \end{macrocode}
1938 % Counters
1939 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
1940 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
1941 % \begin{macrocode}
1942 \newcounter{post#2}%
1943 % \end{macrocode}
1944 % Remember the file extension in |\ef@ext@|\meta{environment}.
1945 % \begin{macrocode}
1946 \edef\@tempa{#3}%
1947 \edef\@tempb{\@nameuse{ext@#2}}%
1948 \ifx\@tempa\@tempb
1949 \PackageError{endfloat}%
1950 {File extension `\@tempa' is already used by the List}%
1951 {Try using a different file extension here, e.g. `ef\expandafter\@gobbletwo\@tempa'.}%
1952 \else
1953 \expandafter\let\csname ef@ext@#2\endcsname\@tempa
1954 \fi
1955 % \end{macrocode}
1956 % Code for opening the |\jobname.fff|
1957 % \begin{macrocode}
1958 \efloat@newwrite{#3}%
1959 \ef@newct{#3}%
1960 % \end{macrocode}
1961 % Place marker
1962 % (Note: The \pkg{float} package uses |\fname@|\textit{X} as float name,
1963 % but we need |\|\textit{X}|name| in |\float|\x|place|.)
1964 % \begin{macrocode}
1965 \@ifundefined{#2name}{\@namedef{#2name}{\@nameuse{fname@#2}}}{}%
1966 \efloat@namedef{#2place}{\floatplace{#2}}%
1967 % \end{macrocode}
1968 % Re-define float.
1969 % \begin{macrocode}
1970 \DeclareDelayedFloatFlavor#1{#2}{#2}%
1971 % \end{macrocode}
1972 % Define the heading title. (Only relevant if option |fighead| is set.)
1973 % \begin{macrocode}
1974 \expandafter\providecommand\csname #2section\endcsname{#4}%
1975 % \end{macrocode}
1976 % \begin{macrocode}
1977 % \end{macrocode}
1978 % Here we set-up the hooks for getting stuff into |\process...|
1979 % commands easily.
1980 % \begin{macrocode}
1981 \efloat@namedef{process#2s@hook}{}%
1982 \edef\@tempb{\def\noexpand\@tempa{\@car#2\@nil}}%
1983 \uppercase\expandafter{\@tempb}%
1984 \edef\@tempb{%
1985 \noexpand\g@addto@macro\noexpand\@tempa{\@cdr#2\@nil}}%
1986 \@tempb
1987 \efloat@namedef{AtBegin\@tempa s}{%
1988 \expandafter\g@addto@macro\csname process#2s@hook\endcsname}%
1989 \expandafter\expandafter\expandafter\let\expandafter
1990 \csname AtBegin\@tempa es\expandafter\endcsname
1991 \csname AtBegin\@tempa s\endcsname
1992 % \end{macrocode}
1993 % \begin{macrocode}
1994 \efloat@namedef{process#2s}{\efloat@process{#3}{#2}}%
1995 \efloat@namedef{process#2es}{\@nameuse{process#2s}}%
1996 % \end{macrocode}
1997 % Flags: Set default values of all of the flags here.
1998 % \begin{macrocode}
1999 \efloat@@setkey{#2}{list}{efloat@list}%
2000 \efloat@@setkey{#2}{head}{efloat@head}%
2001 % \end{macrocode}
2002 % Finally add the environment to the list of delayed floats
2003 % \begin{macrocode}
2004 \@cons\efloat@list{{#2}}}
2005 \@onlypreamble\efloat@@declare
2006 % \end{macrocode}
2007 % \begin{macrocode}
2008 \newcommand*\efloat@list{}
2009 % \end{macrocode}
2010 % \end{macro}
2011 %
2012 % \begin{macro}{\efloat@namedef}
2013 % Same as \cs{@namedef} from the \LaTeX\ kernal,
2014 % but uses \cs{newcommand} instead of \cs{def}.
2015 % \changes{v2.5c}{2011/12/23}{This macro added}
2016 % \begin{macrocode}
2017 \newcommand*\efloat@namedef[1]{%
2018 \expandafter\newcommand\csname #1\endcsname}
2019 % \end{macrocode}
2020 % \end{macro}
2021 %
2022 % \begin{macro}{\DeclareDelayedFloatFlavor}
2023 % \begin{macro}{\DeclareDelayedFloatFlavour}
2024 % This one redefines the given environment, i.e. |figure| resp. |table|.
2025 % While the non-starred variant redefines both variants (non-starred and starred),
2026 % the starred variant only redefines the environment as given.\par
2027 % We do this |\At|\x|Begin|\x|Document| so we are (hopefully) redefining this
2028 % environment as the very last package.
2029 % (Otherwise \pkg{endfloat} would not work with \pkg{floatrow}.)
2030 % \changes{v2.5b}{2011/12/05}{This command added. as}
2031 % \changes{v2.7}{2019/04/14}{Text of error message changed. as}
2032 % \begin{macrocode}
2033 \newcommand*\DeclareDelayedFloatFlavor{%
2034 \@ifstar{\efloat@declareflavor\@gobble}%
2035 {\efloat@declareflavor\@iden}}
2036 \@onlypreamble\DeclareDelayedFloatFlavor
2037 \let\DeclareDelayedFloatFlavour\DeclareDelayedFloatFlavor
2038 \@onlypreamble\DeclareDelayedFloatFlavour
2039 % \end{macrocode}
2040 % \begin{macrocode}
2041 \newcommand*\efloat@declareflavor[3]{%
2042 \efloat@ifdelayed{#3}{%
2043 \efloat@AtBeginDocument{%
2044 \efloat@@declareflavor{#2}{#3}%
2045 #1{\efloat@@declareflavor{#2*}{#3}}}}}
2046 \@onlypreamble\efloat@declareflavor
2047 % \end{macrocode}
2048 % \begin{macrocode}
2049 \newcommand*\efloat@@declareflavor[2]{%
2050 \def\@tempa{\@efloat{#2}{#1}}%
2051 \@ifundefined{efloat@#1@ORI}%
2052 % \end{macrocode}
2053 % Save old definition of the environment.
2054 % \begin{macrocode}
2055 {\expandafter\expandafter\expandafter\let\expandafter
2056 \csname efloat@#1@ORI\expandafter\endcsname
2057 \csname #1\endcsname
2058 % \end{macrocode}
2059 % Restore old definition of the environment at |\efloat@restore|\x|floats|.
2060 % \begin{macrocode}
2061 \expandafter\g@addto@macro\expandafter\efloat@restorefloats\expandafter{%
2062 \expandafter\let
2063 \csname #1\expandafter\endcsname
2064 \csname efloat@#1@ORI\endcsname}%
2065 % \end{macrocode}
2066 % Re-define float.
2067 % \begin{macrocode}
2068 \expandafter\let\csname#1\endcsname\@tempa}%
2069 % \end{macrocode}
2070 % \begin{macrocode}
2071 {\expandafter\ifx\csname#1\endcsname\@tempa \else
2072 \PackageError{endfloat}%
2073 {The environment `#1' was already redefined}%
2074 {You can't use \noexpand\DeclareDelayedFloatFlavor twice for a given environment.}%
2075 \fi}}
2076 \@onlypreamble\efloat@@declareflavor
2077 % \end{macrocode}
2078 % \end{macro}
2079 % \end{macro}
2080 %
2081 % \begin{macro}{\efloat@AtBeginDocument}
2082 % To be compatible to version $2.4$ we usually redefine |\figure| and |\table| immediately.
2083 % But if the \pkg{floatrow} package is loaded we can't, so we have to use
2084 % |\At|\x|Begin|\x|Document| here.
2085 % (Note: |\efloat@At|\x|Begin|\x|Document| will be defined using |\provide|\x|command|
2086 % so document classes and packages can pre-define it if needed.)
2087 % \changes{v2.5c}{2011/12/22}{This command added. as}
2088 % \changes{v2.5d}{2011/12/23}{Revised. as}
2089 % \begin{macrocode}
2090 \@ifpackageloaded{floatrow}{%
2091 \PackageInfo{endfloat}{`floatrow' package detected, delaying redefinitions}
2092 \providecommand*\efloat@AtBeginDocument{\AtBeginDocument}
2093 }{%
2094 \providecommand*\efloat@AtBeginDocument{\@iden}
2095 }
2096 % \end{macrocode}
2097 % \end{macro}
2098 %
2099 % \begin{macro}{\efloat@restorefloats}
2100 % Restore the original definition of all environments (floats and flavors)
2101 % known to the \pkg{endfloat} package.
2102 % This macro will be filled with life by |\Declare|\x|Delayed|\x|Float|\x|Flavor|.
2103 % \changes{v2.5}{2011/11/26}{This macro added by as}
2104 % \begin{macrocode}
2105 \newcommand*\efloat@restorefloats{}
2106 % \end{macrocode}
2107 % \end{macro}
2108 %
2109 % \subsection{Options and (obsolete) Commands}
2110 %
2111 % \begin{macro}{\efloat@SetOption}
2112 % Sets an option (via |\efloat@Setup|) for all environments known to
2113 % the \pkg{endfloat} package.
2114 % \changes{v2.5}{2011/11/26}{This macro added. as}
2115 % \begin{macrocode}
2116 \newcommand*\efloat@SetOption[1]{%
2117 \def\@elt##1{\efloat@Setup{##1}{#1}}%
2118 \efloat@list
2119 \let\@elt\relax}
2120 % \end{macrocode}
2121 % \end{macro}
2122 %
2123 % \begin{macro}{\efloat@Setup}
2124 % Within option code we can't use |\Setup|\x|Delayed|\x|Float| since
2125 % |figure| and |table| are not declared as delayed floating environments yet.
2126 % So we use |\efloat@Setup| instead which will simply collect the settings for
2127 % execution at a later stage.
2128 % \changes{v2.5a}{2011/12/03}{This macro added. as}
2129 % \begin{macrocode}
2130 \newcommand\efloat@Setup[2]{%
2131 \g@addto@macro\efloat@ProcessOptions{%
2132 \SetupDelayedFloat{#1}{#2}}}
2133 % \end{macrocode}
2134 % \end{macro}
2135 %
2136 % \begin{macro}{\efloat@ProcessOptions}
2137 % Processes options setup with |\efloat@Setup|.
2138 % \changes{v2.5a}{2011/12/03}{This macro added. as}
2139 % \begin{macrocode}
2140 \newcommand\efloat@ProcessOptions{%
2141 \let\efloat@SetOption\@undefined
2142 \let\efloat@Setup\@undefined
2143 \let\efloat@ProcessOptions\@undefined}
2144 % \end{macrocode}
2145 % \end{macro}
2146 %
2147 % \begin{macro}{\markersintext}
2148 % \begin{macro}{\nomarkersintext}
2149 % First set up flags and defaults. First set for flagging
2150 % whether markers appear in text.
2151 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
2152 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
2153 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
2154 % \changes{v2.2a}{1994/10/07}{Create new options}
2155 % \begin{macrocode}
2156 \DeclareOption{nomarkers}{\@domarkersfalse}
2157 \DeclareOption{markers}{\@domarkerstrue}
2158 % \end{macrocode}
2159 % \begin{macrocode}
2160 \newcommand{\markersintext}{\@domarkerstrue}
2161 \newcommand{\nomarkersintext}{\@domarkersfalse}
2162 % \end{macrocode}
2163 % \end{macro}
2164 % \end{macro}
2165 %
2166 % \begin{macro}{\dotablist}
2167 % \begin{macro}{\notablist}
2168 % Options for creating lists of Tables \ldots
2169 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
2170 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
2171 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
2172 % \changes{v2.5}{2011/11/26}{We use \cs{SetupDelayedFloat} now. as}
2173 % \begin{macrocode}
2174 \newcommand{\dotablist}{%
2175 \SetupDelayedFloat{table}{list=true}}
2176 \newcommand{\notablist}{%
2177 \SetupDelayedFloat{table}{list=false,head=true}}
2178 % \end{macrocode}
2179 % \end{macro}
2180 % \end{macro}
2181 %
2182 % \begin{macro}{\dofiglist}
2183 % \begin{macro}{\nofiglist}
2184 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
2185 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
2186 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
2187 % \changes{v2.5}{2011/11/26}{We use \cs{SetupDelayedFloat} now. as}
2188 % \ldots and Figures
2189 % \begin{macrocode}
2190 \newcommand{\dofiglist}{%
2191 \SetupDelayedFloat{figure}{list=true}}
2192 \newcommand{\nofiglist}{%
2193 \SetupDelayedFloat{figure}{list=false,head=true}}
2194 % \end{macrocode}
2195 % \end{macro}
2196 % \end{macro}
2197 %
2198 % Now we make options |tablist| and |notablist| and |figlist| and
2199 % |nofiglist|. Note that options will be processed in order of
2200 % the |\DeclareOption| commands in this file. So by placing
2201 % |list| after |nolist| we ensure that if both are specified, |list|
2202 % is in effect.
2203 %
2204 % First two new options
2205 % \begin{macrocode}
2206 \DeclareOption{nolists}{\efloat@listfalse \efloat@SetOption{list=false}}
2207 \DeclareOption{lists}{\efloat@listtrue \efloat@SetOption{list=true}}
2208 % \end{macrocode}
2209 % Now the more specific ones, which must come after the more
2210 % general options to get the right interactions between semi-conflicting
2211 % options.
2212 % \begin{macrocode}
2213 \DeclareOption{notablist}{\efloat@Setup{table}{list=false}}
2214 \DeclareOption{nofiglist}{\efloat@Setup{figure}{list=false}}
2215 \DeclareOption{tablist}{\efloat@Setup{table}{list=true}}
2216 \DeclareOption{figlist}{\efloat@Setup{figure}{list=true}}
2217 % \end{macrocode}
2218 %
2219 % The \texttt{notablist} and \texttt{nofiglist} options still leave
2220 % a section header at the beginning of the tables and figures.
2221 %
2222 % Note again the role that order plays, by placing |fighead| after
2223 % |noheads| it ensures that |fighead| will be in effect if both
2224 % are specified.
2225 % \begin{macrocode}
2226 \DeclareOption{heads}{\efloat@headtrue \efloat@SetOption{head=true}}
2227 \DeclareOption{noheads}{\efloat@headfalse \efloat@SetOption{head=false}}
2228 % \end{macrocode}
2229 % \begin{macrocode}
2230 \DeclareOption{fighead}{\efloat@Setup{figure}{head=true}}
2231 \DeclareOption{tabhead}{\efloat@Setup{table}{head=true}}
2232 \DeclareOption{nofighead}{\efloat@Setup{figure}{head=false}}
2233 \DeclareOption{notabhead}{\efloat@Setup{table}{head=false}}
2234 % \end{macrocode}
2235 % Also need option for putting tables first
2236 % \begin{macrocode}
2237 \DeclareOption{tablesfirst}{\@tablesfirsttrue}
2238 \DeclareOption{figuresfirst}{\@tablesfirstfalse}
2239 % \end{macrocode}
2240 % \changes{v2.5a}{2011/12/03}{Options `tablesonly' and `figuresonly' added. as}
2241 % \begin{macrocode}
2242 \DeclareOption{tablesonly}{\efloat@figuresfalse \efloat@tablestrue}
2243 \DeclareOption{figuresonly}{\efloat@figurestrue \efloat@tablesfalse}
2244 % \end{macrocode}
2245 % \changes{v2.6}{2018/03/04}{Options `tables' and `figures' added. as}
2246 % \begin{macrocode}
2247 \DeclareOption{notables}{\efloat@tablesfalse}
2248 \DeclareOption{nofigures}{\efloat@figuresfalse}
2249 % \end{macrocode}
2250 % Other option stuff
2251 % \changes{v2.7}{2019/01/10}{Option `disable' added. as}
2252 % \begin{macrocode}
2253 \newcommand*\efloat@AtEndDocument{\AtEndDocument}
2254 \DeclareOption{disable}{%
2255 \def\efloat@@declare#1#2[#3]#4{%
2256 \PackageInfo{endfloat}{`#2' is not delayed since option `disable' was specified}}%
2257 \renewcommand*\efloat@declareflavor[3]{}%
2258 \renewcommand*\efloat@@setkey[3]{}%
2259 \renewcommand*\efloat@AtEndDocument{\@gobble}%
2260 \AtBeginDocument{\renewcommand*\processdelayedfloats{}}}
2261 % \end{macrocode}
2262 % \begin{macrocode}
2263 \DeclareOption*{%
2264 \PackageError{endfloat}%
2265 {Unknown option `\CurrentOption'}%
2266 {Please take a look at the documentation of the `endfloat' package.}}
2267 % \end{macrocode}
2268 % Process (global) options
2269 % \begin{macrocode}
2270 \ProcessOptions*
2271 % \end{macrocode}
2272 % For compatibility reasons we still store the original code of `figure' and `table'
2273 % to |\@bfig| and |\@btab| although we don't make use of it anymore.
2274 % \begin{macrocode}
2275 \let\@bfig\figure % bj
2276 \let\@btab\table % bj
2277 % \end{macrocode}
2278 % Declare `figure' and `table' as delayed floating environment, if requested
2279 % \begin{macrocode}
2280 \if@tablesfirst
2281 \ifefloat@tables
2282 \DeclareDelayedFloat{table}[ttt]{Tables}
2283 \fi
2284 \ifefloat@figures
2285 \DeclareDelayedFloat{figure}[fff]{Figures}
2286 \fi
2287 \else
2288 \ifefloat@figures
2289 \DeclareDelayedFloat{figure}[fff]{Figures}
2290 \fi
2291 \ifefloat@tables
2292 \DeclareDelayedFloat{table}[ttt]{Tables}
2293 \fi
2294 \fi
2295 % \end{macrocode}
2296 % Process environment specific options
2297 % \begin{macrocode}
2298 \efloat@ProcessOptions
2299 % \end{macrocode}
2300 %
2301 % \begin{macro}{\thepostfig}
2302 % \begin{macro}{\theposttbl}
2303 % For compatibility reasons we still offer the old counters
2304 % |postfig| and |posttbl|, so existing redefinitions of |\figure|\x|place|
2305 % and |\table|\x|place| resp. existing extensions to the \pkg{endfloat} package
2306 % will still work.
2307 % \begin{macrocode}
2308 \let\c@postfig\c@postfigure
2309 \let\c@posttbl\c@posttable
2310 \newcommand\thepostfig{\thepostfigure}
2311 \newcommand\theposttbl{\theposttable}
2312 % \end{macrocode}
2313 % \end{macro}
2314 % \end{macro}
2315 %
2316 % \subsection{Parsing \texttt{figure} and \texttt{table}}
2317 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
2318 %
2319 % Now we get the utilities for parsing needed to
2320 % get unmodified code into files.
2321 % \begin{macrocode}
2322 \let\efloat@float\relax
2323 % \end{macrocode}
2324 %
2325 % \begin{macro}{\@efloat}
2326 % the {blank space } appearing with |\nomarkersintext| was fixed by adding
2327 % a percent sign (|%|) at strategic locations, determined by setting
2328 % |\tracingcommands=1| ---Darrell
2329 %
2330 % As mentioned by the jdm above, the following is based
2331 % on \texttt{comment.sty}. It appears that the idea is to
2332 % turn off all control sequence processing and read in from
2333 % input each line, until a line is found that looks like
2334 % |\end{figure}|. Thus the actual name of the environment
2335 % is hardcoded into the use of the macros
2336 % (see \autoref{sec:envnames}). ---jpg]
2337 %
2338 % \changes{v1.1}{1992/03/13}{verified that floats were
2339 % used before a section was
2340 % created for them. jdm}
2341 % \changes{v1.2}{1992/03/14}{corrected typo that may have caused figures not
2342 % to be printed. jdm}
2343 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
2344 % \changes{v2.0}{1992/06/02}{Corrected problem of extra blank spaces in
2345 % the output when nomarkersintext was in effect
2346 % (bug reported by [email protected]).
2347 % jdm}
2348 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
2349 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
2350 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
2351 % \changes{v2.5}{2011/11/26}{universalized by as}
2352 % \changes{v2.5b}{2011/12/05}{revised by as}
2353 % \changes{v2.6}{2018/03/18}{Re-defines \cs{efloat@endtestX} and \cs{efloat@enddbltestX}, too. as}
2354 % \changes{v2.6}{2018/03/24}{Writes \cs{efloatseparator} into the file, if necessary. as}
2355 % \begin{macrocode}
2356 \newcommand*\@efloat[1]{%
2357 \expandafter\@@efloat\expandafter{\csname ef@ext@#1\endcsname}{#1}}
2358 % \end{macrocode}
2359 % \begin{macrocode}
2360 \newcommand*\@@efloat[3]{%
2361 % \end{macrocode}
2362 % \begin{macrocode}
2363 % If we have already done one table then the file we write to
2364 % is already open, and there is nothing to do, else open it up.
2365 % \begin{macrocode}
2366 \efloat@condopen{#1}%
2367 % \end{macrocode}
2368 % Write |\efloatseparator| into the file, if necessary.
2369 % \begin{macrocode}
2370 \@nameuse{efloat@separator@#1}%
2371 % \end{macrocode}
2372 % Since the figures are not actually processed until much later, we don't
2373 % use \LaTeX's figure numbering mechanism, but we use our own. Also
2374 % put marker in text (if option set). In the future, I may combine
2375 % the counter for the markers and the counter used as a flag for
2376 % whether the file is open into one thing.
2377 % \begin{macrocode}
2378 \if@domarkers
2379 \stepcounter{post#2}% % bj
2380 \@nameuse{#2place}% % bj
2381 \fi
2382 % \end{macrocode}
2383 % |\@currenvir| (current environment) it set to fool
2384 % latex into expecting the end of this environment
2385 % to match the environment name. It will be used more extensively
2386 % when dealing with the problem discussed in \autoref{sec:envnames}.
2387 % \begin{macrocode}
2388 \def\@currenvir{efloat@float}%
2389 % \end{macrocode}
2390 % Now we set up catcodes for reading in text without processing
2391 % things. But need to make |^^M| special since we want to read
2392 % line by line.
2393 % \begin{macrocode}
2394 \begingroup
2395 \let\do\ef@makeinnocent \dospecials
2396 \ef@makeinnocent\^^L% and whatever other special cases
2397 \endlinechar`\^^M \catcode`\^^M=12 %
2398 % \end{macrocode}
2399 % Patch |\efloat@endtest| so it contains the actual environment name.
2400 % \begin{macrocode}
2401 \efloat@patch\efloat@endtest{#3}% as
2402 \efloat@patch\efloat@enddbltest{#3}% as
2403 \efloat@patch\efloat@endtestX{#3}% as
2404 \efloat@patch\efloat@enddbltestX{#3}% as
2405 % \end{macrocode}
2406 % We have read a |\begin{figure}| to get here. We need to write that
2407 % into the file. \par
2408 % I (jpg) would add the |[htb]| parameters to what
2409 % gets written, but that leaves any float specifiers that had
2410 % been employed by the user wandering around in the floated material.
2411 % \begin{macrocode}
2412 \def\next{\efloat@xfloat{#1}}%
2413 \next\string\begin{#3}}%
2414 % \end{macrocode}
2415 % \end{macro}
2416 %
2417 % \begin{macro}{\efloat@foundend}
2418 % When |\ef@xfigure| is verbatim-like reading the figure it has to
2419 % do some clean-up after it as found the |\end{figure}| or
2420 % |\end{figure*}|. This is it. [this part written by jpg v2.2]\par
2421 % Note that this macro will not be used by the \pkg{endfloat} package
2422 % itself anymore, but we'll leave it here so extensions written for the
2423 % \pkg{endfloat} package which uses it will still work.
2424 % \begin{macrocode}
2425 \newcommand*\efloat@foundend[2]{%
2426 \edef\efloat@enddbltest{\string\end{#2}}%
2427 \efloat@found@end{#1}}
2428 % \end{macrocode}
2429 % \end{macro}
2430 %
2431 % \begin{macro}{\efloat@found@end}
2432 % This is the new version of \cs{efloat@foundend}, actually used
2433 % by this package.
2434 % \changes{v2.5}{2011/11/26}{This variant of \cs{efloat@foundend} added by as}
2435 % \changes{v2.6}{2018/03/24}{Writing \cs{efloatseparator} delayed until next \cs{@efloat}. as}
2436 % \begin{macrocode}
2437 \newcommand*\efloat@found@end[1]{%
2438 % \end{macrocode}
2439 % Write |\end{figure}| into the file, followed by |\efloatseparator|.
2440 % \begin{macrocode}
2441 \efloat@iwrite{#1}{\efloat@enddbltest}%
2442 \global\@namedef{efloat@separator@#1}{%
2443 \efloat@iwrite{#1}{\string\efloatseparator}%
2444 \efloat@iwrite{#1}{ }}%
2445 % \end{macrocode}
2446 % Re-define |\next| so the current floating environment will be closed.
2447 % \begin{macrocode}
2448 \def\next{\endgroup\end{efloat@float}}}
2449 % \end{macrocode}
2450 % \end{macro}
2451 %
2452 % \begin{macro}{\efloat@xfloat}
2453 % |\efloat@xfloat| reads line by line, checking whether each line
2454 % is the |\end{figure}|. If it is, then write out end stuff
2455 % to the file. Otherwise write out read in line to the
2456 % file and do the |\next| line.
2457 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
2458 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
2459 % \changes{v2.5}{2011/11/26}{universalized by as}
2460 % \changes{v2.5}{2011/11/26}{\cs{long} added. as}
2461 % \changes{v2.5c}{2011/12/22}{renamed from \cs{ef@xfigure} to \cs{efloat@xfloat} by as}
2462 % \changes{v2.6}{2018/03/18}{Actual test out-sourced to \cs{efloat@if@end}. as}
2463 % \begin{macrocode}
2464 {\catcode`\^^M=12 \endlinechar=-1 %
2465 \long\gdef\efloat@xfloat#1#2^^M{%
2466 \efloat@if@end{#2}{\efloat@found@end{#1}}{\efloat@iwrite{#1}{#2}}%
2467 \next}}
2468 % \end{macrocode}
2469 % \end{macro}
2470 %
2471 % \begin{macro}{\efloat@if@end}
2472 % |\efloat@if@end| tests if the given argument marks the end of the current floating environment.
2473 % If yes, |\@firstoftwo| will be executed, |\secondoftwo| otherwise.
2474 % \changes{v2.6}{2018/03/18}{This macro added. as}
2475 % \changes{v2.6}{2018/03/18}{Tests \cs{efloat@endtestX} and \cs{efloat@enddbltestX}, too. as}
2476 % \begin{macrocode}
2477 \newcommand\efloat@if@end[1]{%
2478 \def\test{#1}%
2479 \let\efloat@next\@firstoftwo
2480 % \end{macrocode}
2481 % Test for |\end{figure}|
2482 % \begin{macrocode}
2483 \ifx\test\efloat@endtest
2484 % \end{macrocode}
2485 % Test for |\end{figure*}|
2486 % \begin{macrocode}
2487 \else\ifx\test\efloat@enddbltest
2488 % \end{macrocode}
2489 % Test for |\end{figure}%| and |\end{figure*}%|
2490 % \begin{macrocode}
2491 \else\ifx\test\efloat@endtestX
2492 \else\ifx\test\efloat@enddbltestX
2493 % \end{macrocode}
2494 % Finally, if none of the above, we have a line of text in the
2495 % body of the figure which should be written to the file.
2496 % \begin{macrocode}
2497 \else
2498 \let\efloat@next\@secondoftwo
2499 \fi\fi\fi\fi \efloat@next}
2500 % \end{macrocode}
2501 % \end{macro}
2502 %
2503 % \begin{macro}{\efloat@endtest}
2504 % \iffalse
2505 % Generalizing these end\ldots{}test so that they
2506 % can be used for user specified floating environments will
2507 % require more |\expandafter|s then you can shake a stick at.
2508 % I am not looking forward to taking on that task. I should
2509 % look at the version control package to see what I can
2510 % lift from there, since it must be the same problem.
2511 % \fi
2512 % I (as) have generalized this end\ldots{}test so it can be
2513 % used for user specific floating environments as well.
2514 % I did this by simply replacing |figure| with |X|, this will be patched
2515 % to the correct environment name in |\@efloat| by using |\efloat@patch|.
2516 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
2517 % \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
2518 % \changes{v2.5}{2011/11/26}{`figure' replaced by 'X' and documentation modified. as}
2519 % \changes{v2.6}{2018/03/18}{\cs{efloat@endtestX} and \cs{efloat@enddbltestX} are used for the test, too. as}
2520 % \begin{macrocode}
2521 {\escapechar=-1%
2522 \catcode`\#=14 % hash mark is comment character
2523 \catcode`\%=12 # percent sign is other character
2524 \xdef\efloat@endtest{\string\\end\string\{X\string\}}
2525 \xdef\efloat@enddbltest{\string\\end\string\{X\string\}}
2526 \xdef\efloat@endtestX{\string\\end\string\{X\string\}%}
2527 \xdef\efloat@enddbltestX{\string\\end\string\{X\string\}%}
2528 }
2529 % \end{macrocode}
2530 % \begin{macrocode}
2531 \newcommand*\efloat@patch[2]{%
2532 \def\x##1X##2\@nil{\def#1{##1#2##2}}%
2533 \expandafter\x#1\@nil}
2534 % \end{macrocode}
2535 % \end{macro}
2536 %
2537 % \begin{macro}{\ef@xfigure}
2538 % \changes{v2.5c}{2011/12/22}{Revived by as}
2539 % \begin{macro}{\ef@xtable}
2540 % \changes{v2.5c}{2011/12/22}{Revived by as}
2541 % \changes{v2.6}{2018/03/18}{Re-defines \cs{efloat@endtestX} and \cs{efloat@enddbltestX}, too. as}
2542 % Both, |\ef@xfigure| and |\ef@xtable|, are gone with version $2.5$ of the \pkg{endfloat}
2543 % package.
2544 % But unfortunately some old and unmaintained document classes and packages still
2545 % uses these internal macros, so we still provide them to stay compatible.
2546 % \begin{macrocode}
2547 \newcommand*\ef@xfigure{\ef@xfloat{fff}{figure}}
2548 % \end{macrocode}
2549 % \begin{macrocode}
2550 \newcommand*\ef@xtable{\ef@xfloat{ttt}{table}}
2551 % \end{macrocode}
2552 % \begin{macrocode}
2553 \newcommand*\ef@xfloat[2]{%
2554 \efloat@patch\efloat@endtest{#2}%
2555 \efloat@patch\efloat@enddbltest{#2*}%
2556 \efloat@patch\efloat@endtestX{#2}%
2557 \efloat@patch\efloat@enddbltestX{#2*}%
2558 % \end{macrocode}
2559 % \begin{macrocode}
2560 \def\next{\efloat@xfloat{#1}}%
2561 \next}
2562 % \end{macrocode}
2563 % \end{macro}
2564 % \end{macro}
2565 %
2566 % \subsection{Processing Figures and Tables}
2567 %
2568 % \begin{macro}{\AtBeginDelayedFloats}
2569 % Here we set-up the hooks for getting stuff into |\process...|
2570 % commands easily. The command |\g@addto@macro| is defined
2571 % in \file{classes.dtx}. I was about to write it myself, when I realized that
2572 % it must already exist for things like |\AtBeginDocument|.
2573 % \begin{macrocode}
2574 \newcommand*\processdelayedfloats@hook{}
2575 \def\AtBeginDelayedFloats{%
2576 \g@addto@macro\processdelayedfloats@hook}
2577 \newcommand*\processotherdelayedfloats{}
2578 % \end{macrocode}
2579 % \end{macro}
2580 %
2581 % \begin{macro}{\efloat@process}
2582 % |\efloat@process|\marg{file extension}\marg{environment name}
2583 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
2584 % \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
2585 % \changes{v2.5}{2011/11/26}{universalized by as}
2586 % \changes{v2.5a}{2011/12/04}{\cs{ifnum} replaced by \cs{efloat@ifflag}. as}
2587 % \changes{v2.5a}{2011/12/04}{\cs{ef@setct} replaced by \cs{efloat@setflag}. as}
2588 % \changes{v2.5c}{2011/12/22}{\cs{efloat@setflag} replaced by \cs{ef@setct}. as}
2589 % \changes{v2.6}{2018/03/18}{Bugfix: Usage of \cs{makeatletter}\ldots\cs{makeatother} added. as}
2590 % \changes{v2.6}{2018/03/18}{Usage of \cs{markboth} replaced by \cs{efloatheading}. as}
2591 % \changes{v2.6}{2018/03/24}{\cs{efloat@type} replaced by \cs{efloattype}. as}
2592 % \changes{v2.6}{2018/03/24}{Usage of \cs{@input} replaced by \cs{efloat@input}. as}
2593 % \changes{v2.6}{2018/03/24}{Usage of \cs{efloatpreamble} and \cs{efloatpostamble} added. as}
2594 % \changes{v2.7}{2019/04/15}{Usage of \cs{efloatbegin}, \cs{efloatend}, \cs{efloatbeginlist}, and \cs{efloatendlist} added. as}
2595 % \begin{macrocode}
2596 \newcommand*\efloat@process[2]{%
2597 % \end{macrocode}
2598 % First test to see if there are any figures to process.
2599 % If so do it.
2600 % \begin{macrocode}
2601 \ef@ifct{#1}{%
2602 % \end{macrocode}
2603 % Close the file for writing. Set a flag saying so.
2604 % \begin{macrocode}
2605 \efloat@closepost{#1}%
2606 % \end{macrocode}
2607 % Define |\efloat|\x|type| which can be evaluated by user-defined variants of
2608 % |\efloat|\x|heading|, |\efloat|\x|preamble|, |\efloat|\x|separator|, and |\efloat|\x|postamble|.
2609 % \begin{macrocode}
2610 \def\efloattype{#2}% % as
2611 % \end{macrocode}
2612 % \begin{macrocode}
2613 \efloatbegin % bj
2614 % \end{macrocode}
2615 % Deal with headers and list of figures if necessary
2616 % \begin{macrocode}
2617 \efloat@ifflag{#2list}{% % bj
2618 \begingroup
2619 \efloatbeginlist % bj
2620 \efloat@listof{#2}% % bj
2621 \efloatendlist % bj
2622 \endgroup
2623 }{}%
2624 \efloat@ifflag{#2head}{%
2625 \section*{\@nameuse{#2section}}% % bj
2626 % \end{macrocode}
2627 % See the discussion in \autoref{sec:place} for what problem
2628 % the |suppressfloats[t]| is here to solve. If I understand the
2629 % \textit{Companion} correctly (page 144), this was not available
2630 % in previous versions of \LaTeX.
2631 % \begin{macrocode}
2632 \suppressfloats[t]% % jpg
2633 }{}%
2634 \expandafter\expandafter\expandafter\efloatheading % bj
2635 \expandafter\csname #2section\endcsname % bj
2636 % \end{macrocode}
2637 % Use any user defined hooks just before inputting the file.
2638 % \begin{macrocode}
2639 \processdelayedfloat@hook
2640 \@nameuse{process#2s@hook}%
2641 % \end{macrocode}
2642 % Input the file, surrounded by |\efloatpreamble| and |\efloatpostamble|.
2643 % \begin{macrocode}
2644 \efloatpreamble
2645 \efloat@input{\jobname.#1}%
2646 \efloatpostamble
2647 % \end{macrocode}
2648 % \begin{macrocode}
2649 \efloatend % as
2650 }{}}
2651 % \end{macrocode}
2652 % \end{macro}
2653 %
2654 % \begin{macro}{\efloat@input}
2655 % Input the file, surrounded by |\makeatletter| and |\makeatother|
2656 % so characters written as (internal) macros (for example UTF-8 characters)
2657 % will be processed without errors.
2658 % \changes{v2.6}{2018/03/18}{This macro added. as}
2659 % \begin{macrocode}
2660 \newcommand*\efloat@input[1]{%
2661 \makeatletter
2662 \@input{#1}%
2663 \makeatother}
2664 % \end{macrocode}
2665 % \end{macro}
2666 %
2667 % \begin{macro}{\processdelayedfloat@hook}
2668 % For generic changes document classes can use the hook
2669 % |\process|\x|delayed|\x|float@hook|. If the float type is needed,
2670 % it can be extracted from |\efloattype|.
2671 % \changes{v2.5d}{2011/12/25}{This hook added}
2672 % \begin{macrocode}
2673 \newcommand*\processdelayedfloat@hook{}
2674 % \end{macrocode}
2675 % \end{macro}
2676 %
2677 % \begin{macro}{\efloat@listof}
2678 % This one will do the ``List of Figures'' resp. ``List of Tables''.
2679 % \changes{v2.5}{2011/11/26}{This macro added}
2680 % \begin{macrocode}
2681 \newcommand*\efloat@listof[1]{%
2682 % \end{macrocode}
2683 % If no name is given for the list we set it to ``List of \textit{X}'' where
2684 % \textit{X} is the heading given as second mandatory argument
2685 % to |\Declare|\x|Delayed|\x|Float|.
2686 % \begin{macrocode}
2687 \expandafter\providecommand\csname list#1name\endcsname
2688 {List of \@nameuse{#1section}}%
2689 % \end{macrocode}
2690 % If |\listof|\textit{X}|s| is defined, we use it here.
2691 % Otherwise we try using |\listof| (defined by the \pkg{float} and \pkg{floatrow}
2692 % package) instead. If this will fail, too, we have to give up (and issue an error message).
2693 % \begin{macrocode}
2694 \@ifundefined{listof#1s}%
2695 {\@ifundefined{listof}%
2696 {\PackageError{endfloat}%
2697 {Don't know how to make List of `#1'}%
2698 {You could try defining \protect\listof#1s on your own}}%
2699 {\listof{#1}{\@nameuse{list#1name}}}}%
2700 {\@nameuse{listof#1s}}}
2701 % \end{macrocode}
2702 % \end{macro}
2703 %
2704 % \subsubsection{Getting float placement correct} \label{sec:place}
2705 %
2706 % In versions prior to this attempt (v2.2c), when the |heads| options
2707 % were used, the float could could either float to the next page, leaving
2708 % the section header alone, or could float to the top of the page, leaving
2709 % section header at the bottom of the page. The idea here is to change the
2710 % parameters that place floats, to very very strongly
2711 % encourage floats at the bottom of pages.
2712 % It also allows for easy top floats. Thus obviating the need
2713 % for float pages.
2714 % A |\suppressfloats[t]| in the commands
2715 % that issue the headers will make sure that the floats don't float
2716 % above the headers.
2717 %
2718 % \begin{macrocode}
2719 \renewcommand{\bottomfraction}{1.0}
2720 \renewcommand{\topfraction}{1.0}
2721 \renewcommand{\textfraction}{0.0}
2722 % \end{macrocode}
2723 %
2724 % \subsubsection{Calling the processing commands}
2725 %
2726 % \begin{macro}{\processdelayedfloats}
2727 % Note that there is an extra set |{| and |}| so that the
2728 % restoration of the original definitions is in a group and is \emph{not}
2729 % global. If, for some reason, you wish them to be global then use
2730 % something like
2731 % \begin{quote}
2732 % |\makeatletter|\\
2733 % |\g@addto@macro\processdelayedfloats{\efloat@restorefloats}|\\
2734 % |\makeatother|
2735 % \end{quote}
2736 % \changes{v2.5}{2011/11/26}{Process float list instead of |figure| and |table|. as}
2737 % \begin{macrocode}
2738 \newcommand*\processdelayedfloats{{%
2739 % \end{macrocode}
2740 % Here we reset stuff to apply while end stuff is being processed.
2741 % Prior to version 2.4, these were in |\processtables| and |\processfigures|.
2742 % \begin{macrocode}
2743 \def\baselinestretch{1}\normalsize
2744 \efloat@restorefloats
2745 % \end{macrocode}
2746 % The hook comes after those settings so as to override them if desired.
2747 % \begin{macrocode}
2748 \processdelayedfloats@hook
2749 % \end{macrocode}
2750 % Process tables, figures, and others (or figures, tables, others)
2751 % \begin{macrocode}
2752 \efloat@processfloats
2753 \processotherdelayedfloats}}
2754 % \end{macrocode}
2755 % \begin{macrocode}
2756 \newcommand*\efloat@processfloats{%
2757 \let\@tempa\@empty
2758 \def\@elt##1{\g@addto@macro\@tempa{\@nameuse{process##1es}}}%
2759 \efloat@list
2760 \let\@elt\relax
2761 \@tempa}
2762 % \end{macrocode}
2763 % \changes{v1.99}{1992/05/27}{extensive changes by bj}
2764 % \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
2765 % \changes{v2.1}{1994/06/25}{Use AtEndDocument. jpg}
2766 % \begin{macrocode}
2767 \efloat@AtEndDocument{% % jpg
2768 \message{AED endfloat: Processing end Figures and Tables}% % jpg
2769 \onecolumn
2770 \processdelayedfloats }
2771 % \end{macrocode}
2772 % \end{macro}
2773 %
2774 % Use, or don't use, configuration file.
2775 % \begin{macrocode}
2776 \InputIfFileExists{endfloat.cfg}{%
2777 \typeout{*** Using endfloat.cfg ***}}{}
2778 % \end{macrocode}
2779 %
2780 % \begin{macrocode}
2781 %</package>
2782 % \end{macrocode}
2783 %
2784 % \section{Extra macros -- HIGHLY Experimental} \label{sec:config}
2785 %
2786 % \subsection{Getting new delayed environments}
2787 %
2788 % This section used to offer a configuration file which was able
2789 % to integrate the environments |side|ways|figure| and |side|ways|table|
2790 % offered by the \pkg{rotating} package\cite{RahBar:rotating}
2791 % into the \pkg{endfloat} package.\par
2792 % For compatibility reasons we still do, so existing documents
2793 % including |efxmpl.cfg| will still work,~e.g.
2794 % \begin{quote}
2795 % \ldots\\
2796 % |\usepackage{endfloat}|\\
2797 % |\makeatletter|\\
2798 % |\input{efxmpl.cfg}|\\
2799 % |\makeatother|\\
2800 % \ldots
2801 % \end{quote}
2802 %
2803 % \begin{macrocode}
2804 %<*config>
2805 % \end{macrocode}
2806 %
2807 % We must, of course, have use of the rotating package.
2808 % \begin{macrocode}
2809 \RequirePackage{rotating}
2810 % \end{macrocode}
2811 %
2812 % We declare |side|\x|ways|\x|figure| and |side|\x|ways|\x|table| as
2813 % variants of the |figure| resp.~|table| environments.
2814 % \begin{macrocode}
2815 \DeclareDelayedFloatFlavor{sidewaysfigure}{figure}
2816 \DeclareDelayedFloatFlavor{sidewaystable}{table}
2817 % \end{macrocode}
2818 %
2819 % \begin{macrocode}
2820 %</config>
2821 % \end{macrocode}
2822 %
2823 % \emph{Note:}
2824 % If you would like to add support of given floating environments to
2825 % the \pkg{endfloat} package, please do not use configuration files
2826 % but |\Declare|\x|Delayed|\x|Float| and |\Declare|\x|Delayed|\x|Float|\x|Flavor|
2827 % instead.
2828 %
2829 % \Finale
2830 %
2831 \endinput