summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/plates/endplate.sty
blob: e588ce97c5907d17bc1248311dd5bd62b2b24e16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
%This is a modified file of endfloat.sty for use with
%plates.sty package.  This file is only designed to
%be internally called from plates.
%
%Anthony Tanbakuchi
%Mar.19.2002
%
%
%%
%% This is file `endfloat.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% endfloat.dtx  (with options: `package')
%% 
%% IMPORTANT NOTICE:
%% This is part of a set of tools (or better yet, experiments) written
%% by Jeff Goldberg (j.goldberg@Cranfield.ac.uk), who is writting this
%% not only for it utility value, but as part of the process of learning
%% LaTeX.  These tools are far from perfect, and comments are welcome.
%% 
%% The usual disclaimers apply:  If it doesn't work right that's your
%% problem (but do let me know).
%% 
%% The usual GNU-style conditions apply: If you change it, you take
%% the blame; if you pass it on, pass on all present condiditions;
%% 
\def\filename{endplate}
\def\fileversion{v2.4i}
\def\filedate{1995/10/11}
\def\docdate {1995/10/11}
%% \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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
%% Description: LaTeX style to put plates and tables at end of article
%% Keywords: LaTeX, style-option, float, plate, table
%% Authors: James Darrell McCauley <jdm5548@diamond.tamu.edu>,
%% Jeff Goldberg <j.goldberg@cranfield.ac.uk>
%% Maintainer: Jeff Goldberg <J.Goldberg@Cranfield.ac.uk>
%% Latest Version: Version 2.4i <October 1995>
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{endplate}[2002/03/18 v0.1 endplates for plates package by AT]
\newcommand{\ef@OldCmd}[2]{\PackageWarning{endplate}
  {The command \protect#1 is obsolete and will be\MessageBreak
   omitted from future releases of the endfloat package.\MessageBreak
   Use the package option `#2' instead.}}
\newif\if@domarkers
\newif\if@figlist                % bj
\newif\if@fighead
\@domarkerstrue
\@figlisttrue
\@figheadfalse
\DeclareOption{nomarkers}{\@domarkersfalse }
\DeclareOption{markers}{\@domarkerstrue }
\newcommand{\markersintext}{\@domarkerstrue
   \ef@OldCmd{\markersintext}{markers}}
\newcommand{\nomarkersintext}{\@domarkersfalse
  \ef@OldCmd{\nomarkersintext}{nomarkers}}
\newcommand{\dofiglist}{\@figlisttrue \ef@OldCmd{\dofiglist}{figlist}}
\newcommand{\nofiglist}{\@figlistfalse \@figheadtrue
  \ef@OldCmd{\nofiglist}{nofiglist}}
\DeclareOption{nolists}{ \@figlistfalse }
\DeclareOption{lists}{\@figlisttrue }
\DeclareOption{nofiglist}{\@figlistfalse }
\DeclareOption{figlist}{\@figlisttrue }
\DeclareOption{heads}{\@figheadtrue }
\DeclareOption{noheads}{\@figheadfalse }
\DeclareOption{fighead}{\@figheadtrue }
\DeclareOption{nofighead}{\@figheadfalse }
\DeclareOption{platesfirst}{\@tablesfirstfalse }
\DeclareOption*{%
   \PackageWarning{endfloat}{Unknown option `\CurrentOption'}}
\ProcessOptions
\def\efloat@newwrite#1{%
   \expandafter\newwrite\csname efloat@post#1\endcsname}
\def\efloat@openpost#1{\expandafter\immediate\expandafter\openout
      \csname efloat@post#1\endcsname =\jobname.#1\relax
   \ef@setct{#1}{1}
   \message{(\jobname.#1)}}
\def\ef@newct#1{%
 \expandafter \newcount \csname @ef@#1open\endcsname}
\def\ef@setct#1#2{\expandafter\global\csname @ef@#1open\endcsname=#2\relax}
\def\efloat@condopen#1{%
    \expandafter\ifnum \csname @ef@#1open\endcsname>0 \relax \else
     \efloat@openpost{#1}\fi}
\def\efloat@iwrite#1#2{%
   \expandafter\immediate\expandafter\write\csname efloat@post#1\endcsname
    {#2}}
\newcommand{\efloatseparator}{\clearpage}
\newcounter{postfig}
\efloat@newwrite{fff}
\ef@newct{fff}
\newcounter{posttbl}
\efloat@newwrite{ttt}
\ef@newct{ttt}
\newcommand*{\ef@makeinnocent}[1]{\catcode`#1=12 }
\providecommand{\platename}{Plate}
\newcommand{\plateplace}{%
   \begin{center}
     [\platename~\thepostfig\ about here.]
   \end{center}}
\let\@bfig\plate             % bj
\let\efloat@float\relax
\def\plate{%
     \efloat@condopen{fff}
     \efloat@iwrite{fff}{\string\begin{plate*}}%
    \if@domarkers%
       \addtocounter{postfig}{1}% % bj
       \plateplace%              % bj
    \fi%
    \def\@currenvir{efloat@float}%
    \begingroup%
    \let\do\ef@makeinnocent \dospecials%
    \ef@makeinnocent\^^L% and whatever other special cases
    \endlinechar`\^^M \catcode`\^^M=12 \ef@xplate}%
\def\efloat@foundend#1#2{\def\next{\endgroup\end{efloat@float}%
          \efloat@iwrite{#1}{\string\end{#2}}%
          \efloat@iwrite{#1}{\string\efloatseparator}%
          \efloat@iwrite{#1}{ }}}%
{\catcode`\^^M=12 \endlinechar=-1 %
 \gdef\ef@xplate#1^^M{\def\test{#1}%
      \ifx\test\ef@endplatetest
           \efloat@foundend{fff}{plate*}
      \else\ifx\test\ef@enddblplatetest
           \efloat@foundend{fff}{plate*}
      \else%
          \efloat@iwrite{fff}{#1}%
          \let\next\ef@xplate%
      \fi \fi \next}%
}%
{\escapechar=-1%
 \xdef\ef@endplatetest{\string\\end\string\{plate\string\}}%
 \xdef\ef@enddblplatetest{\string\\end\string\{plate*\string\}}%
}%
\@namedef{plate*}{\plate}
%%%\providecommand{\platesection}{Plates}
\providecommand{\platesection}{\platenames}
\newcommand{\processplates@hook}{\@empty}
\def\AtBeginPlates{\g@addto@macro\processplates@hook}
\newcommand{\processdelayedfloats@hook}{\@empty}
\def\AtBeginDelayedFloats{%
   \g@addto@macro\processdelayedfloats@hook}
\newcommand{\processotherdelayedfloats}{\@empty}
\def\processplates{%
 \expandafter\ifnum \csname @ef@fffopen\endcsname>0
  \immediate\closeout\efloat@postfff \ef@setct{fff}{0}
  \clearpage                                                        % bj
  \if@figlist                                                       % bj
    {\normalsize\listofplates}                                     % bj
    \clearpage                                                      % bj
  \fi
  \if@fighead
     \section*{\platesection}                                   % bj
     \suppressfloats[t]                                          % jpg
  \fi
  \markboth{\uppercase{\platesection}}{\uppercase{\platesection}}% bj
  \processplates@hook \@input{\jobname.fff}
 \fi}
\renewcommand{\bottomfraction}{1.0}
\renewcommand{\topfraction}{1.0}
\renewcommand{\textfraction}{0.0}
\newcommand{\processdelayedfloats}{{%
  \def\baselinestretch{1}\normalsize
   \let\plate\@bfig
   \processdelayedfloats@hook
    \processplates
   \processotherdelayedfloats}}
\AtEndDocument{%                                      % jpg
   \message{AED endfloat: Processing end Plates and Tables}% % jpg
   \onecolumn
   \processdelayedfloats }
\InputIfFileExists{endfloat.cfg}{%
   \typeout{*** Using endfloat.cfg ***}}{}
\endinput
%%
%% End of file `endfloat.sty'.