summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicetext/run/arseneau.tex
blob: c2a59f455527ca8a573889c84ed79635655d5911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
\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}