% -*- Mode: TeX -*-

\ifx\thisfileis\anUndefinedMacro\input maybeload \fi

\thisfileis{<eb.tex.texlocal>unfinished} % abort loading if already loaded

% This file defines a LaTex environment that's convenient for marking unfinished
% sections of a paper.
%
% \begin{unfinished}
% \* explain the hairy stuff
% \* give examples
% \end{unfinished}
%
% There are also the abbreviations \notfinished and \notwritten.
% 
% The \begin{unfinished}...\end{unfinished} environment is like an
% itemize environment, but it also types a warning if it occurs
% in a document that's not a draft (as determined heuristically by
% the setting of \overfullrule).
%
% To shut off the \unfinished sections entirely in a pinch, you
% can use the command \killunfinished.  Of course, normally
% you should repair them by finishing them.  There may be
% bugs in the \killunfinished mechanism.

\newcommand{\unfinished}{\ifdim\overfullrule > 0pt\else
   \typeout{WARNING:  Unfinished section not in a draft.}
   \fi\def\*{\item{}}\bgroup\itemize}

\newdef\endunfinished{\egroup\enditemize}

\newcommand{\unfinisheditem}[1]{\begin{unfinished}
\item #1
\end{unfinished}}

\newcommand{\notfinished}{\unfinisheditem{not finished yet}}
\newcommand{\notwritten}{\unfinisheditem{not written yet}}

\makeatletter
\newdef\killunfinished{\def\unfinished{\setbox9\vbox\bgroup\itemize}
\def\endunfinished{\egroup}}
\makeatother

