\def\algostep#1{\hbox to \algolabelwidth{\hss #1~~}}
\def\algoinit{
- \goodbreak
\begingroup
\algospacing
\inititemize
\def\proc#1{\typedalgo{\localestr{alg:proc}}{#1}}
\def\headlessalgo{\algoinit}
-\def\endalgo{\goodbreak\endlist\endgroup}
+\def\endalgo{\endlist\endgroup}
\let\endproc=\endalgo
\def\algoitem{%
\newbox\itembox
\newcount\itemcount
+% Penalties (changed at compatibility level 1)
+\newcount\preitemizepenalty \preitemizepenalty=0
+\newcount\postitemizepenalty \postitemizepenalty=0
+
\def\preitemize{
\ifitems
\vskip\prenesteditemizeskip
\advance\leftskip by \nesteditemindent
\advance\rightskip by \nesteditemnarrow
\else
+ \ifnum\preitemizepenalty=0\else\penalty\preitemizepenalty\fi
\vskip\preitemizeskip
\advance\leftskip by \itemindent
\advance\rightskip by \itemnarrow
\ifitems
\vskip\postnesteditemizeskip
\else
+ \ifnum\postitemizepenalty=0\else\penalty\postitemizepenalty\fi
\vskip\postitemizeskip
\fi
}
\expandafter\let\csname ucwmod:#1\endcsname=\relax
}
+% Compatibility levels
+% We try to be backwards compatible as much as we can, so all changes in behavior
+% (except for addition of new control sequences) are versioned. By default, ucwmac
+% starts in compatibility level 0, which should produce the same results as historic
+% versions of ucwmac. Use \ucwcompat{level} to upgrade to a given level, or if you
+% do not care about compatibility, \ucwcompat\ucwmaxcompat.
+
+\chardef\ucwcurrentcompat=0 % Currently active compatibility level
+\chardef\ucwmaxcompat=1 % Maximum supported compatibility level
+
+\def\ucwcompat#1{
+ \ucwcurrentcompat=#1
+ \ifcase #1
+ % Level 0 (default): old ucwmac
+ \or % Level 1
+ \preitemizepenalty=-500
+ \postitemizepenalty=-500
+ \else\errmessage{Unsupported compatibility level #1 requested.}
+ \fi
+}
+
%%% Epilog %%%
% Let's hide all internal macros