summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/nicetext/mdoccheat.tex
blob: 4063fc275a103f2c1715c093378785f5a247ec51 (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
\ProvidesFile{mdoccheat.tex}[2011/01/26 cheat sheet for `makedoc.sty']
% \listfiles
\documentclass{article}
\input{makedoc.cfg} %% with pdf stuff and 'niceverb'
\makeatletter
  \def\today{\the\year/\two@digits\month/\two@digits\day}
%   \let\sofar@arraycr\@arraycr
  \newenvironment*{displines}
                  {\def\ccr{\\&}% 
                   \csname eqnarray*\endcsname&}
                  {\csname endeqnarray*\endcsname}
  \def\@listi{\leftmargin\leftmargini
              \parsep 3\p@ \@plus2\p@ \@minus\p@
              \topsep 6\p@ \@plus2\p@ \@minus4\p@
              \itemsep3\p@ \@plus2\p@ \@minus\p@}
  \let\@listI\@listi
\makeatother
\newcommand*{\defto}[2]{$#1\to_{\mathit{default}}#2$}
\usepackage[margin=3cm]{geometry}                     %% 2012/03/18
% \sfcode`/=1001 %% TODO makedoc.cfg!? 2010/03/15
\sloppy
\begin{document}
%  \enlargethispage{1\baselineskip} %% 2010/03/29 %% rm. 2012/03/18
%   \null\kern-1\baselineskip
\begin{center}
 \bfseries \Large
  'makedoc' \& 'fifinddo'\footnote{\url{http://ctan.org/pkg/nicetext}} 
  File Handling Commands
 \\[.4ex] \mdseries \large
  Uwe L\"uck, \today
 \\[10pt] \normalsize
  |\usepackage{makedoc}|, see 'makedoc.pdf' for details
\end{center}
\thispagestyle{empty}
  \par\kern5pt
\noindent \textbf{Most simple:} |\MakeInputJobDoc|
in `<jobname>.tex' \emph{after} &\begin{document}
\begin{displines}
  `\MakeInputJobDoc{<header-lines>}{<main-parser>}'
    \ccr
  `\MakeInputJobDoc[<in-ext>]{<header-lines>}{<main-parser>}'
    \ccr
  `\MakeInputJobDoc[<out-ext>][<in-ext>]{<header-lines>}{<main-parser>}'
\end{displines} 
documents `\mdJobName.<in-ext>' via `\mdJobName.<out-ext>', 
\defto{<in-ext>}{`sty'}, \defto{<out-ext>}{`doc'}, \defto{&\mdJobName}{<jobname>} 
  \par\kern-5pt
\begin{center} %% Parsers:
\begin{tabular}{@{}l@{\hskip4pt }l@{\hskip4pt }l@{}}
<main-parser>\endcell detects\endcell involves\\\hline
`\SectionLevelThreeParseInput'\endcell
    `==== <title> ===='\endcell`\mdSectionLevelThree'\\
`\SectionLevelTwoParseInput'\endcell
    `=== <title> ==='\endcell`\mdSectionLevelTwo'\\
`\SectionLevelOneParseInput'\endcell
    `== <title> =='\endcell`\mdSectionLevelOne'\\
%% 2010/03/29:
`\ProcessInputWith{PPScomment}'\endcell 
    `%% <comment>'\endcell `%%<empty>', 'mdoccorr.cfg'\\
`\ProcessInputWith{PScomment}'\endcell 
    `% <comment>'\endcell `%<empty>', 'mdoccorr.cfg'
\end{tabular}
\end{center}

%   \par\kern-2pt
\noindent \textbf{Preprocessing before} &\begin{document}: 
|\MakeJobDoc| (same parameters)

  \vskip10pt \raggedright
\noindent \textbf{More fine-grained:}\\
\textbf{a.~Choices for next preprocessing run:}
\begin{description}
\cmdboxitem|\ResultFile{<output>}| opens <output>
% \cmdboxitem|\LaTeXresultFile{<output>}| see below
\cmdboxitem|\Headerlines{<header-lines>}| 
    `\MakeJobDoc''s first mandatory argument 
\cmdboxitem|\MainDocParser{<main-parser>}| 
    `\MakeJobDoc''s second mandatory \rlap{argument}
\cmdboxitem|\ProcessLineMessage{<message>}| 
    \defto{<message>}{&\message{.}}
\cmdboxitem|\input{mdoccorr.cfg}| chooses `\MakeDocCorrectHook'
\end{description}
\textbf{b.~Manual insertions to <output>:}
\begin{description}
\cmdboxitem|\WriteResult{<balanced>}| writes <balanced> to <output> 
\cmdboxitem|\WriteProvides| writes `\ProvidesFile' line from 'fifindo'
\cmdboxitem|\LaTeXresultFile{<output>}| issues
    `\ResultFile{<output>}', writes `\ProvidesFile' line from 'makedoc'
\end{description}
\textbf{c.~Processing <input>, closing <output>:}
\begin{description}
\cmdboxitem|\ProcessFileWith{<input>}{<loop-body>}| 
    reads each <input> line to macro |\fdInputLine|, 
    applies <loop-body>
\cmdboxitem|\MakeDoc{<input>}|
    inputs `mdoccorr.cfg'
    copies <header-lines> from <input> to <output>, 
    applies <main-parser>
\cmdboxitem|\CloseResultFile| closes <output>
\cmdboxitem|\MakeCloseDoc{<input>}| issues 
    `\MakeDoc{<input>}\CloseResultFile'
\cmdboxitem|\MakeSingleDoc[<out-ext>]{<in-output>.<in-ext>}| 
    issues `\LaTeXresultFile{<in-output>.<out-ext>}'
    and `\MakeDocCloseDoc{<in-output>.<in-ext>}',
    \defto{<out-ext>}{`doc'},
\end{description}
%% 2012/03/18:
\textbf{d.~Avoid &\input{mdoccorr.cfg} by} 
|\MakeInputJobDoc*|, |\MakeJobDoc*|, |\MakeDoc*|, 
|\MakeCloseDoc*|, or |\MakeSingleDoc*|

\end{document}