summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/endfloat/endfloat.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-03-25 21:25:08 +0000
committerKarl Berry <karl@freefriends.org>2018-03-25 21:25:08 +0000
commitcc62a45366aec8d536536f04aca03cdf5a3e6943 (patch)
tree18cbbf74527a2c3817384b7e522546d58cb960f2 /Master/texmf-dist/source/latex/endfloat/endfloat.dtx
parent23d0d97724c62d6df3f1e92c73a6cb6b1fc8d790 (diff)
endfloat (25mar18)
git-svn-id: svn://tug.org/texlive/trunk@47108 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/endfloat/endfloat.dtx')
-rw-r--r--Master/texmf-dist/source/latex/endfloat/endfloat.dtx344
1 files changed, 264 insertions, 80 deletions
diff --git a/Master/texmf-dist/source/latex/endfloat/endfloat.dtx b/Master/texmf-dist/source/latex/endfloat/endfloat.dtx
index 3bab85d61dc..55493db3705 100644
--- a/Master/texmf-dist/source/latex/endfloat/endfloat.dtx
+++ b/Master/texmf-dist/source/latex/endfloat/endfloat.dtx
@@ -1,9 +1,9 @@
\def\filename{endfloat}
-\def\fileversion{v2.5d}
-\def\filedate{2011/12/25}
-\def\docdate{2011/12/05}
+\def\fileversion{v2.6}
+\def\filedate{2018/03/24}
+\def\docdate{2018/03/24}
%
-% \CheckSum{714}
+% \CheckSum{801}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -27,8 +27,8 @@
%% Authors: James Darrell McCauley <jdm5548@diamond.tamu.edu>,
%% Jeff Goldberg <jeffrey@goldmark.org>,
%% Axel Sommerfeldt <axel.sommerfeldt@f-m.fm>
-%% Maintainer: Jeff Goldberg <jeffrey@goldmark.org>
-%% Latest Version: Version 2.5 <November 2011>
+%% Maintainer: Axel Sommerfeldt <axel.sommerfeldt@f-m.fm>
+%% Latest Version: Version 2.6 <March 2018>
% \fi
%
% \DoNotIndex{\documentclass,\usepackage,\hfuzz,\small,\tt,\begin,\end}
@@ -69,11 +69,11 @@
% \and Jeff Goldberg\thanks{JPG (jeffrey@goldmark.org)
% is responsible for all modifications
% from version 2.1 upwards. Since there is almost no original code
-% left, he has claimed co-authorship from version 2.4. He is
-% also the current maintainer.}
+% left, he has claimed co-authorship from version 2.4.}
% \and Axel Sommerfeldt\thanks{Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
% is responsible for all modifications
-% from version 2.5 upwards.}
+% from version 2.5 upwards. He is
+% also the current maintainer.}
% }
%
% \date{\docdate}
@@ -187,7 +187,8 @@
% of what is used in the document as a whole. This can be
% reset to, say 1.4, by using
% \begin{quote}
-% |\AtBeginDelayedFloats{\renewcommand{\baselinestretch}{1.4}}|
+% |\AtBeginDelayedFloats{%|\\
+% | \renewcommand{\baselinestretch}{1.4}}|
% \end{quote}
% which is available from version 2.4. See \autoref{sec:hooks}
% for more discussion.
@@ -228,24 +229,26 @@
% \multicolumn{1}{c}{Default implication} &
% \multicolumn{1}{c}{Descriptions} \\
% \hline
-% |nofiglist| & off & & no list of figures\\
-% |notablist| & off & & no list of tables\\
-% |nolists| & & |nofiglist|, |notablist| & neither list\\
-% |figlist| & on & & list of figures\\
-% |tablist| & on & & list of tables\\
-% |lists| & & |figlist|, |tablist| & list of tables and figures\\
-% |nofighead| & on & & no `Figures' section header\\
-% |notabhead| & on & & no `Tables' section header\\
-% |noheads| & & |nofighead|, |notabhead| & neither of the headers\\
-% |fighead| & off & & `Figures' section header\\
-% |tabhead| & off & & `Tables' section header\\
-% |heads| & & |fighead|, |tabhead| & Both section headers\\
-% |markers| & on & & Place markers in the text\\
-% |nomarkers| & off & & no markers in text\\
-% |tablesfirst| & off & & Put tables before figures\\
-% |figuresfirst| & on & & Put figures before tables\\
-% |tablesonly| & & & Disregard figures\\
-% |figuresonly| & & & Disregard tables\\
+% |nofiglist| & off & & no list of figures \\
+% |notablist| & off & & no list of tables \\
+% |nolists| & & |nofiglist|, |notablist| & neither list \\
+% |figlist| & on & & list of figures \\
+% |tablist| & on & & list of tables \\
+% |lists| & & |figlist|, |tablist| & list of tables and figures \\
+% |nofighead| & on & & no `Figures' section header \\
+% |notabhead| & on & & no `Tables' section header \\
+% |noheads| & & |nofighead|, |notabhead| & neither of the headers \\
+% |fighead| & off & & `Figures' section header \\
+% |tabhead| & off & & `Tables' section header \\
+% |heads| & & |fighead|, |tabhead| & Both section headers \\
+% |markers| & on & & Place markers in the text \\
+% |nomarkers| & off & & no markers in text \\
+% |tablesfirst| & off & & Put tables before figures \\
+% |figuresfirst| & on & & Put figures before tables \\
+% |tablesonly| & off & & Handle tables only \\
+% |figuresonly| & off & & Handle figures only \\
+% |notables| & off & & Disregard tables \\
+% |nofigures| & off & & Disregard figures \\
% \hline
% \end{tabular}
% \end{table}
@@ -253,7 +256,7 @@
% The list of tables and figures can be suppressed by using the
% \texttt{nofiglist} and \texttt{notablist} options. Both
% can be suppressed with the \texttt{nolists} option.\footnote{In
-% versions prior to 2.2 the command for turning of the lists turned
+% versions prior to 2.2 the command for turning off the lists turned
% on the headers (the equivalent of the |heads| option). That is
% not the case with these options. The |lists| and the |heads|
% options are entirely orthogonal.}
@@ -353,7 +356,8 @@
% \\
% |\newcommand\floatplace[1]{%|\\
% | \begin{center}|\\
-% | [\csname #1name\endcsname~\csname thepost#1\endcsname\ about here.]|\\
+% | [\csname #1name\endcsname~%|\\
+% | \csname thepost#1\endcsname\ about here.]|\\
% | \end{center}}|
% \end{quote}
%
@@ -381,6 +385,21 @@
% package, or by redefining |\figure|\x|section| and |\table|\x|section|
% directly).
%
+% \DescribeMacro{\efloatheading}
+% Endfloat uses |\efloat|\x|heading| for applying this heading.
+% By default it is defined to use |\mark|\x|both| for that purpose:
+% \begin{quote}
+% |\newcommand\efloatheading[1]{%|\\
+% | \markboth{\uppercase{#1}}{\uppercase{#1}}}|
+% \end{quote}
+% forcing the headings applied in uppercase. You may change this by using
+% |\re|\x|new|\x|command| to redefine |\efloat|\x|heading| as you wish:
+% \begin{quote}
+% |\renewcommand\efloatheading[1]{|\meta{code that applies \#1 as heading}|}|
+% \end{quote}
+% It makes most sense to place such a redefinition in the configuration
+% file (see \autoref{sec:extra}).
+%
% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
% \changes{v1.0b}{1992/03/10}{adaptation for LaTeX 2.09 and
% international namegiving by Ronald Kappert
@@ -394,8 +413,8 @@
% \DescribeMacro{\AtBeginDelayedFloats}
% If you wish to have some more control over how the tables and figures
% are processed, you can make use of the commands |\At|\x|Begin|\x|Delayed|\x|Floats|,
-% |\At|\x|Begin|\x|Figures| and
-% |\At|\x|Begin|\x|Tables|. If you wanted to ensure that the tables begin
+% |\At|\x|Begin|\x|Figures|, and |\At|\x|Begin|\x|Tables|.
+% If you wanted to ensure that the tables begin
% on a recto page, you could for example say something like
% |\At|\x|Begin|\x|Tables{\clear|\x|double|\x|page}| in the preamble of your
% document.\footnote{It is difficult for me to imagine a situation where
@@ -439,22 +458,43 @@
%
% \section{Several floats per page}\label{sec:separator}
%
+% \DescribeMacro{\efloatpreamble}
+% Endfloat applies |\efloat|\x|preamble| before typesetting the very first
+% (delayed) float in their respective files.
+% By default it is defined to do nothing.
+% You may change this by using
+% |\re|\x|new|\x|command| to redefine |\efloat|\x|preamble| as you wish.
+%
+% \medskip
+%
% \DescribeMacro{\efloatseparator}
-% Endfloat places \verb"\efloatseparator" after each float in their
-% respective files. By default it is defined to be \verb"\clearpage"
+% Endfloat places |\efloat|\x|separator| between the floats in their
+% respective files. By default it is defined to be |\clear|\x|page|
% forcing one float per page. You may change this by using
-% \verb"\renewcommand" to redefine \verb"\efloatseparator" as you wish.
-% One possibility, suggested by a user,
-% is
+% |\re|\x|new|\x|command| to redefine |\efloat|\x|separator| as you wish.
+% One possibility, suggested by a user, is
% \begin{quote}
% |\renewcommand{\efloatseparator}{\mbox{}}|
% \end{quote}
-% It makes most sense to place such a redefinition in the configuration
+%
+% \DescribeMacro{\efloatpostamble}
+% Endfloat applies |\efloat|\x|postamble| after typesetting the very last
+% (delayed) float in their respective files.
+% By default it is defined to be |\efloat|\x|separator|.
+% You may change this by using
+% |\re|\x|new|\x|command| to redefine |\efloat|\x|postamble| as you wish.
+%
+% \medskip
+%
+% It makes most sense to place such redefinitions in the configuration
% file (see \autoref{sec:extra}).
%
-% Do not be mislead by my misleading name for this command. This
-% actually appears after each float including the last one, so is
-% not truly a separator.
+% \medskip
+%
+% \DescribeMacro{\efloattype}
+% If you need to know what floats are actually processed, you could draw on
+% |\efloat|\x|type| which is set to the environment type currently processed,
+% for example |figure| or |table|.
%
% \section{Configuration file and other end environments}\label{sec:extra}
%
@@ -632,8 +672,8 @@
% \subsection[Changing list and caption appearance]
% {Changing the appearence of ``lists of'' and captions}
%
-% When the |lists| option is used, the \LaTeX\ commands |\listoftables|
-% and |\listoffigures| are called. These produce lists indicating
+% When the |lists| option is used, the \LaTeX\ commands |\list|\-|of|\-|tables|
+% and |\list|\-|of|\-|figures| are called. These produce lists indicating
% the page number that each table or figure appear on. With \pkg{endfloat}
% in use this information is usually superfluous, and -- rumor has it --
% undesirable by at least some journals.
@@ -774,6 +814,10 @@
% \begin{quote}
% |\end{figure}|
% \end{quote}
+% or
+% \begin{quote}
+% |\end{figure}%|
+% \end{quote}
% must appear on lines by themselves without any whitespace before
% or after them. A complete reimplementation of the most difficult
% part of the package is required to fix this limitation, but
@@ -1057,8 +1101,8 @@
% need a feature added, see whether the hooks will allow you to
% do what you want. If something goes wrong look over
% \autoref{sec:caveats}. But if you need to get in touch
-% with the maintainer, you should send email to me at
-% \texttt{jeffrey@goldmark.org}.
+% with the maintainer, you should send email at
+% \texttt{axel.sommerfeldt@f-m.fm}.
%
% \section{History}\label{sec:history}
% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
@@ -1091,6 +1135,30 @@
% maintaining it. He has contributed enough so that by version~2.4
% he claimed co-authorship.
%
+% \subsection{Version 2.6}
+%
+% Version 2.6 was build by Axel Sommerfeldt (axel.sommerfeldt@f-m.fm),
+% and introduces the following changes:
+% \begin{itemize}
+% \item
+% New package options |no|\x|tables| and |no|\x|figures| have been added
+% to allow better control over which floating environments
+% will be handled by the \pkg{endfloat} package.
+% \item
+% New macros called |\efloat|\x|type|, |\efloat|\x|heading|, |\efloat|\x|preamble|,
+% and |efloat|\x|postamble| have been added which allow the user more control
+% over how the delayed floats are typeset.
+% \item
+% A percent sign (|%|) is now allowed at the end of |\end|\marg{environment}, too, e.g.:
+% \begin{quote}
+% |\begin{figure}|\\
+% | |\ldots\\
+% |\end{figure}%|
+% \end{quote}
+% \item
+% Two bugs have been fixed regarding the usage of UTF-8 characters in floating environments.
+% \end{itemize}
+%
% \subsection{Version 2.5}
%
% Version 2.5 was build by Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
@@ -1235,10 +1303,10 @@
%
% I, Jeffrey Goldberg, in June 1994 wanted to use Darrell McCauley's
% \file{endfloat.sty} with \LaTeXe. It worked fine until I
-% needed to use the \LaTeXe\ directive |\AtEndDocument| for
+% needed to use the \LaTeXe\ directive |\At|\x|End|\x|Document| for
% some other function, and discovered that it was not functioning
% and that it was because version 2.0 (and earlier) of
-% \texttt{endnotes.sty} redefined |\enddocument|. The
+% \texttt{endnotes.sty} redefined |\end|\x|document|. The
% fix that I needed was trivial, but it made the file no
% longer compatible with \LaTeX209. As a consequence, it seemed
% that the only way I could make up for this crime was to make
@@ -1282,7 +1350,7 @@
% [backward compatibility for earlier versions ---jdm]
%
% \item Moved formatting of figure and table markers to
-% |\figureplace| and |\tableplace|.
+% |\figure|\x|place| and |\table|\x|place|.
%
% \item Style change: in-text markers are now
% centered reminders like ``[Figure 4 about here.]".
@@ -1603,6 +1671,16 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\efloat@closepost}
+% Close the file for writing. Set a flag saying so.
+% \changes{v2.6}{2018/03/24}{This macro added. as}
+% \begin{macrocode}
+\newcommand*\efloat@closepost[1]{%
+ \expandafter\immediate\expandafter\closeout\csname efloat@post#1\endcsname
+ \ef@setct{#1}{0}}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\ef@newct}
% \begin{macro}{\ef@setct}
% \begin{macro}{\ef@ifct}
@@ -1614,7 +1692,7 @@
% \changes{v2.5c}{2011/12/22}{\cs{ef@ifct} added by as}
% \begin{macrocode}
\newcommand*\ef@newct[1]{%
- \expandafter \newcount \csname @ef@#1open\endcsname}
+ \expandafter \newcount \csname @ef@#1open\endcsname}
\newcommand*\ef@setct[2]{%
\expandafter\global\csname @ef@#1open\endcsname=#2\relax}
\newcommand*\ef@ifct[1]{%
@@ -1639,20 +1717,53 @@
%
% \begin{macro}{\efloat@iwrite}
% Immediate write to one of these files.
+% \changes{v2.6}{2018/03/18}{Bugfix: Uses \cs{protected@write} now. as}
% \begin{macrocode}
\newcommand\efloat@iwrite[1]{%
- \expandafter\immediate\expandafter\write\csname efloat@post#1\endcsname}
+ \immediate\expandafter\protected@write\csname efloat@post#1\endcsname{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\efloatheading}
+% This macro changes the page headings.
+% By default it is defined to use |\markboth| for this purpose,
+% but you may redefine this command in the configuration file or preamble.
+% \changes{v2.6}{2018/03/18}{This macro added. as}
+% \begin{macrocode}
+\providecommand\efloatheading[1]{\markboth{\uppercase{#1}}{\uppercase{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\efloatpreamble}
+% |\efloat|\x|preamble| will be typeset in front of the delayed floating environments.
+% By default it does nothing; if you want it to be something else,
+% you may redefine this command in the configuration file or preamble.
+% \changes{v2.6}{2018/03/24}{This macro added. as}
+% \begin{macrocode}
+\providecommand\efloatpreamble{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\efloatseparator}
% A user suggested that in some cases we may not wish
-% to force \pkg{endfloat} to put each float on a page by itself. By
-% default that is what it does, by defining \verb"\efloatseparator"
-% to be \verb"\clearpage". If you want it to be something else,
+% to force \pkg{endfloat} to put each float on a page by itself.
+% By default that is what it does, by defining |\efloat|\x|separator|
+% to be |\clear|\x|page|. If you want it to be something else,
+% you may redefine this command in the configuration file or preamble.
+% \changes{v2.6}{2018/03/24}{Use \cs{providecommand} instead of \cs{newcommand} to define this macro. as}
+% \begin{macrocode}
+\providecommand{\efloatseparator}{\clearpage}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\efloatpostamble}
+% |\efloat|\x|postamble| will be typeset at the end of the delayed floating environments.
+% By default that is what it does, by defining |\efloat|\x|postamble|
+% to be |\efloat|\x|separator|. If you want it to be something else,
% you may redefine this command in the configuration file or preamble.
+% \changes{v2.6}{2018/03/24}{This macro added. as}
% \begin{macrocode}
-\newcommand{\efloatseparator}{\clearpage}
+\providecommand\efloatpostamble{\efloatseparator}
% \end{macrocode}
% \end{macro}
%
@@ -1906,7 +2017,8 @@
% \changes{v2.5a}{2011/12/03}{This macro added. as}
% \begin{macrocode}
\newcommand\efloat@Setup[2]{%
- \g@addto@macro\efloat@ProcessOptions{\SetupDelayedFloat{#1}{#2}}}
+ \g@addto@macro\efloat@ProcessOptions{%
+ \SetupDelayedFloat{#1}{#2}}}
% \end{macrocode}
% \end{macro}
%
@@ -2019,6 +2131,11 @@
\DeclareOption{tablesonly}{\efloat@figuresfalse \efloat@tablestrue}
\DeclareOption{figuresonly}{\efloat@figurestrue \efloat@tablesfalse}
% \end{macrocode}
+% \changes{v2.6}{2018/03/04}{Options `tables' and `figures' added. as}
+% \begin{macrocode}
+\DeclareOption{notables}{\efloat@tablesfalse}
+\DeclareOption{nofigures}{\efloat@figuresfalse}
+% \end{macrocode}
% Other option stuff
% \begin{macrocode}
\DeclareOption*{%
@@ -2109,6 +2226,8 @@
% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
% \changes{v2.5}{2011/11/26}{universalized by as}
% \changes{v2.5b}{2011/12/05}{revised by as}
+% \changes{v2.6}{2018/03/18}{Re-defines \cs{efloat@endtestX} and \cs{efloat@enddbltestX}, too. as}
+% \changes{v2.6}{2018/03/24}{Writes \cs{efloatseparator} into the file, if necessary. as}
% \begin{macrocode}
\newcommand*\@efloat[1]{%
\expandafter\@@efloat\expandafter{\csname ef@ext@#1\endcsname}{#1}}
@@ -2122,6 +2241,10 @@
% \begin{macrocode}
\efloat@condopen{#1}%
% \end{macrocode}
+% Write |\efloatseparator| into the file, if necessary.
+% \begin{macrocode}
+ \@nameuse{efloat@separator@#1}%
+% \end{macrocode}
% Since the figures are not actually processed until much later, we don't
% use \LaTeX's figure numbering mechanism, but we use our own. Also
% put marker in text (if option set). In the future, I may combine
@@ -2153,6 +2276,8 @@
% \begin{macrocode}
\efloat@patch\efloat@endtest{#3}% as
\efloat@patch\efloat@enddbltest{#3}% as
+ \efloat@patch\efloat@endtestX{#3}% as
+ \efloat@patch\efloat@enddbltestX{#3}% as
% \end{macrocode}
% We have read a |\begin{figure}| to get here. We need to write that
% into the file. \par
@@ -2183,17 +2308,25 @@
% This is the new version of \cs{efloat@foundend}, actually used
% by this package.
% \changes{v2.5}{2011/11/26}{This variant of \cs{efloat@foundend} added by as}
+% \changes{v2.6}{2018/03/24}{Writing \cs{efloatseparator} delayed until next \cs{@efloat}. as}
% \begin{macrocode}
\newcommand*\efloat@found@end[1]{%
+% \end{macrocode}
+% Write |\end{figure}| into the file, followed by |\efloatseparator|.
+% \begin{macrocode}
\efloat@iwrite{#1}{\efloat@enddbltest}%
- \def\next{\endgroup\end{efloat@float}%
+ \global\@namedef{efloat@separator@#1}{%
\efloat@iwrite{#1}{\string\efloatseparator}%
- \efloat@iwrite{#1}{ }}}%
+ \efloat@iwrite{#1}{ }}%
+% \end{macrocode}
+% Re-define |\next| so the current floating environment will be closed.
+% \begin{macrocode}
+ \def\next{\endgroup\end{efloat@float}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\efloat@xfloat}
-% |\ef@xfloat| reads line by line, checking whether each line
+% |\efloat@xfloat| reads line by line, checking whether each line
% is the |\end{figure}|. If it is, then write out end stuff
% to the file. Otherwise write out read in line to the
% file and do the |\next| line.
@@ -2202,28 +2335,44 @@
% \changes{v2.5}{2011/11/26}{universalized by as}
% \changes{v2.5}{2011/11/26}{\cs{long} added. as}
% \changes{v2.5c}{2011/12/22}{renamed from \cs{ef@xfigure} to \cs{efloat@xfloat} by as}
+% \changes{v2.6}{2018/03/18}{Actual test out-sourced to \cs{efloat@if@end}. as}
% \begin{macrocode}
{\catcode`\^^M=12 \endlinechar=-1 %
- \long\gdef\efloat@xfloat#1#2^^M{\def\test{#2}%
+ \long\gdef\efloat@xfloat#1#2^^M{%
+ \efloat@if@end{#2}{\efloat@found@end{#1}}{\efloat@iwrite{#1}{#2}}%
+ \next}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\efloat@if@end}
+% |\efloat@if@end| tests if the given argument marks the end of the current floating environment.
+% If yes, |\@firstoftwo| will be executed, |\secondoftwo| otherwise.
+% \changes{v2.6}{2018/03/18}{This macro added. as}
+% \changes{v2.6}{2018/03/18}{Tests \cs{efloat@endtestX} and \cs{efloat@enddbltestX}, too. as}
+% \begin{macrocode}
+\newcommand\efloat@if@end[1]{%
+ \def\test{#1}%
+ \let\efloat@next\@firstoftwo
% \end{macrocode}
% Test for |\end{figure}|
% \begin{macrocode}
\ifx\test\efloat@endtest
- \efloat@found@end{#1}%
% \end{macrocode}
% Test for |\end{figure*}|
% \begin{macrocode}
\else\ifx\test\efloat@enddbltest
- \efloat@found@end{#1}%
+% \end{macrocode}
+% Test for |\end{figure}%| and |\end{figure*}%|
+% \begin{macrocode}
+ \else\ifx\test\efloat@endtestX
+ \else\ifx\test\efloat@enddbltestX
% \end{macrocode}
% Finally, if none of the above, we have a line of text in the
% body of the figure which should be written to the file.
% \begin{macrocode}
\else
- \efloat@iwrite{#1}{#2}%
-% \end{macrocode}
-% \begin{macrocode}
- \fi \fi \next}}
+ \let\efloat@next\@secondoftwo
+ \fi\fi\fi\fi \efloat@next}
% \end{macrocode}
% \end{macro}
%
@@ -2243,10 +2392,15 @@
% \changes{v2.1}{1994/06/25}{Use LaTeX2e documentation form. jpg}
% \changes{v2.1b}{1994/07/03}{Modify documentation -jpg}
% \changes{v2.5}{2011/11/26}{`figure' replaced by 'X' and documentation modified. as}
+% \changes{v2.6}{2018/03/18}{\cs{efloat@endtestX} and \cs{efloat@enddbltestX} are used for the test, too. as}
% \begin{macrocode}
{\escapechar=-1%
+ \catcode`\#=14 % hash mark is comment character
+ \catcode`\%=12 # percent sign is other character
\xdef\efloat@endtest{\string\\end\string\{X\string\}}
\xdef\efloat@enddbltest{\string\\end\string\{X\string\}}
+ \xdef\efloat@endtestX{\string\\end\string\{X\string\}%}
+ \xdef\efloat@enddbltestX{\string\\end\string\{X\string\}%}
}
% \end{macrocode}
% \begin{macrocode}
@@ -2260,6 +2414,7 @@
% \changes{v2.5c}{2011/12/22}{Revived by as}
% \begin{macro}{\ef@xtable}
% \changes{v2.5c}{2011/12/22}{Revived by as}
+% \changes{v2.6}{2018/03/18}{Re-defines \cs{efloat@endtestX} and \cs{efloat@enddbltestX}, too. as}
% Both, |\ef@xfigure| and |\ef@xtable|, are gone with version $2.5$ of the \pkg{endfloat}
% package.
% But unfortunately some old and unmaintained document classes and packages still
@@ -2274,6 +2429,10 @@
\newcommand*\ef@xfloat[2]{%
\efloat@patch\efloat@endtest{#2}%
\efloat@patch\efloat@enddbltest{#2*}%
+ \efloat@patch\efloat@endtestX{#2}%
+ \efloat@patch\efloat@enddbltestX{#2*}%
+% \end{macrocode}
+% \begin{macrocode}
\def\next{\efloat@xfloat{#1}}%
\next}
% \end{macrocode}
@@ -2303,6 +2462,11 @@
% \changes{v2.5a}{2011/12/04}{\cs{ifnum} replaced by \cs{efloat@ifflag}. as}
% \changes{v2.5a}{2011/12/04}{\cs{ef@setct} replaced by \cs{efloat@setflag}. as}
% \changes{v2.5c}{2011/12/22}{\cs{efloat@setflag} replaced by \cs{ef@setct}. as}
+% \changes{v2.6}{2018/03/18}{Bugfix: Usage of \cs{makeatletter}\ldots\cs{makeatother} added. as}
+% \changes{v2.6}{2018/03/18}{Usage of \cs{markboth} replaced by \cs{efloatheading}. as}
+% \changes{v2.6}{2018/03/24}{\cs{efloat@type} replaced by \cs{efloattype}. as}
+% \changes{v2.6}{2018/03/24}{Usage of \cs{@input} replaced by \cs{efloat@input}. as}
+% \changes{v2.6}{2018/03/24}{Usage of \cs{efloatpreamble} and \cs{efloatpostamble} added. as}
% \begin{macrocode}
\newcommand*\efloat@process[2]{%
% \end{macrocode}
@@ -2313,44 +2477,64 @@
% \end{macrocode}
% Close the file for writing. Set a flag saying so.
% \begin{macrocode}
- \expandafter\immediate\expandafter\closeout\csname efloat@post#1\endcsname
- \ef@setct{#1}{0}%
+ \efloat@closepost{#1}%
+% \end{macrocode}
+% Define |\efloat|\x|type| which can be evaluated by user-defined variants of
+% |\efloat|\x|heading|, |\efloat|\x|preamble|, |\efloat|\x|separator|, and |\efloat|\x|postamble|.
+% \begin{macrocode}
+ \def\efloattype{#2}% % as
% \end{macrocode}
% Deal with headers and list of figures if necessary
% \begin{macrocode}
- \clearpage % bj
- \efloat@ifflag{#2list}{% % bj
- {\normalsize\efloat@listof{#2}}% % bj
- \clearpage % bj
+ \clearpage % bj
+ \efloat@ifflag{#2list}{% % bj
+ {\normalsize\efloat@listof{#2}}% % bj
+ \clearpage % bj
}{}%
\efloat@ifflag{#2head}{%
- \section*{\@nameuse{#2section}}% % bj
+ \section*{\@nameuse{#2section}}% % bj
% \end{macrocode}
% See the discussion in \autoref{sec:place} for what problem
% the |suppressfloats[t]| is here to solve. If I understand the
% \textit{Companion} correctly (page 144), this was not available
% in previous versions of \LaTeX.
% \begin{macrocode}
- \suppressfloats[t]% % jpg
+ \suppressfloats[t]% % jpg
}{}%
- \markboth % bj
- {\expandafter\uppercase\expandafter{\csname #2section\endcsname}}% bj
- {\expandafter\uppercase\expandafter{\csname #2section\endcsname}}% bj
+ \expandafter\expandafter\expandafter\efloatheading % bj
+ \expandafter\csname #2section\endcsname % bj
% \end{macrocode}
% Use any user defined hooks just before inputting the file.
% \begin{macrocode}
- \def\efloat@type{#2}%
\processdelayedfloat@hook
\@nameuse{process#2s@hook}%
- \@input{\jobname.#1}%
+% \end{macrocode}
+% Input the file, surrounded by |\efloatpreamble| and |\efloatpostamble|.
+% \begin{macrocode}
+ \efloatpreamble
+ \efloat@input{\jobname.#1}%
+ \efloatpostamble
}{}}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\efloat@input}
+% Input the file, surrounded by |\makeatletter| and |\makeatother|
+% so characters written as (internal) macros (for example UTF-8 characters)
+% will be processed without errors.
+% \changes{v2.6}{2018/03/18}{This macro added. as}
+% \begin{macrocode}
+\newcommand*\efloat@input[1]{%
+ \makeatletter
+ \@input{#1}%
+ \makeatother}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\processdelayedfloat@hook}
% For generic changes document classes can use the hook
% |\process|\x|delayed|\x|float@hook|. If the float type is needed,
-% it can be extracted from |\efloat@type|.
+% it can be extracted from |\efloattype|.
% \changes{v2.5d}{2011/12/25}{This hook added}
% \begin{macrocode}
\newcommand*\processdelayedfloat@hook{}
@@ -2447,7 +2631,7 @@
% \changes{v2.1}{1994/06/25}{Modify documentation text. jpg}
% \changes{v2.1}{1994/06/25}{Use AtEndDocument. jpg}
% \begin{macrocode}
-\AtEndDocument{% % jpg
+\AtEndDocument{% % jpg
\message{AED endfloat: Processing end Figures and Tables}% % jpg
\onecolumn
\processdelayedfloats }