summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dpfloat/dpfloat.sty
blob: 8865453fc04528e0fd2c44a505cfec4ff2d22194 (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
% double-page float package
%
% Copyright University of Washington
%
% Jim Fox
% fox@u.washington.edu
% http://weber.u.washington.edu/~fox/
%

\ProvidesPackage{dpfloat}[1997/09/21]
\NeedsTeXFormat{LaTeX2e}
 
%  This package allows you to format a double-page figure or table
% 
%  It provides two environments:
% 
%    {fullpage}      makes a full page figure or table
%    {leftfullpage}  like fullpage, but guarantees a left side page
%
%  Example use:
%   
% -------------------------------------------------------
%      \begin{figure}[p]% will be the left-side figure
%        \begin{leftfullpage}
%          ...
%        \end{leftfullpage}
%      \end{figure}
%      \begin{figure}[p]% will be the right-side figure
%        \begin{fullpage}
%          ...
%        \end{fullpage}
%      \end{figure}
% -------------------------------------------------------
%
%  
%  LaTeX's output routine is modified to reject left-page floats
%  if they appear on odd pages (right page).  These will then
%  be moved to the next page (a left page).
%
%  This is obviously dependent upon specific details of the
%  output routine which are probably subject to change without notice.
%  

\newif\if@LP \@LPfalse

% For each float we define a macro indicating whether or not
% it is 'left-page' only

\newbox\@@wholepage
\def\fullpage{\setbox\@@wholepage=\vbox\bgroup}
\def\endfullpage{\egroup\dp\@@wholepage\z@
   \vbox to\textheight{\vss\unvbox\@@wholepage\vss}}
\def\leftfullpage{\setbox\@@wholepage=\vbox\bgroup}
\def\endleftfullpage{\egroup\dp\@@wholepage\z@
   \vbox to\textheight{\vss\unvbox\@@wholepage\vss}\global\@LPtrue}

\let\oldend@float\end@float
\def\end@float{%
  \if@LP\global\@namedef{LP:\expandafter\string\@currbox}{L}%
  \else \global\@namedef{LP:\expandafter\string\@currbox}{X}%
  \fi
   \global\@LPfalse
  \oldend@float
}

% Reject a left-page float that appears on an even page

\if@twoside

% reject a left-side float that appears on an odd page
 \let\old@xtryfc\@xtryfc
 \def\@xtryfc #1{%
   \expandafter\if\csname LP:\string#1\endcsname L%
      \ifodd\count0\global\@colht\z@
          \typeout{I moved a leftpage float from page \the\count0.}%
      \fi\fi
    \old@xtryfc #1}

\else

% if you want to do something special for one-sided printing
% do it here

\fi

% end of dpfloat