commit 40d6caf08a55186d2edb0ecf649791bb54385e74
parent d49e86f13e843c3979c9e2c1580c8e59021ed073
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Sat, 11 Jan 2014 19:27:15 -0700
Scribble Latex/PDF: avoid new "stabular.sty" by embedding a copy of old
original commit: f78a25ce41b15d53f710c4c93abfa2e446213ac6
Diffstat:
1 file changed, 125 insertions(+), 3 deletions(-)
diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex b/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex
@@ -3,7 +3,6 @@
\usepackage{graphicx}
\usepackage{hyperref}
\renewcommand{\rmdefault}{ptm}
-\usepackage{stabular}
\usepackage{relsize}
\usepackage{wasysym}
\usepackage{textcomp}
@@ -98,8 +97,131 @@
% Tables
% The `stabular' environment seems to be the lesser of evils among
-% page-breaking table environments:
-\newenvironment{bigtabular}{\begin{stabular}}{\end{stabular}}
+% page-breaking table environments (and we've made a copy as ``pltstabular'
+% to make sure that it doesn't change).
+
+\makeatletter
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{pltstabular is a modification of stabular}
+%% A renamed vsetion of:
+%% stabular.sty
+%% Copyright 1998 Sigitas Tolu\v sis
+%% VTeX Ltd., Akademijos 4, Vilnius, Lithuania
+%% e-mail sigitas@vtex.lt
+%% http://www.vtex.lt/tex/download/macros/
+%%
+% This program can 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 (at your option) any later version.
+%
+% PURPOSE: Improve tabular environment.
+%
+% SHORT DESCRIPTION:
+%
+% Changed internal commands: \@mkpream, \@addamp, \@xhline
+%
+% Provides new commands in tabular (used after command \\):
+% \emptyrow[#1]
+% -------------
+% Adds empty row, #1 - height of the row
+%
+% \tabrow{#1}[#2]
+% ---------------
+% Adds row of natural height: #1\\[#2]
+%
+% Provides new environments: pltstabular and pltstabular*
+% -------- ---------
+% One more multi-page version of tabular
+%
+%
+\def\empty@finalstrut#1{%
+ \unskip\ifhmode\nobreak\fi\vrule\@width\z@\@height\z@\@depth\z@}
+\def\no@strut{\global\setbox\@arstrutbox\hbox{%
+ \vrule \@height\z@
+ \@depth\z@
+ \@width\z@}%
+ \gdef\@endpbox{\empty@finalstrut\@arstrutbox\par\egroup\hfil}%
+}%
+\def\yes@strut{\global\setbox\@arstrutbox\hbox{%
+ \vrule \@height\arraystretch \ht\strutbox
+ \@depth\arraystretch \dp\strutbox
+ \@width\z@}%
+ \gdef\@endpbox{\@finalstrut\@arstrutbox\par\egroup\hfil}%
+}%
+\def\@mkpream#1{\@firstamptrue\@lastchclass6
+ \let\@preamble\@empty\def\empty@preamble{\add@ins}%
+ \let\protect\@unexpandable@protect
+ \let\@sharp\relax\let\add@ins\relax
+ \let\@startpbox\relax\let\@endpbox\relax
+ \@expast{#1}%
+ \expandafter\@tfor \expandafter
+ \@nextchar \expandafter:\expandafter=\reserved@a\do
+ {\@testpach\@nextchar
+ \ifcase \@chclass \@classz \or \@classi \or \@classii \or \@classiii
+ \or \@classiv \or\@classv \fi\@lastchclass\@chclass}%
+ \ifcase \@lastchclass \@acol
+ \or \or \@preamerr \@ne\or \@preamerr \tw@\or \or \@acol \fi}
+\def\@addamp{%
+ \if@firstamp
+ \@firstampfalse
+ \edef\empty@preamble{\add@ins}%
+ \else
+ \edef\@preamble{\@preamble &}%
+ \edef\empty@preamble{\expandafter\noexpand\empty@preamble &\add@ins}%
+ \fi}
+\newif\iftw@hlines \tw@hlinesfalse
+\def\@xhline{\ifx\reserved@a\hline
+ \tw@hlinestrue
+ \else\ifx\reserved@a\Hline
+ \tw@hlinestrue
+ \else
+ \tw@hlinesfalse
+ \fi\fi
+ \iftw@hlines
+ \aftergroup\do@after
+ \fi
+ \ifnum0=`{\fi}%
+}
+\def\do@after{\emptyrow[\the\doublerulesep]}
+\def\emptyrow{\noalign\bgroup\@ifnextchar[\@emptyrow{\@emptyrow[\z@]}}
+\def\@emptyrow[#1]{\no@strut\gdef\add@ins{\vrule \@height\z@ \@depth#1 \@width\z@}\egroup%
+\empty@preamble\\
+\noalign{\yes@strut\gdef\add@ins{\vrule \@height\z@ \@depth\z@ \@width\z@}}%
+}
+\def\tabrow#1{\noalign\bgroup\@ifnextchar[{\@tabrow{#1}}{\@tabrow{#1}[]}}
+\def\@tabrow#1[#2]{\no@strut\egroup#1\ifx.#2.\\\else\\[#2]\fi\noalign{\yes@strut}}
+%
+\def\endpltstabular{\crcr\egroup\egroup \egroup}
+\expandafter \let \csname endpltstabular*\endcsname = \endpltstabular
+\def\pltstabular{\let\@halignto\@empty\@pltstabular}
+\@namedef{pltstabular*}#1{\def\@halignto{to#1}\@pltstabular}
+\def\@pltstabular{\leavevmode \bgroup \let\@acol\@tabacol
+ \let\@classz\@tabclassz
+ \let\@classiv\@tabclassiv \let\\\@tabularcr\@stabarray}
+\def\@stabarray{\m@th\@ifnextchar[\@sarray{\@sarray[c]}}
+\def\@sarray[#1]#2{%
+ \bgroup
+ \setbox\@arstrutbox\hbox{%
+ \vrule \@height\arraystretch\ht\strutbox
+ \@depth\arraystretch \dp\strutbox
+ \@width\z@}%
+ \@mkpream{#2}%
+ \edef\@preamble{%
+ \ialign \noexpand\@halignto
+ \bgroup \@arstrut \@preamble \tabskip\z@skip \cr}%
+ \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox
+ \let\tabularnewline\\%
+% \let\par\@empty
+ \let\@sharp##%
+ \set@typeset@protect
+ \lineskip\z@skip\baselineskip\z@skip
+ \@preamble}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\makeatother
+
+\newenvironment{bigtabular}{\begin{pltstabular}}{\end{pltstabular}}
% For the 'boxed table style:
\newcommand{\SBoxedLeft}{\textcolor[rgb]{0.6,0.6,1.0}{\vrule width 3pt\hspace{3pt}}}
% Formerly used to keep the horizontal line for a definition on the same page: