summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nicetext/fdtxttex.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/nicetext/fdtxttex.tex')
-rw-r--r--Master/texmf-dist/tex/latex/nicetext/fdtxttex.tex59
1 files changed, 59 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/nicetext/fdtxttex.tex b/Master/texmf-dist/tex/latex/nicetext/fdtxttex.tex
new file mode 100644
index 00000000000..9e5e3dda35a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/nicetext/fdtxttex.tex
@@ -0,0 +1,59 @@
+ \makeatletter
+\typeout{^^J*fdtxttex.tex* 2010/03/22 txt to TeX by dialogue^^J
+ (apply \string\MakeDocCorrectHook)
+ ^^J}
+
+\RequirePackage{fifinddo}
+
+\def\MakeDocCorrectHook#1{#1}
+\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