X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucwmac.tex;h=6c7a5dec709091f01ec3e7ebf9c0ff9b65bfe290;hb=9d61b4ef87dbbff2ff43f6b6af3b7299e496f0e7;hp=87c0b4608ac2cbc83a85d371aa5e06992f2f44bf;hpb=f858ee391f0a68981e4a5e5a88411966b73c60e6;p=ucwmac.git diff --git a/ucwmac.tex b/ucwmac.tex index 87c0b46..6c7a5de 100644 --- a/ucwmac.tex +++ b/ucwmac.tex @@ -231,12 +231,17 @@ \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 @@ -248,6 +253,7 @@ \ifitems \vskip\postnesteditemizeskip \else + \ifnum\postitemizepenalty=0\else\penalty\postitemizepenalty\fi \vskip\postitemizeskip \fi } @@ -357,6 +363,27 @@ \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