summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/yafoot/yafoot.dtx
blob: 6c0d1bda17e644142d4bda93091a030e1ed2cd1e (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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
% \iffalse
%<pfnote>%% Style file `pfnote'.
%<fnpos>%% Style file `fnpos'.
%<dblfnote>%% Style file `dblfnote'.
%% Copyright (C) 1999-2018
%%   Hiroshi Nakashima <h.nakashima@DOMAIN;  DOMAIN=media.kyoto-u.ac.jp>
%%   (Kyoto University)
%% 
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%% 
% \fi
%
% \CheckSum{802}
%% \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         \~}
%%
% \iffalse
%%
%<*dtx>
\ProvidesFile{yafoot.dtx}
%</dtx>
%<pfnote|fnpos|dblfnote>\def\next{LaTeX2e}
%<pfnote|fnpos|dblfnote>\ifx\fmtname\next
%<pfnote|fnpos|dblfnote>\def\next{
%<pfnote|fnpos|dblfnote>\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%<pfnote>\ProvidesPackage{pfnote}}
%<fnpos>\ProvidesPackage{fnpos}}
%<dblfnote>\ProvidesPackage{dblfnote}}
%<pfnote|fnpos|dblfnote>\else\def\next[#1]{}\fi
%<pfnote|fnpos|dblfnote>\next
%<driver>\ProvidesFile{yafoot-man.tex}
% \fi
% \ProvidesFile{yafoot.dtx}
[2018/09/03 v1.1 ]
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\usepackage{pfnote}
\usepackage{fnpos}
\usepackage{dblfnote}
\DisableCrossrefs
\PageIndex
\CodelineNumbered
\RecordChanges
%</driver>
%<driver>\OnlyDescription
%<driver>\def\ONLYDESCRIPTION{}
%<*driver>
\advance\textwidth4em
\DFNcolumnsep1.5\columnsep
\begin{document}
\DocInput{yafoot.dtx}
\end{document}
%</driver>
% \fi
% 
% \makeatletter
% 
% \newcount\ChangeCount \ChangeCount10000
% \def\changes@#1#2#3{%
%   \global\advance\ChangeCount\@ne
%   \protected@edef\@tempa{\noexpand\glossary{#1\levelchar
%                                  \number\ChangeCount
%                                  \actualchar
%                                  \ifx\saved@macroname\@empty
%                                    \generalname
%                                  \else
%                                    \string\verb\quotechar*
%                                    \verbatimchar\saved@macroname
%                                    \verbatimchar
%                                  \fi
%                                  :\levelchar #3}}%
%   \@tempa\endgroup\@esphack}
% 
% \def\theglossary{\onecolumn \glossary@prologue
%	\GlossaryParms \let\item\@idxitem
%       \rightskip 1em plus 1fil
%       \parfillskip-1em
%       \ignorespaces}
% \def\endtheglossary{\relax}
% 
% \changes{v0.1}{1991/10/29}
%	{The style pfnote is born.}
% \changes{v0.2}{1993/05/20}
%	{Footnote pushing function is posted to comp.text.tex.}
% \changes{v0.3}{1993/08/17}
%	{Exchanging footnotes and bottom floats in fnpos is posted to
%	 fj.comp.texhax.}
% \changes{v0.4}{1995/06/21}
%	{First version of dblfnote is posted to comp.text.tex.}
% \changes{v1.0}{1999/07/14}
%	{Three styles are merged into yafoot.dtx and rewritten.}
% \changes{v1.1-1}{2018/09/03}
%	{Fix a footnote coloring problem in \string\textsf{fnpos}. (2018/09/03)}
%
% \errorcontextlines10000
% \GetFileInfo{yafoot.dtx}
% \setcounter{IndexColumns}{2}
% 
% \def\bottomfraction{.9}
% \def\cs#1{\hbox{\tt\char\escapechar#1}}
% \def\Item{\vskip-\itemsep\vskip-\parsep\vskip0pt\item}
%
% \makeatletter
% \def\nosv{\catcode`\|12}
% 
% \def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation
% \global\@eqnswtrue
% \global\@eqcnt\z@\tabskip\@centering\let\\=\@eqncr
% $$\halign to \displaywidth\bgroup\hskip\@centering
%   $\displaystyle\tabskip\z@{##}$\@eqnsel&\global\@eqcnt\@ne
%   \hfil$\;{##}\;$\hfil
%   &\global\@eqcnt\tw@ $\displaystyle\tabskip\z@{##}$\hfil
%    \tabskip\@centering&\llap{##}\tabskip\z@\cr}
%
% \def\Meta#1{\penalty\@highpenalty
%	\hbox{{\tt\char`\{}{\it\meta{#1}}{\tt\char`\}}}}
% \def\opt#1{{\tt[}{\it\meta{#1}}{\tt]}}
% \def\optn#1{{\tt[#1]}}
% \def\arg#1{{\tt\char`\{#1\char`\}}}
%
% \let\latex@addmarginpar\@addmarginpar
% \let\latex@latex@warning@no@line\@latex@warning@no@line
% \def\@addmarginpar{\let\@latex@warning@no@line\@gobble
%	\latex@addmarginpar
%	\let\@latex@warning@no@line\latex@latex@warning@no@line}
% \let\@font@warning\@gobble
%
% \long\def\m@cro@#1#2{\endgroup \topsep\MacroTopsep \trivlist
%    \edef\saved@macroname{\string#2}
%   \def\makelabel##1{\llap{##1\hskip\@totalleftmargin}}
%   \if@inlabel
%     \let\@tempa\@empty \count@\macro@cnt
%     \loop \ifnum\count@>\z@
%       \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat
%     \edef\makelabel##1{\llap{\vtop to\baselineskip
%                                {\@tempa\hbox{##1}\vss}
%			       \hskip\@totalleftmargin}}
%     \advance \macro@cnt \@ne
%   \else  \macro@cnt\@ne  \fi
%   \edef\@tempa{\noexpand\item[
%      #1
%        \noexpand\PrintMacroName
%      \else
%        \noexpand\PrintEnvName
%      \fi
%      {\string#2}]}
%   \@tempa
%   \global\advance\c@CodelineNo\@ne
%    #1
%       \SpecialMainIndex{#2}\nobreak
%       \DoNotIndex{#2}
%    \else
%       \SpecialMainEnvIndex{#2}\nobreak
%    \fi
%   \global\advance\c@CodelineNo\m@ne
%   \ignorespaces}
% 
% \def\dummymacro{\topsep\MacroTopsep \trivlist \item[]}
% \let\enddummymacro\endtrivlist
% 
% \def\DescribeOpt{\leavevmode\@bsphack\begingroup\MakePrivateLetters
%   \Describe@Opt}
% \def\Describe@Opt#1{\endgroup \Describe@pt{#1}}
% \def\Describe@pt#1#2{
%               \marginpar{\raggedleft\PrintDescribeMacro{#1}}
% 		\SpecialOptUsageIndex{#1}{#2}}
% \def\SpecialOptUsageIndex#1#2{
% 	\index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar usage}
%	\index{#2s:\levelchar{\protect\ttfamily#1}\encapchar usage}
%	\@esphack\ignorespaces}
% \def\SpecialOptMainIndex#1#2{
% 	\index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar main}
%	\index{#2s:\levelchar{\protect\ttfamily#1}\encapchar main}
%	\@esphack\ignorespaces}
% \def\SpecialOptIndex#1#2{
% 	\index{#1\actualchar{\protect\ttfamily#1} (#2)}
%	\index{#2s:\levelchar{\protect\ttfamily#1}}
%	\@esphack\ignorespaces}
% \def\SpecialOptIndexS#1#2{
% 	\index{#1\actualchar{\protect\ttfamily#1} (#2)}
%	\index{#2es:\levelchar{\protect\ttfamily#1}}
%	\@esphack\ignorespaces}
%
% \begingroup
% \gdef\@sverbcat{\catcode`\@\active\catcode`\#\active}
% \catcode`\@\active \gdef@{\char`\@\penalty\exhyphenpenalty}
% \catcode`\#\active \gdef#{\penalty\exhyphenpenalty}
% \endgroup
% \let\latex@sverb\@sverb
% \def\@sverb{\@sverbcat\latex@sverb}
%
% \def\theglossary{\onecolumn \glossary@prologue
%	\GlossaryParms \let\item\@idxitem \ignorespaces}
% \def\endtheglossary{\relax}
% 
% 
%
% \def\bracepair{`{\tt\char`\{\char`\}'}}
%
% \ifx\ONLYDESCRIPTION\undefined\else
% \let\SpecialUsageIndex\SpecialMainIndex
% \let\SpecialOptUsageIndex\SpecialOptMainIndex
% \fi
% 
% 
%
% \title{\textsf{pfnote}, \textsf{fnpos} and \textsf{dblfnote}\\
%	Packages for Footnotes\thanks{
%	This file has version number \fileversion, last revised \filedate.}}
% \author{Hiroshi Nakashima\\(Kyoto University)}
% \date{\filedate}
% \maketitle
% 
% \begin{abstract}
% This file provides three style files; \textsf{pfnote} to enclose footnote
% numbering in a page;  \textsf{fnpos} to control the vertical position of
% footnotes;  \textsf{dblfnote} to make footnote double-columned.
% \end{abstract}
%
% \tableofcontents
% \newpage
%
% 
% \section{Introduction}
% \label{sec:intro}
%
% \LaTeX{} users often bother about fine points of footnote.  How can I
% reset |footnote| counter when a page is produced in order to keep the
% counter from having too large, say 30, in a document with many footnotes?
% How can I place footnotes at more appropriate position?  How can I make
% footnotes double-columned while main text is single-columned?
%
% The style files distributed with this document will solve these problems.
% You will have the following three style files by processing
% \textsf{yafoot.dtx}\footnote{
%
% It stands for ``Yet Another FOOTnote.''}
%
% with \textsf{docstrip}.
%
% \begin{description}
% \item[\textsf{pfnote}]
% \DescribeOpt{pfnote}{style file}
% provides a new version of |\footnote| to make footnote numbering enclosed 
% in a page.  That is, the counter |footnote| is reset whenever a page is
% produced and thus the first footnote in a page is numbered 1 no matter how 
% it stands in the sequence of footnotes in a document.  Since this document 
% itself uses \textsf{pfnote}, you will see how footnotes are numbered.
%
% \item[\textsf{fnpos}]
% \DescribeOpt{fnpos}{style file}
% provides following commands to control the vertical position of footnotes.
%
% \begin{itemize}
% \item
% \DescribeMacro{\makeFNbottom}
% \DescribeMacro{\makeFNmid}
% |\makeFNbottom| makes footnotes always placed at the bottom of a
% |\ragged#bottom| page, while |\makeFNmid| allows footnotes directly follow
% the main text of a page as standard \LaTeX{} does.
%
% \item
% \DescribeMacro{\makeFNbelow}
% \DescribeMacro{\makeFNabove}
% |\makeFNbelow| places footnotes below bottom floats (i.e. figures and
% tables), while |\makeFNabove| is to place footnotes above bottom floats as
% standard \LaTeX{} does.
% \end{itemize}
%
% This document also uses \textsf{fnpos} to make footnotes {\em bottom} and
% {\em below}\footnote{
%
% But the effect will be hardly seen except in the right column of
% page~\pageref{pag:shfnp-2} where we show the effect explicitly.}.
%
% The first version of these commands are posted by the author to news
% groups |comp.text.tex| and |fj.comp.texhax| as the answers to the posts by
% Martin Boyer and Nobuaki Minematsu.
%
% \item[\textsf{dblfnote}]
% \DescribeOpt{dblfnote}{style file}
% makes footnotes double-columned.  It also provides a few commands to
% control column breaking.  The first version of the style file is created
% for Tim Armstrong's post to |comp.text.tex|.  Since this document uses
% \textsf{dblfnote}, you will find that the footnotes\footnote{
%.
% This document has many footnotes, some of which are just to show how our
% footnote mechanisms work.}
%
% in this page are double-columned.
% \end{description}
%
% Note that these style files may be used either solely, or combined each
% other as done in this document.
%
% 
%
% \section{Usage}
% \label{sec:usage}
% \subsection{Loading Style Files}
% \label{sec:usage-load}
%
% All the three style files are usable to both \LaTeXe{} and \LaTeX-2.09
% users with their standard package loading declaration.  If you use
% \LaTeXe{} and wish to load, for example, \textsf{pfnote} and
% \textsf{fnpos}, simply do the following.
%
% \begin{quote}
% \SpecialUsageIndex{\usepackage}
% |\usepackage{pfnote}|\\
% |\usepackage{fnpos}|
% \end{quote}
%
% If you still love \LaTeX-2.09, the following is what you have to do.
%
% \begin{quote}
% \SpecialUsageIndex{\documentstyle}
% |\documentstyle[..,pfnote,fnpos,...]|\Meta{main-style}
% \end{quote}
%
% Note that any combination of three styles are allowed and they are
% insensitive to their loading order.
%
% 
% 
% \subsection{\textsf{pfnote}: Enclose Footnote Numbers within a Page}
% \label{sec:usage-pfnote}
%
% \DescribeOpt{pfnote}{style file}
% Just loading \textsf{pfnote} is everything that you have to do to make
% footnote numbering enclosed in a page\footnote{
%
% Here you will find this fourth footnote is numbered one.}.
%
% Only one thing you have to remember is that footnote numbers will be
% adjusted after you run \LaTeX{} {\em twice}, as |\ref|-erences to
% |\label|-s are.
%
% 
%
% \subsection{\textsf{fnpos}: Control Vertical Position of Footnotes}
% \label{sec:usage-fnpos}
%
% \DescribeOpt{fnpos}{style file}
% The following four commands are available to control the vertical position
% of footnotes.
%
% \begin{description}
% \item[\cs{makeFNbottom}]
% \DescribeMacro{\makeFNbottom}
% \SpecialIndex{\raggedbottom}
% makes footnotes always placed at the bottom of a |\raggedbottom| page,
% even if the page is too short to push the footnotes to its bottom because, 
% for example, the page is broken just before a tall object such as a
% |tabular|.  This is default.
%
% \item[\cs{makeFNmid}]
% \DescribeMacro{\maekFNmid}
% cancels the effect of |\makeFNbottom| to allow footnotes directly follow
% the main text of a page as standard \LaTeX{} does.
%
% \item[\cs{makeFNbelow}]
% \DescribeMacro{\maekFNbelow}
% places footnotes {\em below} bottom floats (i.e. figures and tables).
% This is default.
%
% \item[\cs{makeFNabove}]
% \DescribeMacro{\maekFNabove}
% cancels the effect of |\makeFNbelow| to place footnotes {\em above} bottom 
% floats as standard \LaTeX{} does.
% \end{description}
%
% Note that if you are using p\LaTeX{}, a Japanese version of \LaTeX, it
% might be unnecessary to use \textsf{pfnote} because p\LaTeX{} does what
% |\makeFNbottom| and |\makeFNbelow| do\footnote{
%
% Very strictly speaking, the mechanism of p\LaTeX{} is slightly different
% from that of \textsf{fnpos} but the difference is hardly recognizable.}.
%
% However, if you wish to follow the real \LaTeX's standard, |\makeFNmid|
% and |\makeFNabove| will do for you.
%
% The following two two-columned pages show the effects of the commands.
%
% \newpage
% \twocolumn
% \def\showfnposleaders{\xleaders
%	\hbox to\hsize{\hss.\vrule height.3\baselineskip width0pt\hss}\vfil}
% \def\showfnpos#1#2#3{\par#1#2\noindent
%	This column is typeset with \texttt{\string#1} and \texttt{\string#2}
%	\footnote{#3}.\par\nobreak
%	\vbox to.4\textheight{
%		\showfnposleaders\smallskip
%		\centerline{(Main text of this column is here.)}\smallskip
%		\showfnposleaders}
%	\begin{figure}[b]
%	\fboxsep0pt
%	\hbox{\fbox{\vbox to.4\textheight{\vfil
%		\centerline{Here is a bottom float.}\vfil}}}
%	\end{figure}
%	\break}
%
% \label{pag:shfnp-1}
% \showfnpos\makeFNmid\makeFNabove{
%	Therefore, this footnote is {\em above} the bottom float leaving
%	spaces at the bottom of this column.}
%
% \showfnpos\makeFNmid\makeFNbelow{
%	Therefore, this footnote is {\em below} the bottom float still
%	leaving spaces at the bottom of this column.}
%
% \label{pag:shfnp-2}
% \showfnpos\makeFNbottom\makeFNabove{
%	Therefore, this footnote is {\em above} the bottom float that is
%	pushed to the {\em bottom} of this column together with this footnote.}
%
% \showfnpos\makeFNbottom\makeFNbelow{
%	Therefore, this footnote is {\em below} the bottom float, and at the 
%	{\em bottom} of this column alone.}
%
% 
% 
% \newpage
% \onecolumn\par
% \subsection{\textsf{dblfnote}: Make Footnotes Double-Columned}
%
% \DescribeOpt{dblfnote}{style file}
% Simply loading \textsf{dblfnote} will make footnotes double-columned.  For 
% fine tuning of double-columning, however, you have a few style parameters
% and commands as follows.
%
% \begin{description}
% \item[\texttt{DFNsloppiness}]
% \DescribeOpt{DFNsloppiness}{counter}%
% defines how sloppy paragrahs in footnotes are typeset.  Since lines of
% footnotes are narrow, you might wish to typeset footnotes in some
% |\sloppy| manner in order to avoid underfull.  Setting |DFNsloppiness| to
% larger value up to 9999, footnote paragraphs will be sloppier.  The
% default is 5000.
%
% \item[\cs{DFNcolumnsep}]
% \begin{DFNinhibitcbreak}%
% \DescribeMacro{\DFNcolumnsep}%
% \SpecialIndex{\columnsep}%
% is the distance of footnote columns is specified by the value of
% |\DFNcolumn#sep|.  If you don't set this parameter explicitly\footnote{
%
% Strictly speaking, unless you set a non-negative value in the document
% preamble.},
%
% the value is that of |\columnsep|.  For example, the author set
% |\DFNcolumnsep| to $1.5\times\hbox{|\columnsep|}$ in this document.
% \end{DFNinhibitcbreak}
%
% \item[\cs{DFNcolumnwidth}]
% \DescribeMacro{\DFNcolumnwidth}%
% is the width of a footnote column.  If you don't set this parameter
% explicitly, as expected, it is automatically set to
% $(|\textwidth|-|\DFNcolumnsep|)/2$.
%
% \item[\cs{DFNallowcbreak}]
% \DescribeMacro{\DFNallowcbreak}
% \DescribeMacro{\DFNinhibitcbreak}
% allows a footnote is broken into two columns, while {\bfseries
% |\DFNinhibitcbreak|} inhibits it.  In default, column breaking is allowed.
%
% \item[\cs{DFNtrysingle}]
% \DescribeMacro{\DFNtrysingle}
% \DescribeMacro{\DFNalwaysdouble}
% places footnotes only in the left column if the page containing them has
% enough space as shown in pages~1,
% \pageref{sec:usage-fnpos} and this page, while {\bfseries
% |\DFNalwaysdouble|} makes them double-columned (almost) always.  In
% default, single-columning is tried.
%
% \item[\cs{DFNruleleft}]
% \DescribeMacro{\DFNruleleft}
% \DescribeMacro{\DFNruleboth}
% draws |\footnoterule| over footnotes in left column only, while {\bfseries
% |\DFNrule#both|} draws in both columns.  In default, the rule is drawn in
% left column only.
% \end{description}
%
% \SpecialIndex{\twocolumn}
% \SpecialIndex{\onecolumn}
% Note that \textsf{dblfnote} will do nothing if |\twocolumn| is in effect,
% as shown in pages~\pageref{pag:shfnp-1} and~\pageref{pag:shfnp-2}.  That
% is, footnotes are put as in usual double-coulumned document.  If you
% change the page structure to |\onecolumn|, the mechanism of
% \textsf{dblfnote} is enabled again as shown in this page.
% 
% 
% \section{Known Problems}
% \label{sec:prob}
%
% \begin{enumerate}
% \item
% \SpecialOptIndex{minipage}{environment}
% The style \textsf{pfnote} does not enlose the number of footnotes in
% |minipage| environment.
% 
% \item
% The style \textsf{dblfnote} may mistakingly produce a little bit too
% short pages if an extremely long paragraph has footnotes.  More
% specifically, if a paragraph runs across three or more pages $p_1$,
% \ldots, $p_n$, and its first and last footnote appears in $p_i$ ($i\leq n-2$)
% and $p_j$ ($j>i$), pages $p_{i+1}$ to $p_j$ may be a little bit too short
% especially for those without footnotes.
% \end{enumerate}
% 
% 
%
% \IndexPrologue{\newpage\section*{Index}
% Underlined number refers to the page where the specification of
% corresponding entry is described.}
% \StopEventually{
% \section*{Acknowledgments}
%
% The author thanks to Martin Boyer and Nobuaki Minematsu whose posts to
% news groups triggered writing very first version of macros in
% \textsf{fnpos}, and to Tim Armstrong whose post to \texttt{comp.text.tex}
% encouraged him to make the first version of \textsf{dblfnote} that
% requires considerable hack.  He also thanks to Hironobu Yamashita who
% found a bug, hidden in \textsf{fnpos} for 19 years (!!), by which
% footnotes were colored inappropriately. 
%
% For the implementation of three style files, the author refers the base
% implementations of the macros for \cs{footnote} and for \cs{output}
% routine.  These macros are written by Leslie Lamport as a part of
% \LaTeX-2.09 and \LaTeXe{} (1997/12/01) to which Johannes Braams and other
% authors also contributed.
%
% \PrintIndex}
%
% 
%
% \newpage
% \section{Implementation}
% \label{sec:imp}
% \subsection{Tricks for Compatibility}
% \label{sec:imp-compat}
%
% At the very beginning of each style file, we checks whether it is
% loaded by \LaTeXe{} or \LaTeX-2.09, and then declares |\NeedsTeXFormat|
% and |\ProvidesPackage| if \LaTeXe{}.  This part is embedded at the
% beginning of \textsf{yafoot.dtx} in a tricky manner to let
% \textsf{docstrip} produce the following code, for example for
% \textsf{pfnote}.
% \SpecialIndex{\NeedsTeXFormat}
% \SpecialIndex{\ProvidesPackage}
%
%\begin{quote}
%\begin{verbatim}
%\def\next{LaTeX2e}
%\ifx\fmtname\next
%\def\next{
%\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%\ProvidesPackage{pfnote}}
%\else\def\next[#1]{}\fi
%\next
%[1999/07/14 v1.0 ]
%\end{verbatim}
%\end{quote}
%
% 
%
% \subsection{\textsf{pfnote}}
% \label{sec:imp-pfnote}
%
% \iffalse
%<*pfnote>
% \fi
% To enclose |\c@footnote| within a page, we identify each footnote $f_i$
% by a global serial number $i$ and associate it with the {\em physical}
% page number $p_i$ where it appears.  These attributes $i$ and $p_i$ are
% written to |.aux| file in the form of |\pfn@fnote|\Meta{$i$}\Meta{$p_i$}.
% This macro is evaluated in \LaTeX's |\document| and |\def|-ines a macro
% whose name is ``|\pfn@fn|\meta{$i$}'' and body is \meta{$p_i$}.
%
% Then, when we process the footnote $f_i$, we can have $p_i$ by evaluating
% |\pfn@fn|\meta{$i$} and compare it with $p_{i-1}$.  If $p_i\neq p_{i-1}$,
% $f_i$ is the first footnote in page $p_i$ and thus its number should be
% one.  Otherwise, the number of $f_i$ should be that of $f_{i-1}$ plus one.
%
% \begin{macro}{\pfn@fnotectr}
% \begin{macro}{\pfn@page}
% \begin{macro}{\pfn@pageprev}
% To implement the algorithm shown above, we use three |\count| registers;
% |\pfn@fnotectr| for $i$ initialized to zero; |\pfn@page| for physical page
% number initialized to one; and |\pfn@pageprev| to keep $p_{i-1}$ with
% initial value zero.  Note that |\pfn@page| is not |\c@page| but has
% physical page number, and thus any $p_i$ cannot be zero that is the initial
% value of |\pfn@pageprev|.
% \end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}

\newcount\pfn@fnotectr \pfn@fnotectr\z@
\newcount\pfn@page \pfn@page\@ne
\newcount\pfn@pageprev \pfn@pageprev\z@

%    \end{macrocode}
%
% \begin{macro}{\pfn@footnote}
% \begin{macro}{\footnote}
% \begin{macro}{\pfn@footnotemark}
% \begin{macro}{\footnotemark}
% \begin{macro}{\pfn@mpfn}
% We have to modify |\footnote| and |\footnotemark| so that they invoke
% |\pfn@adjust| to do what we described at the beginning of this section, if 
% they refer and increment |\c@footnote|.  In order to minimize
% copy-and-modify of their original codes, we simply call their original
% versions, |\pfn@footnote| and |\pfn@footnotemark|, if optional argument is 
% given accepting a little bit performance degradation by double checking of 
% the optional argument\footnote{
%
% We of course know that we can call \cs{@xfootnote} and
% \cs{@xfootnotemark}, but this implementation is safer.}.
%
% Otherwise, |\pfn@adjust| is invoked if |\@mpfn| is ``|footnote|'', the
% body of |\pfn@mpfn| in the case of |\footnote|, or always in the case of
% |\footnotemark|.  Thus |mpfootnote| is eliminated from our mechanism as
% shown in \S\ref{sec:prob}, although including it is not hard.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}
\let\pfn@footnote\footnote
\def\footnote{\@ifnextchar[%]
        {\pfn@footnote}%
        {\ifx\@mpfn\pfn@mpfn \pfn@adjust \fi \pfn@footnote}}
\let\pfn@footnotemark\footnotemark
\def\footnotemark{\@ifnextchar[%]
        {\pfn@footnotemark}{\pfn@adjust \pfn@footnotemark}}
\let\pfn@mpfn\@mpfn

%    \end{macrocode}
%
% \begin{macro}{\pfn@adjust}
% The main procedure of enclosing is performed by |\pfn@adjust|.  First,
% after |\global|-ly incrementing |\pfn@fnotectr| ($i$), it |\write|-s
% |\pfn@fnpage|\Meta{$i$}\Meta{$P$} by well-known technique of the
% combination of delayed evaluation of physical page number $P$ and
% immediate evaluation of other staffs.
%
% Then it obtains $p_i$ by evaluating |\pfn@fn|$i$ and compares it to
% $p_{i-1}$ in |\pfn@pageprev|.  If they are not equal, |\c@footnote| is
% reset to make $f_i$ have number one, and |\pfn@pageprev| is set to $p_i$.
% Since we also reset |\c@footnote| if |\pfn@fn|$i$ is undefined, all the
% footnotes will have number one on the first run of \LaTeX{} for a
% document.
% \end{macro}
%
%    \begin{macrocode}
\def\pfn@adjust{\global\advance\pfn@fnotectr by\@ne
        \if@filesw
                \edef\@tempa{\write\@auxout{\string\pfn@fnpage
                        {\number\pfn@fnotectr}%
                        {\noexpand\number\noexpand\pfn@page}}}\@tempa \fi
        \expandafter\ifx\csname pfn@fn\number\pfn@fnotectr\endcsname\relax
                \global\c@footnote\z@ \else
        \expandafter\@tempcnta\csname pfn@fn\number\pfn@fnotectr\endcsname
        \relax \ifnum\@tempcnta=\pfn@pageprev\else
                \global\pfn@pageprev\@tempcnta \global\c@footnote\z@ \fi \fi}

%    \end{macrocode}
%
% \begin{macro}{\pfn@fnpage}
% The macro |\pfn@fnpage|\Meta{$i$}\Meta{$p_i$} written in |.aux| and
% evaluated in |\document| simply |\def|-ines |\pfn@fn|$i$ with the body
% $p_i$.
% \end{macro}
%
%    \begin{macrocode}
\def\pfn@fnpage#1#2{\global\@namedef{pfn@fn#1}{#2}}

%    \end{macrocode}
%
% \begin{macro}{\pfn@outputpage}
% \begin{macro}{\@outputpage}
% To keep track physical page number in |\pfn@page|, we modify
% |\@outputpage| so that it increments |\pfn@page| when it does |\c@page|.
% \end{macro}\end{macro}
%
%    \begin{macrocode}
\let\pfn@outputpage\@outputpage
\def\@outputpage{\pfn@outputpage \global\advance\pfn@page\@ne}
%    \end{macrocode}
%
% \iffalse
%</pfnote>
% \fi
%
% 
%
% \subsection{\textsf{fnpos}}
% \label{sec:imp-fnpos}
%
% \iffalse
%<*fnpos>
% \fi
% \begin{macro}{\iffnp@bottom}
% \begin{macro}{\iffnp@below}
% To control the position of footnotes, we introduce two switches;
% |\iffnp@bottom| is true if |\makeFNbottom| is in effect;  |\iffnp@below|
% is true if |\makeFNbelow| is in effect.  In default, they both are true.
% \end{macro}\end{macro}
%
%    \begin{macrocode}

\newif\iffnp@bottom \fnp@bottomtrue
\newif\iffnp@below \fnp@belowtrue

%    \end{macrocode}
%
% \newpage
% \begin{macro}{\makeFNbottom}
% \begin{macro}{\makeFNmid}
% \begin{macro}{\makeFNbelow}
% \begin{macro}{\makeFNabove}
% User interface macros are trivial, i.e. they turn the switches true or false.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}
\def\makeFNbottom{\fnp@bottomtrue}
\def\makeFNmid{\fnp@bottomfalse}
\def\makeFNbelow{\fnp@belowtrue}
\def\makeFNabove{\fnp@belowfalse}

%    \end{macrocode}
%
% \begin{macro}{\@makecol}
% \changes{v1.1-1}{2018/09/03}
%	{Remove inappropriate spaces preceeding three \cs{endcsname}.}
% \begin{macro}{\fnp@textbottom}
% The essential part of \textsf{fnpos} is a modified version of |\@makecol|.
% If |\iffnp@below| is true, we reverse the order of |\@combinefloats| and
% the insertion of |\footins|.  At the insertion of |\footins|, we insert
% |\@textbottom| prior to |\footins| to push it to the bottom if
% |\iffnp@bottom| is true.  We also temporarily nullify |\@textbottom|,
% whose definition is saved into |\fnp@textbottom|, if it has been inserted
% with |\footins| in order to keep the following |\@outputbox| construction
% in |\@makecol| or |\@makespecialcolbox| from inserting it again.
%
% Here we discuss a few compatibility issues.  In \LaTeXe, |\footins|
% inserted in the construct of |\color@begroup| and |\color@endgroup| which
% \LaTeX-2.09 does not have.  Thus we call them and |\normalcolor| by
% |\csname|\slash |\endcsname| construct to allow they are undefined.
%
% The |\insert|-ion object |\@kludgeins| and the macro |\@makespecialcolbox|
% are also \LaTeXe's new comers for |\enlargethispage|.  For \LaTeX-2.09, we
% make |\@klugeins| |\let|-equal to |\voidb@x| that will never be a |\vbox|,
% and thus |\@makespecialcolbox| will never be expanded.
%
% We also have to take care of p\LaTeX{} whose |\@makespecialcolbox| inserts
% |\footins| and |\@texbottom| as we do for |\makeFNbottom| and
% |\makeFNbelow|.  However, since |\footins| is set to void by our insertion
% and |\@textbottom| is nullified if |\iffnp@bottom| is true, these
% insertions will have no effect as have to be.
% \end{macro}\end{macro}
%
%    \begin{macrocode}
\def\@makecol{\setbox\@outputbox\box\@cclv
        \xdef\@freelist{\@freelist\@midlist}\global\let\@midlist\@empty
        \iffnp@below \@combinefloats \fi
        \let\fnp@textbottom\@textbottom
        \ifvoid\footins\else
                \setbox\@outputbox\vbox{\boxmaxdepth\maxdepth
                        \unvbox\@outputbox
                        \iffnp@bottom \@textbottom \fi
                        \vskip\skip\footins
                        \csname color@begingroup\endcsname
                        \csname normalcolor\endcsname
                        \footnoterule \unvbox\footins
                        \csname color@endgroup\endcsname}%
                \iffnp@bottom \let\@textbottom\relax \fi \fi
        \iffnp@below\else \@combinefloats \fi
        \ifvbox\@kludgeins \@makespecialcolbox
        \else \setbox\@outputbox\vbox to\@colht{\@texttop
                \dimen@\dp\@outputbox \unvbox\@outputbox
                \vskip-\dimen@ \@textbottom}\fi
        \let\@textbottom\fnp@textbottom
        \global \maxdepth \@maxdepth}
\ifx\@kludgeins\undefined \let\@kludgeins\voidb@x \fi
%    \end{macrocode}
%
% \iffalse
%</fnpos>
% \fi
% 
%
% \subsection{\textsf{dblfnote}}
% \label{sec:imp-dblfnote}
%
% \iffalse
%<*dblfnote>
% \fi
% 
% \subsubsection{Problems and Solutions}
% \label{sec:imp-dfn-ovv}
%
% \def\DH{{\mit\Delta}H}
% 
% \LaTeX's |\footnote| utilizes \TeX's mechanism |\insert| that is perfectly 
% fit to the purpose.  Roughly speaking, |\footnote|\Meta{text} invokes
% |\insert\footins|\Meta{text$'$} to do the following.
%
% \begin{enumerate}
% \item
% \meta{text$'$} is kept in a special place, properly contributing to
% \TeX's page breaking mechanism with their height and depth.
%
% \item
% When the |\output| routine is invoked with the contents of a page
% including {\em footnoted} text, it is also given \meta{text$'$}, together 
% with other |\footnote| texts which should appear in the page, through the
% box |\footins|.  The page breaking mechanism will never, well hardly
% ever\footnote{
%
% See Exercise 15.13 of \TeX{}book for the possibility of placing a footnote
% text in a page other than that its reference appears.},
%
% miss to couple \meta{text$'$} and its reference in main text.
%
% \item
% The |\output| routine put |\footins| at the bottom of the page.
% \end{enumerate}
%
% This simple mechanism, however, cannot be straightforwardly applied to our 
% double-columned footnotes.  The major difficulty lies in the fact that
% when |\footnote| is processed we cannot know how \meta{text$'$}
% contributes to the page in which it and its reference appear after it is
% double-columned with other footnote texts.  For example, \TeX{}book shows
% a simple estimation method setting |\count\footnote| to 500 so that a half 
% (500/1000) of the height plus depth of \meta{text$'$} contributes to the
% page.  This method, however, will underestimate the contribution of
% \meta{text$'$} having three lines, which will be broken into two and one
% lines and thus finally has two line height, by assuming the contribution
% is one and a half lines.  Thus we have to have a better estimation method.
% 
% Another problem is that, even if we estimate the contribution better, we
% cannot directly |\insert| \meta{text$'$} because its {\em natural} height
% plus depth may be different from the estimated contribution.  Note that
% changing the magnification factor in |\count\footins| dynamically is not
% good idea because its value is referred by the page breaking mechanism not
% at the time when we do |\insert| but when the paragraph including
% |\footnote| is completed possibly after other |\footnote|-s change the
% factor again.  Also note that we cannot give up using |\insert| and adopt
% a method similar to that for floats\footnote{
%
% As the buggy implementation of earlier version of \textsf{dblfnote}.},
%
% because a float may be decoupled from its reference and {\em float} to
% another page.  Thus we have to |\insert| something other than
% \meta{text$'$} while keeping it in some other place.
% 
% To solve these problems, the following algorithm is devised for
% \textsf{dblfnote}.  Let $f_1$, \ldots, $f_{i-1}$ be footnote texts which
% have not yet been |\output|, and $f_i$ be that which we now process.  Let
% $H_i$ be the height plus depth of double-columned typesetting result of
% $f_1$, \ldots, $f_i$, which can be obtained by tentatively doing that.  We
% estimate the contribution of $f_i$ to the page as $\DH_i=H_i-H_{i-1}$,
% which will be exact if $f_1$, \ldots, $f_i$ is put in a page\footnote{
%
% As discussed later, this condition does not always hold and thus we will
% have an error.}.
%
% Then we |\insert| an empty box whose height is $\DH_i$ through |\footins|,
% while appending $f_i$ to the tail of |\vbox| $F$, which has contained
% $f_1$, \ldots, $f_{i-1}$, so that the |\output| routine and following
% |\footnote|-s refer it.
%
% When the |\output| routine is invoked, we have $f_1$, \ldots, $f_n$ in
% $F$, and \TeX{} moved $m$ ($m\leq n$) |\insert|-ed empty |\vbox|-es into
% the box |\footins|.  Thus we have to know $m$ and have to pick $f_1$,
% \ldots, $f_m$ from $F$.  Since $m$ is the number of |\vbox|-es in
% |\footins|, we can count them by a well-known technique of iterative
% |\unvbox| and |\lastbox|\footnote{
%
% Since \cs{footins} contains only a sequence of empty \cs{vbox}-es, i.e. no
% glues, penalties nor other troublesome stuffs, we can count \cs{vbox}-es
% exactly.}.
%
% In order to pick $f_1$, \ldots, $f_m$, we maintain a list
% $L=\{h_1,\ldots,h_n\}$ where $h_i$ is the height plus depth of $f_i$ and
% calculate $s_m=\sum_{i=1}^m h_i$.  With this $s_m$, we can |\vsplit| the
% box $F$ to obtain a |\vbox| $F'$ containing $f_1$, \ldots, $f_m$ and to
% leave $f_{m+1}, \ldots, f_n$ in $F$.  We also remove $h_1$, \ldots, $h_m$
% from $L$.  Then we |\vsplit| $F'$ into two columns to have what we finally
% put at the bottom of the page.
%
% If $m=n$, that is, if all the |\footnote|-s that have occurred are combined 
% with the page, we have no problem to finish the |\output| routine and to
% continue the process.  If $m<n$, that is, if there are |\footnote|-s that
% have occurred but are left for the next (or farther) page, however, we have 
% a problem.   Remember that we estimate the contribution of $f_i$, $\DH_i$, 
% assuming that $f_1$, \ldots, $f_i$ are put in a page.  Since $f_{m+1}$,
% \ldots, $f_n$ are {\em not} put in the page where $f_1$, \ldots, $f_m$ are 
% put, our estimation could have some error.  In fact, for example, if all
% $f_i$ has one line and $m$ is odd, $H_m=H_{m+1}$ and thus $\DH_{m+1}$ is
% zero while its real contribution should be the height of one line.  In
% general, $\DH_i$ for $m<i\leq n$ were underestimated and thus somehow we
% have to compensate the underestimation that would cause overfull in the
% |\output| process for the next page.
%
% For the compensation, the element of $L$ is not just $h_i$ but the pair
% $(h_i,\DH_i)$ to remember the estimated contribution.  After we put $f_1$, 
% \ldots, $f_m$, we estimate the contribution of $f_{m+1}$, \ldots, $f_n$
% again by tentatively building double-columned output to have $H'_{m+1}$,
% \ldots, $H'_n$ where $H'_i$ is the height plus depth of the double-columned 
% box of $f_{m+1}$, \ldots, $f_i$.  Then we calculate
% 
% \begin{equation}\label{eq:eta}
% \eta=\max_{m<i\leq n}(H'_i-\sum_{\llap{$\scriptstyle j=m+1$\hss}}^i\DH_i)
% \end{equation}
% 
% and |\insert| an empty |\vbox| of $\eta$ high which is conceptually placed 
% at the top of next page.  We also add an element $(0,\eta)$ at the head of 
% $L$.  Remember that this compensation makes $\DH_i$ overestimated and thus
% the next page will be too short if a part of $f_{m+1}$, \ldots, $f_n$ are
% still deferred on the next page building as noted in \S\ref{sec:prob}.
% However, this overestimation is unlikely revealed because we also
% |\insert| an empty |\vbox| whose negative height $\eta'$ is;
% 
% \begin{equation}\label{eq:eta'}
% \eta'=H'_n-(\sum_{\llap{$\scriptstyle j=m+1$\hss}}^n\DH_i+\eta)
% \end{equation}
% 
% at the tail of the main vertical list which is not yet |\output|, add an
% element $(0,\eta')$ to the tail of $L$, and set $H_n$ to $H'_n$.  That is, 
% if the next page has a |\par|, the overestimation is reset.
%
% 
%
% \subsubsection{Register Declaration}
% \label{sec:imp-dfn-decl}
% 
% First of all, we declare the following three switches, together with user
% interface commands to turn them.
%
% \begin{itemize}
% \item
% \begin{macro}{\ifdfn@allowcbreak}
% \begin{macro}{\DFNallowcbreak}
% \begin{macro}{\DFNinhibitcbreak}
% |\ifdfn@allowcbreak| is true (default) if |\DFNallowcbreak| is in effect
% to allow a footnote is broken into two columns.  It is false if
% |\DFNinhibitcbreak| is in effect to enclose a footnote by a |\vbox| to
% inhibit the breaking.
% \end{macro}\end{macro}\end{macro}
%
% \item
% \begin{macro}{\ifdfn@trysingle}
% \begin{macro}{\DFNtrysingle}
% \begin{macro}{\DFNalwaysdouble}
% |\ifdnf@trysingle| is true (default) if |\DFNtrysingle| is in effect to
% place footnotes only in the left column if possible.  It is false if
% |\DFNalwaysdouble| is in effect not to try single-columning.
% \end{macro}\end{macro}\end{macro}
% 
% \item
% \begin{macro}{\ifdfn@ruleboth}
% \begin{macro}{\DFNruleboth}
% \begin{macro}{\DFNruleleft}
% |\ifdfn@ruleboth| is true if |\DFNruleboth| is in effect to draw
% |\footnoterule| over both columns.  It is false (default) if
% |\DFNruleleft| is in effect to draw it over the left column only.
% \end{macro}\end{macro}\end{macro}
% \end{itemize}
%
% We also use a working switch |\@tempswa|.
%
%    \begin{macrocode}

%% Register Declaration

\newif\ifdfn@allowcbreak \dfn@allowcbreaktrue
\def\DFNallowcbreak{\dfn@allowcbreaktrue}
\def\DFNinhibitcbreak{\dfn@allowcbreakfalse}

\newif\ifdfn@trysingle \dfn@trysingletrue
\def\DFNtrysingle{\dfn@trysingletrue}
\def\DFNalwaysdouble{\dfn@trysinglefalse}

\newif\ifdfn@ruleboth \dfn@rulebothfalse
\def\DFNruleboth{\dfn@rulebothtrue}
\def\DFNruleleft{\dfn@rulebothfalse}

%    \end{macrocode}
%
% \begin{macro}{\c@DFNsloppiness}
% Then we declare a \LaTeX{} counter |DFNsloppiness| that is the value of
% |\hbadness| of the footnote paragraphs, and set it to the default value
% 5000.
% \end{macro}
% We also use a working |\count| register, |\@tempcnta|.
%
%    \begin{macrocode}
\newcounter{DFNsloppiness}\c@DFNsloppiness5000

%    \end{macrocode}
%
% \begin{dummymacro}
% Next come the declarations of the following six |\dimen| registers.
%
% \begin{itemize}
% \item
% \begin{macro}{\DFNcolumnsep}
% \begin{macro}{\DFNcolumnwidth}
% |\DFNcolumnsep| and |\DFNcolumnwidth| are the counterparts of |\columnsep| 
% and |\columnwidth|.  Their defaults are both $-|\maxdimen|$ to indicate
% that they are set to the default values in |\document|.
% \end{macro}\end{macro}
%
% \item
% \begin{macro}{\dfn@fnht}
% |\dfn@fnht| is $H_i$ shown in \S\ref{sec:imp-dfn-ovv}.
% \end{macro}
%
% \item
% \begin{macro}{\dfn@fnmaxdp}
% |\dfn@fnmaxdp| has the depth of |\strutbox| in |\footnotesize| and is used 
% to set |\boxmaxdepth| and |\splitmaxdepth| for footnote boxes.
% \end{macro}
%
% \item
% \begin{macro}{\dfn@dima}
% \begin{macro}{\dfn@dimb}
% \begin{DFNinhibitcbreak}%
% |\dfn@dima| and |\dfn@dimb| are our own scratch-pads.  We also use
% \LaTeX's scratch-pads |\@tempdima| and |\@tempdimb|\footnote{
%
% \cs{@tempdimc} is not used because it is unavailable in \LaTeX-2.09.}.
% \end{DFNinhibitcbreak}%
% \end{macro}\end{macro}
% \end{itemize}
% \end{dummymacro}
%
%    \begin{macrocode}
\newdimen\DFNcolumnsep \DFNcolumnsep-\maxdimen
\newdimen\DFNcolumnwidth \DFNcolumnwidth-\maxdimen
\newdimen\dfn@fnht
\newdimen\dfn@fnmaxdp {\footnotesize \global\dfn@fnmaxdp\dp\strutbox}
\newdimen\dfn@dima \newdimen\dfn@dimb

%    \end{macrocode}
%
% \begin{macro}{\dfn@ins}
% \begin{macro}{\dfn@boxa}
% \begin{macro}{\dfn@boxb}
% Next declarations are for boxes, |\dfn@ins| for $F$ shown in
% \S\ref{sec:imp-dfn-ovv}, and two working registers |\dfn@boxa| and
% |\dfn@boxb|.
% \end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}
\newbox\dfn@ins
\newbox\dfn@boxa \newbox\dfn@boxb

%    \end{macrocode}
%
% \begin{macro}{\dfn@output}
% Finally, we declare a |\toks| register |\dfn@output| that contains
% original token list for |\output| that is refered in our own version of
% it.
% \end{macro}
%
%    \begin{macrocode}
\newtoks\dfn@output \dfn@output\output

%%^L
%    \end{macrocode}
% 
% 
%
% \subsubsection{Make a Footnote}
% \label{sec:imp-dfn-fntext}
%
% \begin{macro}{\dfn@footnotetext}
% \begin{macro}{\dfn@latex@footnotetext}
% \begin{macro}{\@footnotetext}
% \begin{macro}{\dfn@gobble}
% To implement a part of our algorithm described in \S\ref{sec:imp-dfn-ovv},
% we have to modify the part of |\footnote|, |\@footnotext|\Meta{text}, in
% which \LaTeX{} does |\insert\footins|\Meta{text$'$}.  Our own
% |\@footnotext|, named |\dfn@footnotetext|, first typesets \meta{text$'$}
% in a box |\dfn@boxa| ($f_i$) by calling \LaTeX's \hbox{|\@footnotetext|}
% that is renamed |\dfn@latex@footnotetext|.  Before calling it, we make
% |\insert| |\let|-equal to |\dfn@gobble| that simply returns the body to be
% |\insert|-ed, and set |\columnwidth| and |\hbadness| to appropriate values
% to make double-columned paragraphs.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\@makefnmark}
% \begin{macro}{\dfn@makefnmark}
% \begin{DFNinhibitcbreak}%
% The other operation performed prior to calling |\dfn@latex@footnotetext|
% is redefinition of |\@makefnmark| so that it |\smash|-es the footnote
% mark produced by its original version |\dfn@makefnmark|.  This prevents
% the first line of footnote being too tall\footnote{
%
% The superscripted footnote number is sometimes taller than \cs{strut} of
% \cs{footnotesize}.}
%
% and makes columns well-balanced.
% \end{DFNinhibitcbreak}%
% \end{macro}\end{macro}
%
% \begin{dummymacro}
% Then we calculate $h_i$ (|\dfn@dima|) and append $f_i$ to the tail of $F$
% (|\dfn@ins|).  Since we need that $h_i$ is positive to get $f_i$ from $F$
% afterward, we enclose $f_i$ with a |\vbox| of 1\,|sp| high if $h_i$ is
% unexpectedly non-positive.  The appendix is done by |\unvbox| of $f_i$ if
% |\ifdfn@allowcbreak| is true, while the |\vbox| envelope is kept otherwise
% to inhibit column break in $f_i$.  In both cases, $f_i$ is preceded by
% |\allowbreak| and |\nointerlinepenalty| to allow column break and to
% prevent glue for |\baslineskip| inserted.
% \end{dummymacro}
%
% \begin{macro}{\dfn@split}
% Next we evaluate $H_i$ by tentatively building double-columned typesetting
% result from $F$.  This is done by the macro;
%
% \begin{quote}
% |\dfn@split|\meta{height}\meta{src}\meta{dst}\meta{maxdepth}\meta{topskip}
% \end{quote}
%
% which |\vsplit|-s the box \meta{src} at \meta{height} to set the first
% half to \meta{dst} while leaving the second half in \meta{src}.  The
% parameters for |\vsplit|, |\splitmaxdepth| and |\splittopskip|, are given
% by \meta{maxdepth} and \meta{topskip}.  After |\vsplit|, it sets
% conceptual height and depth of double-columned result, $h_D$
% (|\@tempdima|) and $d_D$ (|\@tempdimb|) as follows.
%
% \begin{eqnarray*}
% h_D&=&\max({\it ht}(\meta{src}),\;{\it ht}(\meta{dst}))\\
% d_D&=&\max({\it ht}(\meta{src})+{\it dp}(\meta{src}),\;
%	   {\it ht}(\meta{dst})+{\it dp}(\meta{dst}))-h_D
% \end{eqnarray*}
%
% Thus we have $H_i=h_D+d_D$ (|\dfn@fnht|) and $\DH_i=H_i-H_{i-1}$
% (|\@tempdima|).
% \end{macro}
%
% \begin{macro}{\dfn@list}
% Finally we |\insert| an empty |\vbox| of $\DH_i$ high, and append
% |\@elt|\meta{$h_i$}\meta{$\DH_i$} at the tail of $L$ (|\dfn@list|).  Note
% that $h_i$ and $\DH_i$ are represented with the unit |sp| rather than |pt| 
% to avoid conversion error.
% \end{macro}
%
%    \begin{macrocode}

%% Make a Footnote

\long\def\dfn@footnotetext#1{{\setbox\dfn@boxa\vbox{
        \let\insert\dfn@gobble
        \columnwidth\DFNcolumnwidth \hbadness\c@DFNsloppiness
        \def\@makefnmark{\smash{\dfn@makefnmark}}
        \dfn@latex@footnotetext{#1}\par \boxmaxdepth\dfn@fnmaxdp}%
        \dfn@dima\ht\dfn@boxa \advance\dfn@dima\dp\dfn@boxa
        \ifdim\dfn@dima>\z@\else
                \dfn@dima1sp\relax
                \setbox\dfn@boxa\vbox{\vbox to1sp{\unvbox\dfn@boxa\vfil}}\fi
        \global\setbox\dfn@ins\vbox{\boxmaxdepth\dfn@fnmaxdp
                \ifvoid\dfn@ins\else
                        \unvbox\dfn@ins \allowbreak \nointerlineskip \fi
                \ifdfn@allowcbreak \unvbox \else \box \fi \dfn@boxa}%
        \setbox\dfn@boxa\copy\dfn@ins
        \dfn@split{.5\ht\dfn@boxa}\dfn@boxa\dfn@boxb\dfn@fnmaxdp\footnotesep
        \advance\@tempdima\@tempdimb \@tempdimb\@tempdima
        \advance\@tempdima-\dfn@fnht \global\dfn@fnht\@tempdimb
        \insert\footins{\floatingpenalty\@MM \vbox to\@tempdima{}}%
        \xdef\dfn@list{\dfn@list\@elt{\number\dfn@dima}{\number\@tempdima}}}}
\let\dfn@latex@footnotetext\@footnotetext
\let\@footnotetext\dfn@footnotetext
\long\def\dfn@gobble#1#2{#2}
\let\dfn@makefnmark\@makefnmark
\def\dfn@list{}

\def\dfn@split#1#2#3#4#5{\@tempdima#1\relax
        \vbadness\@M \vfuzz\maxdimen \splitmaxdepth#4\splittopskip#5\relax
        \setbox#3\vsplit#2to\@tempdima
        \setbox#3\vbox{\boxmaxdepth#4\unvbox#3}%
        \@tempdima\ht#3\advance\@tempdima\dp#3\relax
        \@tempdimb\ht#2\advance\@tempdimb\dp#2\relax
        \ifdim\@tempdimb<\@tempdima \@tempdimb\@tempdima \fi
        \@tempdima\ht#3\ifdim\@tempdima<\ht#2\@tempdima\ht#2\fi
        \advance\@tempdimb-\@tempdima}

%%^L
%    \end{macrocode}
%
% 
%
% \subsubsection{Output Footnotes}
% \label{sec:imp-dfn-makecol}
%
% \begin{macro}{\dfn@makecol}
% The other part of our algorithm described in \S\ref{sec:imp-dfn-ovv} is
% implemented as our own version of |\@makecol|, named |\dfn@makecol|.
% First we check if |\footins| has |\insert|-ed empty boxes for $f_1$,
% \ldots, $f_m$, and do (almost) nothing if none.  Then we get $H_m$
% (|\dfn@dima|) that is the height of |\footins|.
% \end{macro}
%
% \begin{macro}{\dfn@countins}
% Next we count the boxes in |\footins| to get $m$ (|\@tempcnta|) by
% |\dfn@countins|.  It repeatedly removes the |\lastbox| of |\footins|
% counting up $m$ until no box is obtained.
% \end{macro}
%
% \begin{macro}{\dfn@elt@getht}
% \begin{macro}{\dfn@endgetht}
% Then we {\em execute} $L$ (|\dfn@list|) making |\@elt| |\let|-equal to
% |\dfn@elt@getht| to calculate $s_m=\sum_{i=1}^m h_i$ (|\@tempdima|).  This
% execution also removes $(h_1,\DH_1)$, \ldots, $(h_m,\DH_m)$ from $L$ by
% |\dfn@endgetht|.
% \end{macro}\end{macro}
%
% \begin{dummymacro}
% Note that $s_m$ could be zero if |\footins| only has |\vbox|-es for error
% compensation, i.e.\ $(0,\eta)$ and/or $(0,\eta')$.  In this case, we don't 
% have any footnotes to be output.  This decision is correct because we
% enclosed footnotes having non-positive height by a |\vbox| of 1\,|sp| high
% as described in \S\ref{sec:imp-dfn-fntext}.  Thus we can safely pick $f_1$,
% \ldots, $f_m$ from $F$ by |\vsplit|-ting it at $s_m$ by |\dfn@split|
% \footnote{
%
% Unfortunately, this is not perfectly safe because $f_i$ may have
% stretchable and/or shrinkable glues together with negative penalties which
% could make the break point between $f_m$ and $f_{m+1}$ not least costly.
% Although we could have a perfect solution to cope with this unsafeness, we 
% ignore such an unusual case because of the simplicity of implementation.},
%
% and store them in |\dfn@boxa|.
% \end{dummymacro}
%
% \begin{dummymacro}
% Then if |\dfn@trysingle| is true, we check whether the page has enough
% space to put $f_1$, \ldots, $f_m$ in one column by examining the following 
% inequality;
% $$
% r\geq h_p+h_d+\sigma+s_m
% $$
% where $r$ is |\@colroom|, $h_p$ and $h_d$ are height and depth of the body 
% of the page given through |\box\@cclv|, and $\sigma$ is natural space of
% |\skip\footins|\footnote{
%
% Thus we ignore the shrinkability of the page body and \cs{skip}\cs{footins},
% because the former is hardly obtained.  Remember \cs{pageshrink} is not the
% total shrinkability at the break point but at somewhere \cs{output} routine
% is invoked.}.
%
% Note that $h_p$ and $h_d$ are {\em not} height and depth of |\box\@cclv|,
% which are |\pagegoal| and depth of the last item (or |\maxdepth|), but
% those of the |\vbox| containing |\unvbox\@cclv|\footnote{
%
% \TeX{} does not provide any other more convenient way to get them.}.
%
% If the inequality is satisfied, $f_1$, \ldots, $f_m$ are simply put into
% the box |\footins| together with |\footnoterule| preceding them.
% \end{dummymacro}
%
% \begin{dummymacro}
% Otherwise, we split $f_1$, \ldots, $f_m$ at $H_m$ by |\dfn@split| to
% obtain both columns to output.  Then each column, preceded by
% |\footnoterule| and follwed by |\vss|, is put into a |\vbox| whose height
% is {\em conceptual} one calculated by |\dfn@split| so that first baselines
% of both column are adjusted.  This also adjusts the last baseline of taller
% column with those of footnotes in other pages if |\makeFNbottom| of
% \textsf{fnpos} is in effect.  Note that |\footnoterule| of the right
% column will not be put if |\ifdfn@ruleboth| is false, but a vertical space
% to compensate the height and depth of |\footnoterule| is although it is
% usually zero.  For the completeness, we don't forget to set |\prevdepth|
% to the depth of |\footnoterule| though it has also no effect.
% \end{dummymacro}
%
% \begin{dummymacro}
% Then two boxes are put into |\hbox|-es of |\DFNcolumnwidth| wide separated 
% by a space of |\DFNcolumnsep| surrounded by another |\hbox|.  This outmost 
% |\hbox| is redundantly enclosed by a |\vbox| to which |\footins| is set,
% because it will be unsealed by |\unvbox| afterward.
% \end{dummymacro}
%
% \begin{macro}{\dfn@elt@adjust}
% Now we finished the job for footnotes to be output to the current page,
% and start to take care of those left in $L$ and defered to the next (or
% farther) page.  First, we {\em execute} $L$ (|\dfn@list|) making |\@elt|
% |\let|-equal to |\dfn@elt@adjust| to calculate $\eta$ (|\dfn@dimb|) of the
% equation (\ref{eq:eta}) in \S\ref{sec:imp-dfn-ovv}.  It also calculate
% $H'_n$ (|\@tempdima|) and $\sum_{j=m+1}^n H_i$ (|\dfn@fnht|) for $\eta'$
% of the equation (\ref{eq:eta'}) in \S\ref{sec:imp-dfn-ovv}.
% \end{macro}
%
% \begin{dummymacro}
% Then if $\eta$ is positive, we add $(0,\eta)$ to the head of $L$ and
% |\insert| an empty box of $\eta$ high to compensate the underestimation.
% Since \TeX{} places the vertical list constructed in |\output| routine
% at the page break point, the |\insert|-ion for $\eta$ is followed by those 
% for $f_{m+1}$, \ldots, $f_n$.
% \end{dummymacro}
% 
% \begin{macro}{\output}
% \begin{macro}{\dfn@afteroutput}
% We also add $(0,\eta')$ to the tail of $L$ and |\insert| an empty box of
% $\eta'$ high to compenstate the overestimation caused by $\eta$, if
% $\eta'$ is negative.  This |\insert|-ion, however, should follow
% $f_{m+1}$, \ldots, $f_n$.  To do this delayed |\insert|-ion, we modify
% |\output| so that it invoke |\dfn@afteroutput| through |\aftergroup|.
% Since \TeX{} closes the implicit group for |\output| {\em after} it
% reconstructs main vertical list\footnote{
%
% This fact is not described in \TeX{}book but \texttt{tex.web} does so.},
%
% |\dfn@afteroutput| will |\insert| the box where we wish to place and
% then nullify itself.
% \end{macro}\end{macro}
%
% \begin{macro}{\dfn@footnoterule}
% Now we finished everything for doulbe-columned footnotes.  So, we call
% \LaTeX's \hbox{|\@make|}\allowbreak\hbox{|col|}, |\dfn@latex@makecol|, to
% make a page with |\footins|.  Since the macro calls |\footnoterule| before
% |\footins| is put and we have already done it, we temporarily nullify
% |\footnoterule| and reactivate it after the macro with its original
% definition saved in |\dfn@footnoterule|.
% \end{macro}
%
%    \begin{macrocode}

%% Output Footnotes

\def\dfn@makecol{{\ifvoid\footins\else
        \dfn@dima\ht\footins
        \@tempcnta\z@ \dfn@countins
        \@tempdima\z@ \let\@elt\dfn@elt@getht
        \dfn@list\@nil
        \ifdim\@tempdima=\z@\else
        \dfn@split\@tempdima\dfn@ins\dfn@boxa\z@\z@
        \global\setbox\dfn@ins\box\dfn@ins
        \@tempswatrue
        \ifdfn@trysingle
                \setbox\dfn@boxb\vbox{\unvcopy\@cclv}\@tempdima\@colroom
                \advance\@tempdima-\ht\dfn@boxb \advance\@tempdima-\dp\dfn@boxb
                \advance\@tempdima-\skip\footins
                \advance\@tempdima-\ht\dfn@boxa
                \ifdim\@tempdima<\z@\else \@tempswafalse
                        \global\setbox\footins\vbox{\boxmaxdepth\dfn@fnmaxdp
                                \footnoterule \unvbox\dfn@boxa}\fi\fi
        \if@tempswa
        \dfn@split{\dfn@dima}\dfn@boxa\dfn@boxb\dfn@fnmaxdp\footnotesep
        \global\setbox\footins\vbox{\hbox{%
                \hbox to\DFNcolumnwidth{\vbox to\@tempdima{\footnoterule
                        \unvbox\dfn@boxb\vss}\hss}\hskip\DFNcolumnsep
                \hbox to\DFNcolumnwidth{\ifvoid\dfn@boxa\else
                        \vbox to\@tempdima{
                                \setbox\@tempboxa\vbox{\footnoterule}
                                \ifdfn@ruleboth \unvbox\@tempboxa
                                \else \@tempdima\ht\@tempboxa
                                        \advance\@tempdima\dp\@tempboxa
                                        \vskip\@tempdima
                                        \prevdepth\dp\@tempboxa \fi
                                \unvbox\dfn@boxa\vss}\fi\hss}}}\fi\fi
        \global\dfn@fnht\z@
        \ifx\dfn@list\@empty\else
                \let\@elt\dfn@elt@adjust \dfn@dima\z@ \dfn@dimb\z@
                \dfn@list \global\advance\dfn@fnht\dfn@dimb
                \let\@elt\relax
                \ifdim\dfn@dimb>\z@
                        \xdef\dfn@list{\@elt{0}{\number\dfn@dimb}\dfn@list}%
                        \insert\footins{\floatingpenalty\@MM
                                \vbox to\dfn@dimb{}}\fi
                \ifdim\dfn@fnht>\@tempdima
                        \@tempdimb\@tempdima \advance\@tempdimb-\dfn@fnht
                        \global\dfn@fnht\@tempdima
                        \xdef\dfn@list{\dfn@list\@elt{0}{\number\@tempdimb}}%
                        \xdef\dfn@afteroutput{\insert\footins{
                                        \floatingpenalty\@MM
                                        \vbox to\number\@tempdimb sp{}}%
                                \global\let\noexpand\dfn@afteroutput\relax}%
                \fi\fi
        \fi}%
        \let\footnoterule\relax \dfn@latex@makecol
        \let\footnoterule\dfn@footnoterule}
\let\dfn@footnoterule\footnoterule

\def\dfn@countins{\setbox\footins\vbox{\unvbox\footins
                \global\setbox\dfn@boxa\lastbox}%
        \ifvoid\dfn@boxa \let\next\relax
        \else \advance\@tempcnta\@ne \let\next\dfn@countins \fi \next}

\def\dfn@elt@getht#1#2{\advance\@tempdima#1sp\relax \advance\@tempcnta\m@ne
        \ifnum\@tempcnta>\z@ \let\next\relax
        \else\let\next\dfn@endgetht \fi \next}
\def\dfn@endgetht#1\@nil{\gdef\dfn@list{#1}}

\def\dfn@elt@adjust#1#2{\advance\dfn@dima#1sp\advance\dfn@fnht#2sp\relax
        \ifvoid\dfn@ins \@tempdima\z@ \@tempdimb\z@
        \else \setbox\dfn@boxa\copy\dfn@ins
                \dfn@split\dfn@dima\dfn@boxa\dfn@boxb\z@\z@
                \dfn@split{.5\ht\dfn@boxb}\dfn@boxb\dfn@boxa
                        \dfn@fnmaxdp\footnotesep
                \advance\@tempdimb\@tempdima \@tempdima\@tempdimb \fi
        \advance\@tempdimb-\dfn@fnht\relax
        \ifdim\@tempdimb>\dfn@dimb \dfn@dimb\@tempdimb \fi}

\let\dfn@afteroutput\relax
\output{\the\dfn@output \aftergroup\dfn@afteroutput}

%%^L
%    \end{macrocode}
%
% 
%
% \subsubsection{Initialization, etc.}
% \label{sec:imp-dfn-init}
%
% \begin{macro}{\dfn@document}
% \begin{macro}{\document}
% Since the default value of |\DFNcolumnsep| is that of |\columnsep| that
% may be set in other styles and/or preamble, we have to modify |\document|
% to set |\DFNcolumnsep| to the value of |\columnsep| if it is negative
% after the invocation of the original version of |\document|,
% |\dfn@document|.  We also set |\DFNcolumnwidth| to its default value
% calculated from |\DFNcolumnsep| and |\textwidth| if it is negative.
% \end{macro}\end{macro}
%
% \begin{macro}{\dfn@latex@makecol}
% \begin{macro}{\@makecol}
% Another reason why we modify |\document| is the modification of
% |\@makecol|.  In order to allow our footnote styles (and others hopefully) 
% to be loaded in any order, we capture possibly-modified definition of
% |\@makecol| in |\document| to save it in |\dfn@latex@makecol| as the
% original version, and make |\@makecol| |\let|-equal to our own version
% |\dfn@makecol|.
% \end{macro}\end{macro}
%
%    \begin{macrocode}

%% Initialization, etc.

\let\dfn@document\document
\def\document{\dfn@document
        \ifdim\DFNcolumnsep<\z@ \DFNcolumnsep\columnsep \fi
        \ifdim\DFNcolumnwidth<\z@
                \DFNcolumnwidth\textwidth
                \advance\DFNcolumnwidth-\DFNcolumnsep
                \divide\DFNcolumnwidth\tw@ \fi
        \dfn@fnht\z@
        \let\dfn@latex@makecol\@makecol
        \let\@makecol\dfn@makecol}

%    \end{macrocode}
%
% \begin{macro}{\dfn@twocolumn}
% \begin{macro}{\twocolumn}
% \begin{macro}{\dfn@onecolumn}
% \begin{macro}{\onecolumn}
% We also switch |\@makecol| to original\slash own version in modified
% |\twocolumn|\slash |\onecolumn| because double-columned footnotes are
% available only in single column documents.  In those macros, prior to
% the invocation of their original versions, |\dfn@twocolumn| and
% |\dfn@onecolumn|, |\@footnotetext| is also set to corresponding macros that
% are original |\dfn@latex@footnotetext| or our own |\dfn@footnotetext|.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
%    \begin{macrocode}
\let\dfn@twocolumn\twocolumn
\def\twocolumn{\clearpage
        \let\@footnotetext\dfn@latex@footnotetext
        \let\@makecol\dfn@latex@makecol
        \dfn@twocolumn}
\let\dfn@onecolumn\onecolumn
\def\onecolumn{\clearpage
        \let\@footnotetext\dfn@footnotetext
        \let\@makecol\dfn@makecol
        \dfn@onecolumn}
%    \end{macrocode}
% 
% \iffalse
%</dblfnote>
% \fi
% 
% 
%
% \IndexPrologue{\newpage\section*{Index}
% Italicized number refers to the page where the specification and usage of
% corresponding entry is described, while underlined is for the
% implementation of the entry.}
% \Finale
% \GlossaryPrologue{\newpage\section*{Revision History}}
% \PrintChanges
\endinput