X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo-proof_by_cases.tex;h=247d28049226213ae19173026680540fa94112c7;hb=a6c1d186ec5bbd8d02dfd2f057cd147afdfe900f;hp=f2d9b90987c8b894d74f8f38c41b16a620931029;hpb=d8b66e409213fa4d3392f654081eb8dd85f03c4c;p=mjotex.git diff --git a/mjo-proof_by_cases.tex b/mjo-proof_by_cases.tex index f2d9b90..247d280 100644 --- a/mjo-proof_by_cases.tex +++ b/mjo-proof_by_cases.tex @@ -8,9 +8,34 @@ % % Case 2 (x < 0): derp. % +\ifx\havemjoproofbycases\undefined +\def\havemjoproofbycases{1} -% Used below to define pcases. -\usepackage{enumitem} + +% Used below to define pcases. The ``loadonly'' parameter prevents +% a very bad interaction with the beamer document class. +\usepackage[loadonly]{enumitem} + +% Needed to perform division in the definition of \singleblskip. +\usepackage{calc} + +% A \baselineskip without the \baselinestretch scaling factor. Even +% though \baselinestretch defaults to 1.0, it doesn't really have that +% value. Thus to avoid division by zero, we need to do the ``is this +% thing empty?'' hack. +% +% If we use \baselineskip instead of \singleblskip in our list, things +% get real ugly when the text is e.g. double-spaced. +% +\newlength{\singleblskip} +\setlength{\singleblskip}{ + \baselineskip/\real{ + \if\relax\detokenize{\baselinestretch}\relax + \baselinestretch% + \else + 1% + \fi} +} % Using the enumitem package, we define a new type of list, called % ``pcases'' (proof by cases). Each case has a label with an arabic @@ -26,7 +51,7 @@ leftmargin=0pt, listparindent=\parindent, parsep=\parskip, - itemsep=\baselineskip} + itemsep=\singleblskip} % The optional argument here gets stuffed into the \thiscase macro, to % be called by pcases when it creates this list item. The \hfill is a @@ -35,5 +60,8 @@ % so we consume the rest of the line instead. \newcommand{\case}[1][]{ \def\thiscase{#1}% - \item \hfill\par\vspace{\baselineskip} + \item \hfill\par\vspace{\singleblskip} } + + +\fi