\ProvidesFile{arseneau.tex}
             [2012/03/18 some packages by D. Arseneau (ul)]
\title{A Few Packages by Donald Arseneau}
\author{Uwe L\"uck\thanks{applying \url{http://ctan.org/pkg/nicetext}}}
% \listfiles

%% Preprocessing:
\RequirePackage{makedoc}
% \CopyFDconditionFromTo{PScomment}{comment}
\ProcessLineMessage{}
\MainDocParser{\ProcessInputWith{PScomment}}
%% nolbreaks:
%% Replacements:
\SetPatternCodes{\MakeOther\\\MakeOther\ }
\MakeExpandableAllReplacer{LaTeX}{LaTeX }{\LaTeX{} }{LEAVE}
% \MakeExpandableAllReplacer{TeX}{\TeX }{\TeX{} }{LEAVE}
\PrependExpandableAllReplacer{opt}{[ragged]}{`[ragged]'}
\PrependExpandableAllReplacer{braces}[\Delimiters<>]<{ }><`{ }'>
\SetCorrectHookJobLast

\HeaderLines{2}
\LaTeXresultFile{nolbreaks.doc}
\MakeCloseDoc*{nolbreaks.sty}

%% notoccite:
\MakeExpandableAllReplacer{LaTeX}{LaTeX }{\LaTeX{} }{LEAVE}
\PrependExpandableAllReplacer{caption}%
{  \caption [}{\DISPLAY\caption[}
\PrependExpandableAllReplacer{unsrt}{unsrt}{`unsrt'}
\PrependExpandableAllReplacer{toc}{ toc}{ `.toc'}
\PrependExpandableAllReplacer{lof}{lof}{`.lof'}
\PrependExpandableAllReplacer{latex}{latex}{`latex'}
\PrependExpandableAllReplacer{NOTE}{*NOTE*}{\textbf{NOTE:\enspace}}
\PrependExpandableAllReplacer{does}{*does*}{\emph{does}}
\PrependExpandableAllReplacer{bibtex}{bibtex}{`bibtex'}
\ResetPatternCodes
\SetCorrectHookJobLast

\HeaderLines{3}
\LaTeXresultFile{notoccite.doc}
\MakeCloseDoc*{notoccite.sty}

\ProcessLineMessage{\message{.}}
%% optional:
% \SetPatternCodes{\MakeOther\\\MakeOther\ }
\SetPatternCodes{\MakeOther\\}
\MakeExpandableAllReplacer{LaTeX:}{LaTeX:}{\LaTeX:}{LEAVE}
\PrependExpandableAllReplacer{LaTeX}[\MakeOther\ ]%
{LaTeX }{\LaTeX{} }
\PrependExpandableAllReplacer{pkg}{optional.sty}{'optional.sty'}
\PrependExpandableAllReplacer{IS}{*IS*}{\emph{is}}
\PrependExpandableAllReplacer{tildes}[\MakeOther\ ]%
{HOW TO USE}{\SECT{How to Use}}
% \SetPatternCodes{\MakeOther\~}
% \PrependExpandableAllReplacer{tildes}[\MakeOther\~]{U}{X}
  %% <- TODO \MakeOther\~ hangs up
\SetCorrectHookJobLast

\HeaderLines{14}
\LaTeXresultFile{optional.doc}
\MakeCloseDoc*{optional.sty}


%% Typesetting:
\documentclass{article}
\usepackage{hyperref,niceverb,wiki} %% niceverb after hyperref!
\AddToNoVerbList{\DISPLAY\textbf\enspace\emph\LaTeX\SECT}
\newcommand*{\DISPLAY}{%
    \\[\smallskipamount]\leavevmode\null\hfil}
\makeatletter
 \newcommand*{\SECT}[1]{%
   \par\medskip\textbf{#1}\par\smallskip\@afterheading}
\makeatother
\makeatletter \MakeLetter\_
% {\MakeActive\"\gdef\DQcode#1"{\dqtd{\texttt{#1}}}}
% {\MakeActive\"\gdef\DQcode#1"{\texttt{#1}}}
{\MakeActive\"
 \gdef\DQtt{\begingroup 
   \let\do\MakeOther \dospecials \tt \let"\endgroup}
 \gdef\fineDQ{``\begingroup
   \let\do\MakeOther \dospecials \tt \def"{\endgroup''}}}
%% weird problems:
% \newcommand*{\startDQcode}
%             {``\begingroup\MakeActiveLetHere\"\enddQcode\tt}
% \def\endDQcode{\endgroup"}
\pagestyle{headings}
\usepackage{parskip}
\begin{document}
\maketitle

\begin{abstract}\noindent
  This document demonstrates the present 
  (i.e., 'nicetext' bundle release v0.4)
  capabilities of 'makedoc' and 'niceverb' 
  to typeset \LaTeX\ quality documentation from 
  third-party package files having ASCII comments only, 
  without modifying such package files manually.\footnote{See 
                         \url{http://ctan.org/pkg/nicetext} 
                         for more on these packages.}
  Such packages usually mark comments by lines starting with 
  \lq`% '\rq. This is somewhat difficult when the ``comment mark" 
  \lq`%'\rq\
  may at the same time be used for ``commenting out" in place of 
  ``true commenting." As opposed to 'substr.sty' that conforms to the 
  easier \lq`%% '\rq\ style, the packages 'nolbreaks' and 'notoccite' 
  by Donald Arseneau exemplify the \lq`% '\rq\ commenting style. 

  The ASCII documentation of packages of this kind
  does not always clearly indicate when switching to `\tt' is appropriate. 
  This problem is solved here by string replacements very specific 
  to the package files. 
  The setup for these replacements 
  (in the source file 'arseneau.tex') 
  still may be simplified. 
  %% <- 2010/03/29

  Moreover, some similar packages cannot be properly typeset with 
  'nicetext' at present because 'makedoc''s loop is too rigid to deal with 
  (i)~ASCII indents, displays, lists and with (ii)~instructions 
  after `\endinput'. (On 2010/04/05, we try addressing (i) with 
  'wiki.sty', applied to Donald Arseneau's 'optional'. 
  A 'nicetext' bug with replacing tildes shows up.)

  It should be clear that all the package desriptions are Donald Arseneau's, 
  'nicetext' just formats them.
\end{abstract}
\tableofcontents
\pagebreak

\sloppy 
\MakeNormal\|

\section{'nolbreaks'}
% \MakeActiveLet\_\textunderscore
% \MakeActive\*\def*{\texttt{\string*}}
% \MakeActiveLetHere\"\startDQcode
\MakeActiveLetHere\"\DQtt
%  \errorcontextlines=6
\AutoCmdInput{nolbreaks.doc}

\section{'notoccite'}
\ResetCodeLineNumbers
\AutoCmdInput{notoccite.doc}

\section{'optional'} %% 2010/04/02
\ResetCodeLineNumbers
\wikiEnvironments
\MakeActiveLet\"\DQtt
% \AddToNoVerbList{\tracingmacros}
\let~\relax %% TODO replacement bug 2010/04/05
\AutoCmdInput{optional.doc}

\end{document}