X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mjotex.git;a=blobdiff_plain;f=mjo-proof_by_cases.tex;h=d853293d3416b7f5d25f4668e03570ed48a12ab4;hp=89a813b6d72c7d875a3f180a31ede6d419f6df78;hb=e49da80d1ec7904d4ba8ca0e4bb1a24b14c1d74e;hpb=000725538a8e32d37ebcc301e9f08eb56688a764 diff --git a/mjo-proof_by_cases.tex b/mjo-proof_by_cases.tex index 89a813b..d853293 100644 --- a/mjo-proof_by_cases.tex +++ b/mjo-proof_by_cases.tex @@ -9,8 +9,30 @@ % Case 2 (x < 0): derp. % -% 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 @@ -20,10 +42,13 @@ % another. \newlist{pcases}{enumerate}{1} \setlist[pcases]{ - label=\textbf{Case~\arabic*}~(\protect\thiscase)\textbf{:}, + label=\textbf{Case~\arabic*}:~\protect\thiscase\textbf{.}, ref=\arabic*, align=left, - leftmargin=\parindent} + leftmargin=0pt, + listparindent=\parindent, + parsep=\parskip, + 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 @@ -32,5 +57,5 @@ % so we consume the rest of the line instead. \newcommand{\case}[1][]{ \def\thiscase{#1}% - \item \hfill + \item \hfill\par\vspace{\singleblskip} }