summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/dpfloat
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/dpfloat
Initial commit
Diffstat (limited to 'macros/latex/contrib/dpfloat')
-rw-r--r--macros/latex/contrib/dpfloat/README45
-rw-r--r--macros/latex/contrib/dpfloat/dpfloat.pdfbin0 -> 199453 bytes
-rw-r--r--macros/latex/contrib/dpfloat/dpfloat.sty114
-rw-r--r--macros/latex/contrib/dpfloat/dpfloat.tex76
4 files changed, 235 insertions, 0 deletions
diff --git a/macros/latex/contrib/dpfloat/README b/macros/latex/contrib/dpfloat/README
new file mode 100644
index 0000000000..6c5864bd4d
--- /dev/null
+++ b/macros/latex/contrib/dpfloat/README
@@ -0,0 +1,45 @@
+Formatting double-page floats in LaTeX
+
+You sometimes want to format two, full-page figures or tables to appear
+side-by-side in an opened book. The first figure must be on the left (even
+page) and the second figure must appear on the right (odd page).
+
+LaTeX provides no way to assure that two consecutive figures will come out
+this way. This double-page float package, dpfloat.sty, allows you to specify
+that a float must appear on an even page, and thereby allows you to format a
+double-page figure.
+
+ ------------------------------------------------------------------------
+
+You format a double-page figure by formatting two consecutive, full-page
+figures, specifying that the first must appear on a left page. The other
+will follow on the right page.
+
+It looks something like this:
+
+ \documentclass{...}
+
+ \usepackage{dpfloat}
+
+ \begin{document}
+
+ ...
+
+ % a double-page figure
+
+ \begin{figure}[p]% will be the left-side figure
+ \begin{leftfullpage}
+ This is the left side figure
+ \end{leftfullpage}
+ \end{figure}
+ \begin{figure}[p]% will be the right-side figure
+ \begin{fullpage}
+ This is the right side figure
+ \end{fullpage}
+ \end{figure}
+
+ % end of the figure
+
+ ...
+
+ \end{document}
diff --git a/macros/latex/contrib/dpfloat/dpfloat.pdf b/macros/latex/contrib/dpfloat/dpfloat.pdf
new file mode 100644
index 0000000000..ef128ba669
--- /dev/null
+++ b/macros/latex/contrib/dpfloat/dpfloat.pdf
Binary files differ
diff --git a/macros/latex/contrib/dpfloat/dpfloat.sty b/macros/latex/contrib/dpfloat/dpfloat.sty
new file mode 100644
index 0000000000..15eea00940
--- /dev/null
+++ b/macros/latex/contrib/dpfloat/dpfloat.sty
@@ -0,0 +1,114 @@
+% ========================================================================
+%
+% Copyright (c) 2006 The University of Washington
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Jim Fox, fox@washington.edu
+%
+% ========================================================================
+%
+%
+% double-page float package
+%
+% Jim Fox
+% fox@washington.edu
+% http://staff.washington.edu/fox/
+%
+
+%
+% Version history
+%
+% 2006/10/05: fix footer placement (suggestion by Mark Henning (mh@homolog.de)
+% 1997/09/21: original
+
+
+\ProvidesPackage{dpfloat}[2006/10/05]
+\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\@fpmin\maxdimen
+ \typeout{dpfloat 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
+
+% assure that any remaining floats are printed
+\def\@dpf@mtlist{}
+\AtEndDocument{\ifx\@deferlist\@dpf@mtlist\else\ifodd\count0\else\typeout{dpfloat added a blank page}\clearpage\ \clearpage\fi\fi}
+
+% end of dpfloat
diff --git a/macros/latex/contrib/dpfloat/dpfloat.tex b/macros/latex/contrib/dpfloat/dpfloat.tex
new file mode 100644
index 0000000000..611c308600
--- /dev/null
+++ b/macros/latex/contrib/dpfloat/dpfloat.tex
@@ -0,0 +1,76 @@
+\documentclass[pagesize=auto]{scrartcl}
+
+\usepackage{fixltx2e}
+\usepackage{etex}
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp}
+\usepackage{microtype}
+\usepackage{hyperref}
+
+\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
+\newcommand*{\pkg}[1]{\textsf{#1}}
+
+\areaset{14cm}{22.5cm}
+\addtokomafont{title}{\rmfamily}
+
+\title{The \pkg{dpfloat} package}
+\subtitle{Formatting double-page floats in \LaTeX}
+\author{Jim Fox, \mail{fox@washington.edu}}
+\date{2006/10/05}
+
+
+\begin{document}
+
+\maketitle
+
+\noindent
+You sometimes want to format two, full-page figures or tables to appear
+side-by-side in an opened book. The first figure must be on the left (even
+page) and the second figure must appear on the right (odd page).
+
+\LaTeX\ provides no way to assure that two consecutive figures will come out
+this way. This double-page float package, \pkg{dpfloat.sty}, allows you to specify
+that a float must appear on an even page, and thereby allows you to format a
+double-page figure.
+
+\bigskip
+
+You format a double-page figure by formatting two consecutive, full-page
+figures, specifying that the first must appear on a left page. The other
+will follow on the right page.
+
+It looks something like this:
+
+\small
+\noindent
+\begin{verbatim}
+\documentclass{...}
+
+\usepackage{dpfloat}
+
+\begin{document}
+
+ ...
+
+% a double-page figure
+
+ \begin{figure}[p]% will be the left-side figure
+ \begin{leftfullpage}
+ This is the left side figure
+ \end{leftfullpage}
+ \end{figure}
+ \begin{figure}[p]% will be the right-side figure
+ \begin{fullpage}
+ This is the right side figure
+ \end{fullpage}
+ \end{figure}
+
+% end of the figure
+
+ ...
+
+\end{document}
+\end{verbatim}
+
+\end{document}