summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/nicetext/run/fdtxttex.tex
blob: e36edd2bbfd427c914eac9e3733509b489fcee0a (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
                                                   \makeatletter

\typeout{^^J*fdtxttex.tex* 2010/03/30 txt to TeX by dialogue^^J

             (apply \string\MakeDocCorrectHook)

                                                            ^^J}



\RequirePackage{fifinddo}



\catcode`\_=11 

\def\CorrectionFile{\def\mdoc_corr}

\CorrectionFile{mdoccorr.cfg}

\ResultFile{sample.tex}

\def\InputFile{\def\input_file_name}

\InputFile{sample.txt}

\newif\iftoscreen



\def\FD_dialogue{%

  \typeout{^^J%

    ===========================================================^^J%

    \string\CorrectionFile{\mdoc_corr} 

    \space (define \@backslashchar MakeDocCorrectHook)^^J%

    \string\InputFile {\input_file_name}^^J% 

    \string\ResultFile{\result_file_name} 

    \space\space\space\space\space\space\space

    \string\toscreen\iftoscreen true\else false\fi             ^^J%

    ===========================================================%

  }%

  \typein[\action]%

         {Run with these settings? (Y)es? (C)hange? (Otherwise quit.)}% 

  \csname action_\action \endcsname 

}

\def\run_with_settings{%

  \input{\mdoc_corr}%

  \WriteProvides

  \ProcessFileWith{\input_file_name}{%

    \WriteResult{\expandafter \MakeDocCorrectHook 

                 \expandafter{\fdInputLine}}%

    \iftoscreen

      \typeout{\expandafter \MakeDocCorrectHook 

                 \expandafter{\fdInputLine}}%

    \else

      \message{.}%

    \fi}

  \CloseResultFile

  \typeout{Done.}%

  \FD_dialogue

} 

\expandafter\let\csname action_y\endcsname \run_with_settings

\expandafter\let\csname action_Y\endcsname \run_with_settings



\def\change_settings{%

    \typein[\change]{^^JType setting command(s).}%

    \change \FD_dialogue}

\expandafter\let\csname action_c\endcsname \change_settings

\expandafter\let\csname action_C\endcsname \change_settings



\FD_dialogue



\stop