summaryrefslogtreecommitdiff
path: root/support/mnu
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/mnu
Initial commit
Diffstat (limited to 'support/mnu')
-rw-r--r--support/mnu/!README.TXT63
-rw-r--r--support/mnu/cfg.mnu798
-rw-r--r--support/mnu/demo.bat51
-rw-r--r--support/mnu/demo.mnu56
-rw-r--r--support/mnu/demotex.bat12
-rw-r--r--support/mnu/dupcent.c41
-rw-r--r--support/mnu/examples.doc326
-rw-r--r--support/mnu/kalk.hlp127
-rw-r--r--support/mnu/metafont.bat42
-rw-r--r--support/mnu/mfbat.bat1
-rw-r--r--support/mnu/mnu.doc842
-rw-r--r--support/mnu/mnu.tex1405
-rw-r--r--support/mnu/others.bat54
-rw-r--r--support/mnu/prints.bat43
-rw-r--r--support/mnu/readme.txt111
-rw-r--r--support/mnu/sorry.mnu124
-rw-r--r--support/mnu/texbat.bat165
-rw-r--r--support/mnu/texrun.bat24
-rw-r--r--support/mnu/texset.bat72
-rw-r--r--support/mnu/totext.c62
20 files changed, 4419 insertions, 0 deletions
diff --git a/support/mnu/!README.TXT b/support/mnu/!README.TXT
new file mode 100644
index 0000000000..4821d0ebd3
--- /dev/null
+++ b/support/mnu/!README.TXT
@@ -0,0 +1,63 @@
+==========================================================================
+The Program MNU: The Configurable Menu for the Control of DOS Applications
+==========================================================================
+September 10, 1992 Petr Olsak
+
+
+The program MNU with a cooperation with a control-batch (.bat) runs
+repeatedly the application programs. It was developed for the emTeX
+program package managing but it can be used for other purposes.
+
+The batch "demotex.bat" starts the exhibition of possibilities of the
+program MNU with the configuration file developed for the TeX system.
+
+The full documentation is for users with ambitions to change the existing
+MNU program configurations or to develop new ones. In this case the advanced
+skills in DOS bath programming is assumed.
+
+The control-batch starts the program MNU with one parameter--the name of
+configuration file. The program MNU enables the user to choose comfortably
+the demanded item. The structure of the items in a menu, including colors of
+windows, texts of items, text of helps and so on, is described in the
+configuration file. The program returns the error code depending on
+the chosen item to DOS and terminates. The control-bath evaluates the error
+code by a set of commands "if errorlevel" and starts the relevant
+application process. After application process terminating the
+control-batch usually again starts the program MNU and user usually again
+chooses comfortably a next item and so on\dots
+
+The control-batch can communicate with the program MNU not only by the
+error codes but also by DOS environment variables and input/output files.
+The program can present and edit the values of these environment variables.
+In addition there is a special environment variable named "MNU"--when
+the program MNU starts the item specificated in "MNU" variable is offered.
+The control-batch can set the "MNU" value so that the sequence of
+application processes can be rationally related and user can just press the
+"Enter" key.
+
+The list of files contained in the program MNU package follows.
+
+!README.TXT ......... the first information about the program
+MNU.DOC ............. the documentation
+MNUTRICK.DOC ........ the description of some tricks used in presented batches
+MNU.TEX ............. the contents of the previous three files in Plain TeX
+DEMOTEX.BAT ......... the demo-batch
+MNU.EXE ............. the program MNU self
+TEXCFG.MNU .......... the suggested configuration file for TeX system
+TOTEXT.EXE .......... returns the screen to the text mode 80x25
+*.BAT ............... suggested batches for emTeX
+KALK.EXE, KALK.HLP .. the calculator--the exhibition of the application program
+
+The software listed above is ``public domain'' and it is not allowed to use
+these programs and/or modifications of these files for commercial purposes.
+
+The author will not improve or radically change this software but all
+mentions leading to error elimination will be welcome.
+
+Address: Petr OLSAK (Ol\v s\'ak)
+ katedra matematiky FEL CVUT
+ 160 00 PRAGUE
+ --------------
+ CZECHOSLOVAKIA
+email: <olsak@csearn.bitnet>
+ \ No newline at end of file
diff --git a/support/mnu/cfg.mnu b/support/mnu/cfg.mnu
new file mode 100644
index 0000000000..7c1fba6761
--- /dev/null
+++ b/support/mnu/cfg.mnu
@@ -0,0 +1,798 @@
+ *********** Config. file for MNU.EXE - CSTeX system ************
+ ****************************************************************
+ 8.8.92 Petr Olsak
+~hotkeys F2{*163}, F3{$27}, F4{"kalk">0}, F5{*125}, F6{$26}, F9{*, "pause > nul">0}
+~beep {400, 100}
+~param {*, *, *, *, 1, 112, 112, 116, 14, 15} ; Basic colors
+~start {!>2} ; reset file %2 (envir.bat) , "%" duplicate
+~final {"set MNU=#">2} ; remember the last item
+
+^100 \
+~param {9, 1, 62, 5, 1, 23, 30} "<TeX-menu-system>"
+ Main file : |![%MAIN%8]|{} Work file : |![%WORK%8]|{}
+ Format : |![%FMT%8]|{} TeX-version : |![%TEXVER%]|{}
+ F1:help F2:envir F3:edit F4:calc F5:DOS F6:shell F9:hide
+
+^2, 3, 4, 5, 6 [100] ; ********* Main menu ***********
+~param {9, 6, 62, 1, 0}
+ |F^ile|{21} |T^eX|{31} |P^rint|{41} |M^ETAFONT|{51} |O^ptions|{61}
+
+^21, 23, 24, 25, 26, 27, 28, 29 [2] <61, 31> ; ****** File menu *******
+~param {10, 7, 15, 12}
+| N^ame ... |{121}
+| Di^skette ...|{123}
+| Cl^ear (dvi) |
+----------------
+| D^OS ... |{125}
+| S^hell |
+| E^ditor |
+| C^alculation |{"kalk">0, 28}
+----------------
+| Q^uit |
+
+^31, 32, 33, 34, 34, 35, 36, 37, 38, 39, 30 [3] <21, 41>; ******* TeX menu ********
+~param {19, 7, 15, 15}
+| E^dit |
+| [%FFMT%] |
+| V^iew |
+----------------
+| M^ain edit |{"set MARK=[%MAIN%].tex">2}
+| L^og edit |{"set MARK=[%MAIN%].log">2}
+----------------
+| S^pell... |{235}
+| Ti^e (vlnka) |
+| O^thers... |{131}
+| U^serCommand |
+| Ex^periment..|{231}
+| C^StoCS... |{141}
+
+^41, 42, 42, 41, 42, 42, 41, 43, 43, 45, 46 [4] <31, 51> ; ******** Print menu ********
+~param {28, 7, 19, 16}
+| P^review [%DPI24%]dpi |{"set DPI=[%DPI24%]">2}
+| Print - M^atrix |{"set DPI=[%DPI24%]">2, "set MARK=[%OUT24%]">2}
+| Make .lq^ file |{"set DPI=[%DPI24%]">2, "set MARK=[%MAIN%].lq">2}
+--------------------
+| Preview 2^40dpi |{"set DPI=240">2}
+| Print 9^ Matrix |{"set DPI=240">2, "set MARK=[%OUT9%]">2}
+| Make .fx^ file |{"set DPI=240">2, "set MARK=[%MAIN%].fx">2}
+--------------------
+| Preview 3^00dpi |{"set DPI=300">2}
+| Print - L^aser |{"set MARK=[%OUTHP%]">2}
+| Make .h^p file |{"set MARK=[%MAIN%].hp">2}
+--------------------
+| Edit - o^ptions |
+| C^lear - options |
+
+^51, 52, 53, 54, 56, 57, 58 [5] <41, 61> ; ******* Metafont menu *******
+~param {42, 7, 15, 10}
+| P^arameters..|{150}
+| E^dit (mf) |
+| M^etafont |
+| C^onvertor |
+----------------
+| Ed^it (mp) |
+| T^eX (mp) |
+| V^iew (mp) |
+
+^61, 62, 63, 64, 65, 66 [6] <51, 21> ; ******* Options menu ********
+~param {57, 7, 13, 8}
+| F^ormat... |{161}
+| T^eX-vers..|{162}
+| E^nvir... |{163}
+| P^orts... |{164}
+| S^ave... |{165}
+| L^oad... |{166}
+
+^235, 235, 235 [35] ; ******** Dictionaries ********
+~param {31, 13, 11, 5}
+| E^nglish |{"set MARK=ang">2}
+| C^zech |{"set MARK=ces">2}
+| S^lovak |{"set MARK=slv">2}
+
+^131 132 133 134 135 136 137 [37] ; ******** Others ********
+~param {31, 16, 14, 8}
+| DVI-O^ut |
+| DVIP^S |
+| MakeI^ndex |
+| B^ibTeX |
+| T^eXCad |
+| G^S-View |
+
+^231, 232, 233 [39] ; ******* Experiment menu ******
+~param {31, 17, 14, 5}
+| E^dit (try) |
+| T^eX (try) |
+| V^iew (try) |
+
+^141 142 143 144 145 146 [30] ; ******** CStoCS menu ********
+~param {31, 15, 24, 10}
+| Kamenic. -> TeX sec. |
+| TeX sec. -> Kamenic. |
+------------------------
+| PC Latin -> TeX sec. |
+| TeX sec. -> PC Latin |
+------------------------
+| Kamenic. -> PC latin |
+| PC Latin -> Kamenic. |
+
+^161 [61] ; ******* Formats menu ********
+~param {66, 8, 12, 8}
+| P^lainTeX |{"set FMT=csPLAIN">2, "set FFMT=PlainT^eX">2, "csPLAIN">FMT, "PlainT^eX">FFMT, *61}
+| L^aTeX |{"set FMT=csLATEX">2, "set FFMT=LaT^eX">2, "csLATEX">FMT, "LaT^eX">FFMT, *61}
+| A^MSTeX |{"set FMT=csAMSTEX">2,"set FFMT=AMST^eX">2, "csAMSTEX">FMT,"AMST^eX">FFMT, *61}
+| AMS^LaTeX |{"set FMT=csAMSLAT">2,"set FFMT=AMSLaT^eX">2, "csAMSLAT">FMT,"AMSLaT^eX">FFMT, *61}
+| LAM^STeX |{"set FMT=csLAMST">2, "set FFMT=LAMST^eX">2, "csLAMST">FMT, "LAMST^eX">FFMT, *61}
+| SLi^TeX |{"set FMT=csSLITEX">2,"set FFMT=SLiT^eX">2, "csSLITEX">FMT,"SLiT^eX">FFMT, *61}
+
+^162 [62] ; ******** TeX - version *********
+~param {66, 9, 11, 4}
+| T^eX |{"set TEXVER=tex">2, "tex">TEXVER, *62}
+| TeX-3^86 |{"set TEXVER=tex386">2, "tex386">TEXVER, *62}
+
+^163 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 [63] ; Environment
+~param {2, 7, 60, 18, 1, 31, 30, 30, 14, 14}
+ F3FILE: |#[%F3FILE%48]|{"set F3FILE=#">%2, "#">F3FILE, 500}
+ EDIT: |#[%EDIT%48]|{"set EDIT=#">%2, "#">EDIT, 501}
+ EMTEXED: |#[%EMTEXED%48]|{"set EMTEXED=#">%2, "#">EMTEXED, 502}
+ SHELL: |#[%SHELL%48]|{"set SHELL=#">%2, "#">SHELL, 503}
+ EMTEXOPT:|#[%EMTEXOPT%48]|{"set EMTEXOPT=#">%2, "#">EMTEXOPT,504}
+ SCROPT: |#[%SCROPT%48]|{"set SCROPT=#">%2, "#">SCROPT, 505}
+ SPELLOPT:|#[%SPELLOPT%48]|{"set SPELLOPT=#">%2, "#">SPELLOPT,506}
+ ERRCOM: |#[%ERRCOM%48]|{"set ERRCOM=#">%2, "#">ERRCOM, 507}
+ USERCOM: |#[%USERCOM%48]|{"set USERCOM=#">%2, "#">USERCOM, 508}
+ LASTCOM: |#[%LASTCOM%48]|{"set LASTCOM=#">%2, "#">LASTCOM, 509}
+ FMT: |#[%FMT%48]|{"set FMT=#">%2, "#">FMT, *510}
+ TEXFMT: |#[%TEXFMT%48]|{"set TEXFMT=#">%2, "#">TEXFMT, 511}
+ BTEXFMT: |#[%BTEXFMT%48]|{"set BTEXFMT=#">%2, "#">BTEXFMT, 512}
+ TEXTFM: |#[%TEXTFM%48]|{"set TEXTFM=#">%2, "#">TEXTFM, 513}
+ TEXINPUT:|#[%TEXINPUT%48]|{"set TEXINPUT=#">%2, "#">TEXINPUT,514}
+ MFINPUT: |#[%MFINPUT%48]|{"set MFINPUT=#">%2, "#">MFINPUT, \63}
+
+^164 521 522 523 [64] ; Ports environment
+~param {16, 12, 63, 6, 1, 31, 30, 30, 14, 14}
+ OUT24 (matrix-24): |#[%OUT24%40]|{"set OUT24=#">%2, "#">OUT24, 521}
+ OUT9 (matrix-9) : |#[%OUT9%40]|{"set OUT9=#">%2, "#">OUT9, 522}
+ OUTHP (laser) : |#[%OUTHP%40]|{"set OUTHP=#">%2, "#">OUTHP, 523}
+ Font-resolution of dot-24 printer. DPI24: |#[%DPI24%]|{"set DPI24=#">2, "#">DPI24, \64}
+
+^165 168 [65]; Save information
+~param {25, 13, 50, 6, 1, 31, 30, 30, 14, 15}
+ The environment state will be saved
+ to file |#TEXCFG |{"set MARK=#">2, 168}.BAT
+ Old contents of this file will be removed!
+ | OK^ | | C^ancel |{\65}
+
+^166 169 [66]; Load information
+~param {25, 14, 50, 6, 1, 31, 30, 30, 14, 15}
+ The environment state will be loaded
+ from file |#TEXCFG |{"set MARK=#">2, 169}.BAT
+ Confirm:
+ | OK^ | | C^ancel |{\66}
+
+^123 [23] ; ******* Diskette menu *******
+~param {22, 9, 29, 7}
+ COPY work and main file:
+ | disk -> A: ... |{"set AR=from">2, "set D=A">2, "A">D, 124}
+ | disk -> B: ... |{"set AR=from">2, "set D=B">2, "B">D, 124}
+ | A: -> disk ... |{"set AR=to">2, "set D=A">2, "A">D, 124}
+ | B: -> disk ... |{"set AR=to">2, "set D=B">2, "B">D, 124}
+
+^124
+~param {23, 17, 33, 5, 1, 31, 30, 28, 14, 15}
+ Insert diskette to drive [%D%]:
+ and confirm OK :
+ | O^K | | C^ancel |{\\23}
+
+^0 ; ********* final question *******
+~param {32, 21, 17, 4, 1, 31, 30, 28, 14, 12}
+ Exit to DOS ?
+ | Y^es | | N^o |{\3}
+
+ *********************** changes of system parameters ************************
+
+^121, 122 [21] ; File names
+~param {15, 10, 48, 6, 1, 31, 30, 30, 14, 14}
+ Write new file names without extension:
+
+ Main file name: |#[%MAIN%8]|{"set MAIN=#">2, "#">MAIN, "set WORK=#">2, "#">WORK, *122}
+ Work file name: |#[%WORK%8]|{"set WORK=#">2, "#">WORK, *31}
+
+^125 [25] ; DOS command line
+~param {3, 15, 74, 4, 1, 31, 14, 14, 14, 14}
+ Write DOS command :
+ |#[%3% 1, 1, 70]|{!>3, "#">3}
+
+^150, 151, 152 [51] ; METAFONT parameters
+~param {1, 12, 80, 7, 1, 31, 30, 30, 14, 14}
+ Write %MF% file name, parameters for METAFONT and convertor:
+
+ %MF% file (without extension): |#[%MF%8]|{"set MF=#">2, "#">MF 151}
+ METAFONT |#[%4% 31, 1, 66]|{!>4, "[%4% 1, 1, 30]#">4}
+ Convertor |#[%GFOPT%66]|{"set GFOPT=#">%2, "#">GFOPT \51}
+
+ ********************************* HELPS ************************************
+
+~param {3, 2, 76, 23, 1, 48, 62} " Help " ; Basic parameters for help windows
+
+^(2, 3, 4, 5, 6)
+
+ This is the context help for the system TeX
+ ===========================================
+ 9.8.92 Petr Olsak
+
+ Each item in the main menu (File, TeX, Print, METAFONT, Options)
+ contains another sub-menu. If you choose some of these lower offers
+ (by the key "Enter" and arrows) and then press F1 key, the help for the
+ corresponding item will be shown.
+
+
+^1500
+~param {5, 23, 70, 1, 0, 48}
+ <||{\\1163} Enter: list of envir. variables, Esc: end of help. >
+
+^(63 163 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514) 1163
+ Environment variables
+ You can change the implicit configuration by changes the values
+ of special environment variables listed below.
+ | F3FILE |{\1599}.... The file name for F3 editing
+ | EDIT |{\1501}.... The editor call
+ | EMTEXED |{\1502}.... The editor call after the "e" key in TeX
+ | SHELL |{\1503}.... The shell call (file manager, F6 key)
+ | EMTEXOPT |{\1504}.... TeX parameters
+ | SCROPT |{\1505}.... View parameters
+ | SPELLOPT |{\1506}.... SPELL checker parameters
+ | ERRCOM |{\1507}.... The command after error in TeX run
+ | USERCOM |{\1508}.... The command executed by UserCommand item
+ | LASTCOM |{\1509}.... The last command when TeX system terminates
+ | FMT |{\1510}.... The name of .FMT file
+ | TEXFMT |{\1511}.... Path with .FMT files (TeX)
+ | BTEXFMT |{\1512}.... Path with .FMT files (BigTeX)
+ | TEXTFM |{\1513}.... Path with .TFM files
+ | TEXINPUT |{\1514}.... Path with source files for TeX (.STY, .TEX)
+ | MFINPUT |{\1515}.... Path with source files for METAFONT
+ You can save all environment state into file by item
+ | Save |{\1065} and restore this state from file by | Load |{\1066} item.
+
+^(21, 121, 122) 1021
+ Name
+ ====
+ Opens a window where you can change the name of the main and of
+ the working files.
+
+ Without terminating and restarting the TeX system you can
+ immediately continue in work on a new document.
+ Names of files are to be given without any extension.
+
+ MAIN FILE: The file which will be the input for running the TeX program.
+ This file is usually identical with the working file. This file has
+ automatically the extension .TEX .
+
+ WORKING FILE: The file to which the editor is directed. It is useful
+ to distinguish these files, if the working file is called in the
+ main file by the command \input (or similar). Your work is directed
+ to corrections resp. expansion of the working file.
+ For example the main file has the name MYBOOK and contains the
+ command \imput chapter5, and you are working with the file CHAPTER5 .
+
+^(23, 123, 124)
+ Diskette:
+ =========
+ Enables to copy files from the disk to a diskette and vice versa. The
+ notion "Disk" is not entirely appropriate; more exactly it is the
+ current directory (i.e. normally the disk). If the current directory is
+ at a diskette, a collision can appear.
+
+ The configuration of this system consistently keeps the philosophy of
+ the user's directory used as current one. All by-products of the work
+ on a document (e.g. files with extensions .dvi, .log, .aux and so on)
+ are saved in the user's directory. If the user wishes to clean his
+ directory, he can use either the item "Clear" or "Shell".
+
+ The item "Diskette" copies only files with the extension .TEX
+ (the | main |{\1021} and the | working |{\1021} files.)
+ If you have open other source files (e.g. .mf), you have to copy them
+ using the item "Shell".
+
+^(24)
+ Clear (dvi):
+ ============
+ Deletes all "useless" files from the users current directory. More
+ exactly, it deletes all files with the name identical to the name of
+ the main or the working file which have one of the following
+ extensions:
+ .bak, .dvi, .log, .aux, .lq, .hp, .fx .
+
+ If you use other temporary files (.toc, .inx, and so on) you have to
+ delete them yourself.
+
+^(25, 125, 26)
+ DOS:
+ ====
+ It is possible to execute one DOS command without leaving the TeX
+ system.
+
+ Shell:
+ ======
+ An external program is executed enabling comfortable operations over
+ files: listing and changing of directories, copying, deleting and many
+ more file operations. Control of this program is generally familiar (it
+ is e.g. Norton Commander or PCTools - in accordance to what is used at
+ your computer). After leaving this program the process returns into the
+ TeX system.
+ The program itself is specified by | environment variable |{\1163} SHELL.
+
+^(27, 28, 29)
+ Editor
+ ======
+ The editor is started without specification the edited file. The editor
+ asks for the name of the file that you wish to edit.
+ The editor itself is specified by | environment variable |{\1163} EDIT.
+
+ Calculation:
+ ============
+ A simple external program "calculator" is started. You can simply write
+ the expression (for example 1+1) followed by the "Enter" key. The
+ program replies, for example: 1+1=2.
+
+
+ Quit:
+ =====
+ Terminating of the TeX system. The system can be left also by multiple
+ pressing the "Esc" key (depending on the depth of menu expansion). In
+ that case the system asks, whether you really wish to leave it.
+ In both cases, the command specified in | environment variable |{\1163} LASTCOM
+ is executed.
+
+^(31) 1031
+ Edit:
+ =====
+ Editation of the | working file |{\1021} is started.
+
+ The way of control of the editor depends on which editor is used.
+ The editor itself is specified by | environment variable |{\1163} EDIT.
+
+^(32) 1032
+ TeX:
+ ====
+ The proper running of the TeX program.
+
+ The chosen format (Plain, LaTeX etc.) is used. You can choose the format
+ by the item "Options -> Format" before starting of the TeX program.
+
+ The TeX program is started. The input is the main file. The result is
+ the .dvi file, i.e the input for View or prints. In the .log file you
+ can find the report of the work of the TeX program. Related to the used
+ format, styles or macros, other output files can be generated. All
+ files are placed into the user's current directory.
+
+^(33)
+ View:
+ =====
+ Viewer. It enables to examine the .dvi file (result of the TeX program)
+ on the screen. The control depends on the particular program.
+
+ Basic control keys for emTeX's DVISCR:
+ ======================================
+ Q or ^C ...... quit program
+ arrows ........ move text on the screen
+ F resp. C .... smaller resp. larger step for arrows
+ PgDn / PgUp .. next / previous page
+ P number ..... go to specified page
+ O ............ return to the last viewed page
+ + resp. - .... larger, resp. smaller text
+ R ............ switch on/off ruler
+ ^U or U ...... switch between units on the ruler
+ S text ....... search text
+
+
+^(34)
+ Main edit
+ =========
+ Editation of the | main file |{\1021} is started.
+
+ Log edit
+ ========
+ Editation of the .LOG file is started.
+
+ The way of control of the editor depends on which editor is used.
+ The editor itself is specified by | environment variable |{\1163} EDIT.
+
+
+^(35 235)
+ Spell:
+ ======
+ Correction of typing errors in the working file. The English or the
+ Czech or Slovak dictionary is used in accordance with the sub-menu
+ selection.
+
+ The spell checker works with | working file |{\1021} only.
+
+ The additional parameters can be used in the | environment variable |{\1163}
+ SPELLOPT.
+
+^(36)
+ Tie (vlnka):
+ ============
+ The program is executed, which includes after every non syllabic
+ preposition a tie, preventing the line break at that place.
+
+ It is a purely Czech and Slovak speciality. English documents are not
+ to be submitted to it.
+
+ The program includes ties only into the | working file |{\1021}.
+
+^(37)
+ Others:
+ =======
+ Next menu appears with following items:
+
+ DVI-Out : Converts CS-format in .DVI to standard CM format
+ DVIPS : Converts .DVI to PostScript
+ CSIndex : Generates Czech/Slovak indexes
+ Bib-TeX : Bibliography database
+ TeXCad : Easily drawing LaTeX pictures by mouse or arrows
+
+^(38)
+ UserCommand:
+ ============
+ The command specified in | environment variable |{\1163} USERCOM is executed.
+
+ User can set this command to his own particular needs.
+ For example the call of DVIPASTE program.
+
+ This command is simply accessible by pressing "U" key in TeX menu.
+ If you specify a batch call, you must write the word "call" before
+ the batch name!
+
+ In the user batch, you can operate with environment variables:
+ %MAIN% ... | main file |{\1021}
+ %WORK% ... | working file |{\1021} (both without extension).
+
+
+^(39, 231, 232, 233) 1039
+ Experiment:
+ ===========
+ Imagine that you are preparing an extensive document and you want
+ to debug a new table or other complicated TeX text. The permanent
+ "loop" [Running TeX -> Errors resp. View -> Editation] seems
+ to be tedious with the entire document. It is senseless to introduce a
+ new file (e.g. the name is the same and the extension is .try) and
+ to try this experimental text here. When you like the result, you
+ include it into the current document using block operations of the
+ editor.
+
+ Exactly this is possible due to the item Experiment.
+ The following menu appears:
+ Edit (try) .... editation of the file "name".try
+ TeX (try) .... running TeX to the file "name".try
+ View (try) .... viewer to the "name".dvi file
+
+ "name" means the name of the | main file |{\1021}. The final including of the
+ file "name".try into the document has to be done using block
+ operations of the editor manually.
+
+ This way you can save time of long TeX operations with the whole
+ document during marginal experiments.
+
+^(30 141)
+ CStoCS
+ ======
+ The program CStoCS converts | working file |{\1021} between various coding
+ schemes of nonstandard ASCII characters and standard TeX sequences
+ for these characters. It works with coding schemes:
+
+ Kamenicky, PC Latin 2, TeX-seq., ISO Latin 2, page 852, koi 8.
+
+ The menu offers only some conversion. If you need other one, you can
+ call the program from DOS line with appropriate parameters
+ (see to documentation of program CStoCS).
+
+^(41)
+ Preview 180dpi, resp. Preview 300dpi, resp. Preview 240dpi
+ ==========================================================
+ The viewer, which respects (in contrast to the plain | View |{\1032}) all
+ supplementary | options |{\1045}, which the user has prepared for the print
+ driver. This brings the result of the screen much nearer to the result
+ of printing. Some new problems may appear in this step, that would
+ cause wasting of paper in printer otherwise.
+
+ Menu offers three Preview items, each of them call viewer
+ which operates with specified fonts (dpi).
+
+^(42, 43) 1042
+ Print - Matrix, resp. Print - Laser, resp. Print 9 Matrix:
+ ===========================================================
+ The printing by the matrix resp. laser printer. If you have not
+ set any options, the print driver asks for options "on line".
+ Entering a blank line sets the printer in operation. In case of given
+ options (using the item | Edit options |{\1045}) printing starts immediately.
+
+ More exactly: the printing starts immediately if there is the file
+ "name".opt in the user's current directory. The print driver reads
+ options from this file. This file can be edited by the item
+ | Edit options |{\1045}. On the other hand, the item "Clear options" deletes
+ this file causing that the print driver will require options before
+ printing.
+
+ Make .lq file, resp. Make .hp file, resp. Make .fx file:
+ ========================================================
+ Creates the file "name".lq/.fx resp. "mane".hp for a future use by a
+ matrix resp. laser printer. These files are usually quite extensive
+ and they are senseful only for transfer to computers with the printer
+ but without TeX installation.
+
+^(45, 46) 1045
+ Edit - options resp. Clear options:
+ =====================================
+ Editing resp. deleting of print options - see | Print help |{\1042}.
+ The list of possible options and the way of their activating depends on
+ drivers involved.
+
+^(52, 53, 54)
+ Edit (MF):
+ ==========
+ Editing is started for the "name".mf file ("name" is the name of the
+ MF file, see the | Parameters |{\1051} item).
+
+ METAFONT:
+ =========
+ Running the METAFONT program depending on the command line
+ specified in | Parameters |{\1051} item.
+
+ Convert:
+ =======
+ Running the transfer program (for instance to .pk-format) of fonts
+ specified in | Parameters |{\1051} item.
+
+
+^(51 150 151 152) 1051
+ Parameters:
+ ===========
+ A window appears where you can edit the line with the METAFONT
+ command, convertor command and MF file.
+ 1. MF file (without extension) is name of file to be edited
+ by "Edit-mf" item. It is the value of MF environment variable.
+ 2. METAFONT parameters. Most frequent parameters are as follows:
+ &plain ......... calls the METAFONT format defined in METAFONTbook
+ &cm ............ format for Computer Modern fonts
+ \mode=proof .... making the font for a test
+ \mode=lqlores .. low resolution font for matrix printer (180dpi)
+ \mode=hplaser .. high resolution font for laser printer (300dpi)
+ mag=<n> ........ the result will be <n> times enlarged
+ input <name> ... the input file will be <name>.mf
+ 3. In the last line of the window, the name of convertor program and
+ the name of the input file and others parameters can be given. In
+ case of mag=1 and \mode=lqlores, the input file has the extension
+ ".180", and in case of \mode=hplaser, the extension is ".300" .
+ In case you use nonstandard magnifications or nonstandard printers,
+ you have to find out the extension of the input file at first.
+
+^(56, 57, 58)
+ Edit (mp):
+ ===========
+ Starts the editor for the file "name".mp (abbr. METAFONT--picture). In
+ this file, the user includes the font just METAFONTed into TeX. E.g. if
+ he prepares figures, he can try to include all labels and create a
+ complete figure here. When he is satisfied with the result (checking
+ through "View-mp"), he include the figure into the current document
+ using block operations of the editor.
+
+ TeX (mp):
+ ==========
+ Starts the TeX program with the corresponding format. The input is the
+ file "name".mft
+
+ View (mp):
+ ===========
+ Viewer of TeX output (.dvi file)
+
+^(61, 161) 1061
+
+ Format:
+ =======
+ You can choose some format from menu. The selection influences
+ the appearance of TeX item and the TeX run.
+
+ If some format is not installed at this computer, the system reports
+ a message after you want to run the TeX program.
+
+^(62 162) 1062
+
+ TeX-vers:
+ =========
+ You can select between two "types" of emTeX program:
+
+ tex.exe ...... it run at XT computers but a noticeable
+ limitations are present
+ tex386.exe ... it run at 386-computers only and use hi-memory
+ if present.
+
+^1599
+ F3FILE ... The file name for F3 editing
+ =======================================|^|{1500}
+
+ So called "hot keys" F3 call the editor from all states of
+ menu system. You can set the file name for this editing
+ in environment variable F3FILE including disk name, path and
+ extension. For example, you want to edit repeatedly the file
+ from other directory or with nonstandard extension.
+
+^1501
+ EDIT .... The editor call
+ =========================|^|{1500}
+
+ You can set the editor program here. If the batch call is set,
+ you must write the word "call" before the file name of batch.
+
+ Every user can work with his favorite editor.
+
+ A parameter (file name for editing) is substituted automatically
+ in accordance the item type. The value of EDITPAR is added. It can
+ be set after unsuccessful run of TeX by ERRCOM command and influences
+ the editor start after error in TeX run. For example editor starts
+ with two windows (.TEX and .LOG window) in such case and points
+ the place of error. The value of EDITPAR is removed after first
+ editor call. So, next editor call starts "normally".
+
+
+^1502
+ EMTEXED .... the editor call after "e" key in TeX
+ =================================================|^|{1500}
+
+ This is the emTeX environment variable. If TeX (METAFONT)
+ prompts the "?" character, you can enter the "e". Then TeX
+ terminates and editor specified here is called. You must write
+ parameters for this editor. The %1, %2 and %3 is substituted as
+ following:
+
+ %1 ... the line number with error
+ %2 ... the source file with error (including path)
+ %3 ... the .LOG file (including path)
+
+ For example, if you use QEDIT, you can write some similar as:
+
+ EMTEXED: c:\editors\qedit %2 %3 -n%1
+
+ Norton editor can be specified by the following way.
+
+ EMTEXED: c:\editors\ne +%1 %2
+
+
+^1503
+ SHELL .... The shell call (file manager, F6 key)
+ ================================================|^|{1500}
+
+ You can specify a program which is called after F6 hot key
+ pressing. The menu system has no possibilities with file
+ handling and therefore some file manager program is recommended
+ here. For example Norton Commander, XTree, PCTools etc.
+
+ Every user can work with his favorite file manager program.
+
+ If the batch call is set, you must write the word "call" before
+ the file name of batch.
+
+
+^1504
+ EMTEXOPT .... TeX parameters
+ ============================|^|{1500}
+ /e ... \errorstopmode
+ /s ... \scrollmode
+ /n ... \nonstopmode
+ /b ... \batchmode
+ others parameters ... see the documentation TEXWARE.DOC
+
+^1505
+ SCROPT .... View parameters
+ ===========================|^|{1500}
+ // ... interactive mode of parameters setting
+ /? resp. /?? ... shows basic resp. all parameters
+ /ou# ... default measure unit on ruler
+ /oi- ... black on white (default) /oi+ ... white on black
+ /hx# /hy# ... home place of text.
+ /h# /w# ..... The height and width of sheet. Default: A4 format
+ /o# ......... Default scaling (example /o2 : one to 2x2 pixels)
+ The number must be integer
+ Thousands of others parameters are documented in DVIDRV.DOC .
+
+ This parameters influence behavior of View but not Preview call.
+
+^1506
+ SPELLOPT .... SPELL checker parameters
+ ======================================|^|{1500}
+ @K ... Kamenickych code of nonstandard ASCII character (default)
+ @L ... PC Latin 2 code
+ @C ... CSKOI 8 code
+ The character "#" presented ... Checking the TeX sequences too
+ $<file> ... name of working dictionary (including path)
+ !<file> ... output file if different from input
+ + ... acoustic signalization of errors
+ %<number> ... checking from <number>-th line only
+
+ Example SPELLOPT: # %20 $d:\dict\mydict.ces
+ -------
+
+^1507
+ ERRCOM .... The command after error in TeX run
+ ==============================================|^|{1500}
+ You can write the batch call, which is executed after the unsuccessful
+ TeX (METAFONT) run. This auxiliary batch can set the EDITPAR
+ environment variable which influences the editor start.
+
+ If the batch call is set, you must write the word "call" before
+ the file name of batch.
+
+^1508 1509
+ USERCOM .... The command executed by UserCom item
+ =================================================|^|{1500}
+ You can find the item UserCommand in the submenu TeX. This item
+ executes the command you specify here.
+
+ Every user can set his own application here.
+
+ If the batch call is set, you must write the word "call" before
+ the file name of batch.
+
+ LASTCOM .... The last command when TeX system terminates
+ ========================================================|^|{1500}
+ If you want to run some special command(s), when you leave the TeX
+ system, you can write this command (batch call) here.
+
+
+^1510 1511 1512
+ FMT .... The name of .FMT file
+ ==============================|^|{1500}
+ If you are working with format not included into system offers,
+ you can write this format file name here.
+
+ TEXFMT .... Path with .FMT files (TeX)
+ =======================================|^|{1500}
+ The search path for format files for tex.exe .
+
+ BTEXFMT .... Path with .FMT files (BigTeX)
+ =======================================|^|{1500}
+ The search path for format files for tex386.exe .
+
+^1514 1515 1513
+
+ TEXINPUT.... Path with source files for TeX (.STY, .TeX)
+ ========================================================|^|{1500}
+ TeX first searches the input file in current directory and if
+ searching fails, TeX continue with search process in directory(ies)
+ specified here.
+
+ MFINPUT .... Path with source files for METAFONT
+ ================================================|^|{1500}
+ The same as TEXINPUT, but for METAFONT program.
+
+ TEXTFM .... Path with .TFM files
+ =================================|^|{1500}
+ The search path for TeX font metrics files.
+
+^(64 164 521 522)
+
+ Ports:
+ ======
+ You can change the implicit values for I/O ports.
+
+
+^(65 165 168 66 166 169) 1065 1066
+ Save:
+ =====
+ You can save the all environment state to so called configuration
+ batch file. After time, you can restore this environment by item Load.
+
+ The environment state keeps the names of all working files, format file,
+ all particular parameters etc.
+
+ If the configuration batch file has a name TEXCFG.BAT, the process
+ of restoring of this environment state is done automatically when
+ the TeX menu system starts.
+
+ Load:
+ =====
+ Restoring the environment state from file.
+
+~
+ *************** end of file CFG.MNU *******************
+
diff --git a/support/mnu/demo.bat b/support/mnu/demo.bat
new file mode 100644
index 0000000000..bdca53edde
--- /dev/null
+++ b/support/mnu/demo.bat
@@ -0,0 +1,51 @@
+@echo off
+echo A simple demonstration of MNU program principles.
+rem This is the control batch with main loop of applications.
+rem Execute this batch and try.
+
+rem ............... default settings
+set FILE=noname
+set MNU=50
+
+:menu
+rem ............... the MNU call
+mnu demo.mnu envir.bat
+rem ............... what is choosen ?
+if errorlevel 50 goto file
+if errorlevel 40 goto print
+if errorlevel 30 goto execute
+if errorlevel 20 goto compile
+if errorlevel 10 goto edit
+goto quit
+
+:edit
+ echo RUN editor here with the file %FILE%.pas
+ set MNU=20
+ goto menu
+
+:compile
+ echo RUN compiler here to the file %FILE%.pas
+ set MNU=30
+ rem if errorlevel 1 set MNU=10 (if not succesfull then return to Edit)
+ goto menu
+
+:execute
+ echo EXECUTE the file %FILE%.exe
+ set MNU=10
+ goto menu
+
+:print
+ echo RUN the convertor %FILE%.pas to %FILE%.lst
+ echo PRINT the file %FILE%.lst
+ set MNU=10
+ goto menu
+
+:file
+ call envir.bat
+ set MNU=10
+ goto menu
+
+:quit
+ echo End of demonstration, bye !
+
+
diff --git a/support/mnu/demo.mnu b/support/mnu/demo.mnu
new file mode 100644
index 0000000000..07ceca4882
--- /dev/null
+++ b/support/mnu/demo.mnu
@@ -0,0 +1,56 @@
+ A simple configuration file for MNU
+ ***********************************
+
+~hotkeys F2{* "echo COPYing [%FILE%].pas to A:">0} F3{* "dir">0, "pause">0}
+
+^50, 10, 20, 30, 40, 0 ; the list of item numbers
+~param{40, 5, 24, 15, 1, 112, 112, 116, 14, 15} " Menu "; parameters of window
+
+ File name: [%FILE%8]
+======================
+ | new f^ile |{51}
+----------------------
+ | E^dit |
+ | C^ompile |
+ | Ex^ecute |
+----------------------
+ | P^rint |
+ | Q^uit |
+----------------------
+F1-help F2-save F3-dir
+
+
+^51 [50] ; the item number and [the parent item number]
+~param{20, 11, 47, 4}
+ Write a new file name (without extension):
+ |#[%FILE%8]|{!>2, "set FILE=#">2, $50}
+
+
+~param {3 2 76 23 1 48 62} " Help " ; global parameters for help windows
+
+^(0 10 20 30 40 50 51) ; Help is common for all items
+
+ Use arrows (or mouse) and press
+ "Enter" ... to confirm selection
+ "Esc" ..... to cancel selection or edited new file name.
+
+ This is not real example but is similar to debugging process in
+ Pascal program:
+
+ New file .... you can set a new file name
+ Edit ........ edit the file [%FILE%].pas
+ Compile ..... compile file [%FILE%].pas as Pascal program
+ Execute ..... Run the [%FILE%].exe
+ Print ....... Print listing, file [%FILE%].pas
+ Quit ........ Terminate this "menu-loop".
+
+ You can use highlited letter key to select process immediately
+
+ Use hot key everytime: F1 ... help
+ F2 ... save [%FILE%].pas to diskette A:
+ F3 ... dir command
+
+~
+end of file DEMO.MNU
+
+
diff --git a/support/mnu/demotex.bat b/support/mnu/demotex.bat
new file mode 100644
index 0000000000..f88d58e6da
--- /dev/null
+++ b/support/mnu/demotex.bat
@@ -0,0 +1,12 @@
+@echo off
+
+rem This batch demonstrates the MNU program features.
+rem This is a more complicated example which demonstrates
+rem a emTeX configuration used in CSTeX package.
+
+rem See the EXAMPLES.DOC file or execute this batch and try.
+rem The individual applications don't work because this is the demonstration
+rem only and these applications are not installed correctly.
+
+%COMSPEC% /e:1300 /c texset csPLAIN PlainT^eX %1 %2
+
diff --git a/support/mnu/dupcent.c b/support/mnu/dupcent.c
new file mode 100644
index 0000000000..791094a4c6
--- /dev/null
+++ b/support/mnu/dupcent.c
@@ -0,0 +1,41 @@
+
+/* Program DUPCENT duplicates the per cent character */
+/* ************************************************* */
+/* 30.1.1993 Petr Olsak */
+
+/* Program types the input file to terminal, but all per cent characters
+ are duplicated. The DOS line can look as:
+ dupcent param1 param2
+ where
+ param1 ... the input file name (including the path if needed)
+ param2 (optionally) ... the text, which is included before each line
+ The program is used for OPTIONS/SAVE item in TeX menu system (for example).
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+#define FGETC(INPUT) (feof(INPUT)||i>=127 ? '\n' : fgetc(INPUT))
+
+FILE *input;
+char r[128];
+
+main(int argc, char *argv[])
+{
+ register int i;
+
+ input = fopen(argv[1], "r");
+ if (input != NULL ) while (!feof(input))
+ {
+ i = 0;
+ lab1: while ((r[i]=FGETC(input)) != '\n' && r[i] != '%') i++;
+ if (feof(input) && r[i-1]==-1) r[--i] = '\n' ;
+ if (r[i]=='%') { r[++i]='%'; i++; goto lab1;}
+ r[i]=0;
+ if (argv[2] == NULL || r[0]==0) printf ("%s\n", r);
+ else printf ("%s %s\n", argv[2], r);
+ }
+ return 0;
+
+}
+
diff --git a/support/mnu/examples.doc b/support/mnu/examples.doc
new file mode 100644
index 0000000000..7ce7152eef
--- /dev/null
+++ b/support/mnu/examples.doc
@@ -0,0 +1,326 @@
+
+ *****************************************************************
+ * *
+ * Program MNU *
+ * *
+ * A configurable menu for starting applications under DOS *
+ * *
+ * (The description of Examples ) *
+ * *
+ *****************************************************************
+ Prague, January 1993 Petr Olsak
+
+
+In the demo batches you can find some methods and tricks used with the MNU
+program. There are two examples.
+
+For documentation of MNU program see files README.TXT and MNU.DOC .
+
+
+1. The first simple example
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The first example shows a basic MNU program principles. This example
+describes not really application, but the basic principles of program MNU
+is clearly shown.
+
+The files used in the example are listed in the following table:
+
+ ---------------------------------------------------
+ demo.bat The control batch
+ demo.mnu The configuration file
+ envir.bat The auxiliary batch (it will be created)
+ ---------------------------------------------------
+
+Remarks
+-------
+
+** The batch "demo.bat" controls the main loop of application processes.
+ After terminating the MNU program the batch branches next executing by set
+ of commands
+
+ if errorlevel ... goto ...
+
+ One should have in mind that these "if errorlevel" commands must have a
+ decreasing order of constants ("if errorlevel" does mean ``if errorcode is
+ greater or equal to'').
+
+** Instead of the really application calls there are the "echo" commands
+ in the control batch "demo.bat" only. You can remove this word ("echo") and
+ write the really applications.
+
+** If the user changes the file name (value of the "FILE" environment
+ variable), the program MNU writes the line
+
+ set FILE=<newname>
+
+ into the file "envir.bat" (see file "demo.mnu", line 26). After terminating
+ of the MNU program the control batch "demo.bat" calls this auxiliary batch
+ (see line 44 in "demo.bat"). This is a way to set new value to environment
+ variable globally.
+
+** The MNU variable is set to the probably next used item number after
+ each applications. So that the user can press only the "Enter" key repeatedly
+ to make the loop "Edit"->"Compile"->"Execute".
+
+** After the ``executing of compiler'' the line with test of error code
+ of compiler is included (see line 29 in "demo.bat"). If the compiler does
+ not end successfully, the batch sets the value 10 (instead 30) to MNU
+ variable and this setting influences the next state of MNU program (the
+ Edit item offers instead the Execute item). This command is commented out
+ ("rem") because the really compiler run does not preceded.
+
+** If user press the "Esc" key, the MNU program searches the item with
+ number zero and the "Quit" item offers.
+
+
+2. The second more complicated example
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This is the example of emTeX configuration using the MNU program.
+The files listed below are really used in CSTeX package. In this package
+distributed by CSTuG (Czechoslovak TeX Users Group), the emTeX
+programs and MNU configuration are included. The MNU configuration is
+separated from the CSTeX package and included as the example here.
+
+ ----------------------------------------------------------------
+ demotex.bat This batch starts the example
+ texset.bat Initialization batch
+ texbat.bat The main loop
+ texrun.bat,
+ others.bat,
+ prints,bat,
+ metafont.bat The applications batches (called from "texbat.bat")
+ cfg.mnu The configuration file for menu
+ sorry.mnu The configuration file for ``sorry-messages''
+ texcfg.bat User's configuration
+ mfbat.bat The auxiliary batch (it can be changed)
+ gfbat.bat,
+ dos.bat",
+ envir.bat The auxiliary batches (they will be created)
+ dupcent.exe Duplicates the "%" character (utility program)
+ totext.exe Sets the screen to text mode (utility program)
+ kalk.exe Calculator -- a simple application program
+ kalk.hlp help texts for "kalk.exe"
+ dupcent.c,
+ totext.c The source codes for utility programs
+ -----------------------------------------------------------------
+
+Unfortunately, this example cannot show the applications in really action,
+because application programs are other matter and they are not included in
+this small MNU package. If you are interested in this problem, you can take
+the whole CSTeX package from public international network archives.
+Note that the installation program of this package is based on MNU program
+too.
+
+You can run the staring batch "demotex.bat" and try the menu. The helps
+are translated from Czech language to English (more exactly to my poor
+English and bad English). So, the sense of individual items can be read
+from this helps.
+
+The files listed here can be used in various configuration of TeX
+systems, but some modifications are needed. If you intend to use these
+files as a motivation when designing the TeX configuration for your
+computer, you will have to modify some parts as your needs can be.
+
+In any case, the files listed here can serve as a source of inspiration. At
+least you can find the key to a better understanding the philosophy
+of the communication between the control batch and the MNU program there.
+
+The remarks to individual tricks and most important parts of files used in
+this example follow here.
+
+
+Remarks to "demotex.bat"
+------------------------
+
+** There is only one line here---the call of the batch "texset.bat" via
+ the command "command". The environment variable "COMSPEC" will be expanded
+ to command "command" including path. The command "command" enlarges the
+ system environment. Many environment variables will be used.
+
+** The "texset.bat" has four parameters. First: the format file name
+ ("csPLAIN" in the example in "demotex.bat"), second: the item text for
+ TeX executing ("PlainT^eX" in the example), third: the working and main
+ filename ("%1" in the example) and fourth: the working filename if
+ different ("%2" in the example).
+
+** The ``starting batch'' "demotex.bat" has others names in original
+ CSTeX package: "plain.bat", "latex.bat" etc. This batches are placed in
+ directory where the system "PATH" points. So that the user can call the
+ TeX system from his own current directory by the command (for instance)
+
+ latex <filename>
+
+ All working files (".tex", ".dvi", ".log", etc.) will be created in the
+ current directory.
+
+
+Remarks to "texset.bat"
+-----------------------
+
+** There are "set" commands here to set the environment of emTeX
+ variables and others. Some variables are used only in batches. The field
+ signed as ``system dependent variables'' includes variables dependent on
+ disk structure. Note that the first settings are nonstandard in demo-version
+ of "texset.bat" because only demonstration without special path handling is
+ done. The really settings can look as following:
+
+ set TEXDIR=c:\emtex <the main directory with programs>
+ set TEXDIRCFG=c:\emtex\cfg <the directory with configuration files>
+ set RAM=e:\temp <ram disk with directory for temporary files>
+ set EDIT=c:\editors\ne <the main editor>
+ set SHELL=c:\nc\nc <the file manager>
+
+** After environment settings the "texset.bat" calls the "texcfg.bat" if
+ present (see line 57). So that the user can change the default setting in
+ his own ``configuration batch'' "texcfg.bat" if this file is placed in
+ current directory.
+
+** Some batches and configuration files ("texbat.bat", "cfg.mnu",
+ "texrun.bat", "mfbat.bat") are copied into RAM disk to increase the speed
+ (see lines 50--53 in "texset.bat"). This process is skipped in demo
+ version because the environment variable RAM does not point to RAM disk.
+ (see line 50: ".. goto start").
+
+** The "texset.bat" calls the "texbat.bat"--the main loop of
+ applications (see line 61).
+
+
+Remarks to main loop "texbat.bat"
+---------------------------------
+
+** The MNU is called here (compare with "demo.bat" from previous
+ example). Then the process branches to individual applications or
+ application batches.
+
+** The auxiliary batch "envir.bat" is called after each MNU run to
+ restore the global environment setting (see line 5).
+
+** If the typical file of application is not found the process go to
+ "sorry" label (line 139) and calls the MNU program with "sorry.mnu"
+ configuration file to display a message about no-installed program (see
+ line 80 for instance). This handling is included to control batches because
+ no all applications may be installed---the installation program of CSTeX
+ offers many variabilities that no all programs can be installed.
+
+** The "texbat.bat" calls directly only some applications, others are
+ called via application batches. You can compare this batches to
+ ``procedures'' in programming languages.
+
+
+Remarks to batches "texrun.bat", "others.bat", "prints.bat" and "metafont.bat"
+------------------------------------------------------------------------------
+
+** The error code from MNU is still stored and the process branches to
+ individual applications again.
+
+** The ``sorry handling'' is similar as in the "texbat.bat".
+
+** The individual application will not work in demo version because they
+ are not installed.
+
+** Some tricks are used here. These tricks are related to emTeX
+ configuration itself and they are not in our first interest while we
+ are studying the MNU philosophy.
+
+
+Remarks to "cfg.mnu" configuration file
+---------------------------------------
+
+By means of questions and answers, we are going to look into some
+constructions in the file "cfg.mnu" installed. We focus on those
+parts of the file which need not be quite comprehensible even after reading
+the documentation through.
+
+? Where to look for the item 100 defined in the line " ^ 100 \" (see
+ line 10).
+
+! This item does not exist. It is the case when there are less items
+ (zero in this place) in the window than set in the definition line of the
+ window. The window opens if the item is called, but there is no item
+ active. The window is called as a parent window by the window with the
+ basic menu (see line 16). Pressing the key "Esc" at the moment when only
+ the basic menu is offered does not cause a jump to the non-existing item
+ 100, because the window is defined as automatically closeable (the
+ character "\").
+
+? Why is the result of choosing (e.g. "amstex") in "Formats menu"
+ stored not only in the environment variable, but also in the file 2 in the
+ form "set FMT=amstex">2 (see line 122).
+
+! The command "csAMSTEX">FMT has a local character within
+ the MNU program, and because the next command (i.e. "*") means closing all
+ windows and a jump onto the item 61, also the contents of the window with
+ the non-existing item 100 is restored; it bears information about the
+ chosen format. On the other hand, the command "set FMT=amstex">2
+ enables to forward the information about the chosen format to the
+ control batch via the file 2, i.e. the file "envir.bat".
+
+? How to make sense of definitions of items in the "Diskette menu"
+ (lines 172--179).
+
+! The environment variable "AR" means the direction of copying (from
+ or onto the disk), and the variable "D" is the letter of the chosen diskette
+ drive (either A or B). The batch works with both variables, and therefore
+ the values as stored in the file "envir.bat" in the form of a command
+ "set". Moreover, the value "D" is stored also locally, because it is used
+ when opening the window with the item 105 (there is a variable text reading
+ "Insert diskette to drive [%D%]" ).
+
+? In the window with ``final question'', the numbers in the window definition do
+ not match with the number of items. Unlike the window 100, there are less
+ numbers then items (lines 186--189).
+
+! The program jumps to the item 0 (i.e. "Yes") when closing all
+ windows, that is if "Esc" was pressed in the main menu. The item "No" does
+ not need to have a number, because the program does not leave it, but the
+ window with the item 3 is opened.
+
+? How to arrange the final question, where "No" is implicitly
+ offered.
+
+! In the window definition, we write e.g.: " ^ 1, 0 "; and in the
+ control batch, we use the commands "if errorlevel" to ensure that the batch
+ terminates in the case of "errocode=1".
+
+? Why is the item "DOS" solved intricated using the file 3 (i.e. the
+ auxiliary file "dos.bat", see line 203). Is it not sufficient to call a line process by a
+ definition: {*"#">0} ?
+
+! Yes, it will do. But there is a little defect here. The user would
+ like to find the last edited value under the item "DOS". We cannot
+ guarantee it other way than to store this value in a file. The MNU program
+ should terminate and restart several times before the user wishes to use
+ the item "DOS" again.
+
+? Why are items with the same number in "Print menu" ? (See
+ line 49.)
+
+! Why not? If user chose the item, the error code of program
+ terminating is set to the number of chosen item and this does not make any
+ conflict. The batch "print.bat" branches next process by the environment
+ setting and not only by the error code.
+
+? There is an error in the definition of the editable variable in
+ "METAFONT parameters"! The line 210
+
+ METAFONT |#[%4% 31, 1, 66]|{!>4, "[%4% 1, 1, 30]#">4}
+
+ means that the program first reads 66 characters of the text from the file 4
+ ("mfbat.bat") and opens the window with editable item.
+ After editing, the file 4 is reset by the command "!>4". Thus, the
+ following construction "[%4% 1, 1, 30]" returns a blank string from the
+ resetted file instead of first 30 characters of the old contents of file
+ as intended by the programmer of this definition.
+
+! Congratulations. If you have succeeded to discover this discrepancy
+ by yourself, it is evident that you are an attentive reader of the
+ documentation. The moment, when the substitution in the constructions
+ "[%...]" is performed, is not stressed there. The substitution is done
+ during opening the window, and all the text related to the opened window is
+ kept in the memory in the substituted form. The commands defining the item
+ reaction are performed only when the item has been chosen by the key
+ "Enter". These commands are not read from the file, but from the memory,
+ where the substitutions have been done. Therefore it works properly.
+
diff --git a/support/mnu/kalk.hlp b/support/mnu/kalk.hlp
new file mode 100644
index 0000000000..fff87c7ab8
--- /dev/null
+++ b/support/mnu/kalk.hlp
@@ -0,0 +1,127 @@
+; Help soubor pro program kalk.exe
+
+%1, 6, 5, 70, 17, 2, 0, 1, 1, ' Kalkulacka - Help '
+
+ KALKULACKA - VYPOCET VYRAZU V REALNE PROMENNE
+ *********************************************
+ ver. 5.5.1991 Petr Olsak, K 301, FEL CVUT
+
+ HLAVNI OBSAH HELPU
+ ------------------
+ * Prace s kalulackou ............ klavesa <P>
+ * Syntaxe zadavani vyrazu ............... <V>
+ * Zadavani vlastnich konstant ........... <C>
+ * Tabelace funkce ....................... <T>
+ * Kalkulacka jako residentni program .... <R>
+--------------------------------------------------------------------
+ Dalsi help - viz klavesy <P>, <V>, <C>, <T>, <R>
+ Konec helpu - jakakoli jina klavesa
+^ P: 7, V: 10, C: 3, T: 4, R: 8
+
+
+%10, 4, 3, 70, 21, 2, 0, 1, 1, ' Syntaxe vyrazu '
+
+ Pravidla jsou stejna jako v Pascalu s jistymi rozsirenimi.
+ Lze pouzit : * binarni operace: + - * /
+ * unarni operace: + -
+ * kulate zavorky,
+ * elementarni funkce: abs, sin, cos, exp, ln,
+ sqr, sqrt, arctan.
+ Navic lze pouzit :
+ * umocnovani, tj. binarni operace: ^
+ * elementarni funkce: tg, cotg, arsin, arcos, artg, sinh,
+ cosh, tgh, arsinh, arcosh, artgh,
+ log, sign, trunc, frac.
+ * funkce vice parametru: min, max.
+ Operandy jsou : * ciselne konstanty (jako v Pascalu),
+ * konstanty pi, e a dalsi, ktere si sami
+ nadefinujete
+ * rezervovany identifikator kalk (viz <P>).
+------------------------------------------------------------------
+ <P> - prace s kalkulackou, <H> - hlavni obsah helpu
+^ P: 7, H: 1
+
+%7, 6, 4, 70, 18, 2, 0, 1, 1, ' Prace s kalkulackou '
+
+ Na zvyrazneny radek napisete vyraz a odeslete jej klavesou
+ <Enter>. Pokud je vyraz tak slozity, ze se nevejde do nabizeneho
+ radku, nezoufejte a piste dale. Text se zacne "rolovat" doleva.
+ Dale pomoci kurzorovych klaves a klaves <Home> a <End> jej muzete
+ "rolovat" zpet. V takovem pripade se vysledek napise do zvlastniho
+ vysledkoveho okna, abyste videli cely vyraz naraz.
+ Pisete-li dalsi vyraz, predchozi se automaticky smaze, Chete-li
+ jej zachovat (pro opravu), zmacknete nejdriv kursorovou klavesu.
+ Pri syntakticke chybe Vam blika kurzor v miste chyby.
+ Zapis vyrazu se ridi pravidly podobne jako v Pascalu <V>.
+ Muzete s vyhodou pouzit vsechny konstanty (pi, e, vase vlastni) a
+ dale rezervovany identifikator kalk , ve kterem je hodnota vy-
+ sledku z posledniho pouziti kalkulacky.
+--------------------------------------------------------------------
+ <V> - pravidla pro vyraz, <H> - hlavni obsah helpu
+^ V: 10, H: 1
+
+%3, 6, 2, 70, 20, 2, 0, 1, 1, ' Zadavani konstant '
+
+ Rezervovane konstanty v okne pro konstanty napovidaji, jak si
+ mate pocinat. Tyto prvni dve konstanty (pi, e) nemuzete menit.
+ Vpravo od rovnitka pisete vyraz, ktery obsahuje predem definovane
+ konstanty. Ulozeni hodnoty konstanty potvrdite klavesou <Enter>.
+ Klavesa <Esc> a kurzorove klavesy <> , <>, <PgUp>, <PgDown>
+ nepotvrzuji novou hodnotu. Navic <Esc> ukoncuje definici konstant.
+ Pri opetovnem volani okna s konstantami muzete postupne menit
+ Vase konstanty. K oprave napsanych konstant pouzijte kurzorovych
+ klaves. Nezapomente na potvrzeni nove hodnoty - <Enter>.
+ Identifikatory konstant mohou byt jakekoli. Zacinaji pismenem,
+ dale jsou pismena nebo cislice (max. 8 znaku). Nerozlisuje se mezi
+ velkymi a malymi pismeny !
+ Konstanty se mohou ruzne "vzajemne" definovat. Napr. pokud jste
+ uz definovali c = 1 , muzete zmenit tento radek na c = c + 1 .
+ Kazde potvrzeni tohoto radku znamena zvetseni konstanty o jednicku.
+--------------------------------------------------------------------
+ <V> - syntaxe vyrazu, <H> - hlavni obsah helpu
+^ V: 10, H: 1
+
+%4, 15, 7, 50, 9, 2, 0, 1, 1, ' Tabelace funkce '
+
+ Tato cast programu jeste neni udelana.
+
+ Bude obsahovat tabelaci funkce s moznosti
+ ukladat vysledky do souboru.
+------------------------------------------------
+ <H> - hlavni obsah helpu
+^ H: 1
+
+%8, 5, 5, 70, 15, 2, 0, 1, 1, ' Kalkulacka jako residentni '
+
+ Napisete-li v DOSu prikaz: kalk /r , zustane kalkulacka v pa-
+ meti jako residentni a bude vyvolatelna klavesami Alt-K .
+ Protoze je to muj prvni residentni program a nemel jsem moznost
+ k teto problematce nic nastudovat a s nikym jsem to nekonzultoval,
+ varuji pred pouzitim rezidentni kalkulacky.
+ Predevsim nechodi v grafickem prostredi. To by se jeste dalo
+ otestovat, horsi je, ze se kope s jinymi residentnimi programy a
+ nejvetsi smula je, ze si obcas nerozumi ani s Norton-Commanderem.
+ Posledni problem je v tom, ze zatim neumim residentni program
+ z pameti odstranit, tudiz se nabizi jen resetovani pocitace.
+--------------------------------------------------------------------
+ <H> - hlavni obsah helpu
+^ H: 1
+
+%41, 4, 5, 74, 17, 2, 0, 2, 1, ' Help '
+
+ *************************** ZADAVANI FUNKCE **************************
+
+ Funkci napisete va tvaru vyrazu <V> a ukoncite klavesou <Enter>.
+ Pri syntakticke chybe Vam blika kurzor v miste chyby.
+ Vyraz pro funkci nezakoncujte symbolem "dx".
+ Nechcete-li, aby Vam po zmacknuti prvni klavesy nabizeny text
+ zmizel (chcete jej napr. jen opravit), pohnete nejdrive kurzorem.
+ Vestaveny editor se chova podobne, jako editor v Norton Commanderu.
+ Pokud se Vam funkce nevejde do zvyrazneneho radku, nezoufejte.
+ Text se zacne "rolovat" doleva. Dale pomoci kurzorovych klaves a
+ klaves <Home> a <End> jej muzete "rolovat" zpet.
+ ----------------------------------------------------------------------
+ Pro podrobnejsi komentar o vyrazech muzete zmacknout <V>.
+^ V: 10
+
+ \ No newline at end of file
diff --git a/support/mnu/metafont.bat b/support/mnu/metafont.bat
new file mode 100644
index 0000000000..8b9b8f6324
--- /dev/null
+++ b/support/mnu/metafont.bat
@@ -0,0 +1,42 @@
+rem ..... The "subroutine batch" called from TEXBAT.BAT
+if errorlevel 58 goto viewMP
+if errorlevel 57 goto texMP
+if errorlevel 56 goto editMP
+if errorlevel 54 goto convert
+if errorlevel 53 goto metafont
+if errorlevel 52 goto editMF
+goto end
+:EditMF
+ %EDIT% %MF%.mf %EDITPAR%
+ set EDITPAR=
+ set MNU=53
+ goto end
+:metafont
+ set MNU=52
+ :mfstart
+ set EDITPAR=
+ if exist %RAM%\ed.bat del %RAM%\ed.bat
+ call %RAM%\mfbat
+ if errorlevel 1 %ERRCOM%
+ %TEXDIR%\totext
+ if exist %RAM%\ed.bat call %RAM%\ed
+ if exist %RAM%\ed.bat goto mfstart
+ goto end
+:convert
+ echo %GFOPT% > %RAM%\gfbat.bat
+ %COMSPEC% /c %RAM%\gfbat
+ goto end
+rem ................................. include a new font in TeX:
+:editMP
+ %EDIT% %MF%.mp %EDITPAR%
+ set EDITPAR=
+ set MNU=57
+ goto end
+:texMP
+ set MNU=58
+ call %RAM%\texrun %MF% mp
+ goto end
+:ViewMP
+ %TEXDIR%\dvidrv dviscr @scr.cnf %SCROPT% %MF%
+ set MNU=56
+:end
diff --git a/support/mnu/mfbat.bat b/support/mnu/mfbat.bat
new file mode 100644
index 0000000000..334ef68879
--- /dev/null
+++ b/support/mnu/mfbat.bat
@@ -0,0 +1 @@
+mf186 /a%RAM%\ed.bat &plain \mode=lqlores; mag=1.0; input %MF%
diff --git a/support/mnu/mnu.doc b/support/mnu/mnu.doc
new file mode 100644
index 0000000000..0c39e01164
--- /dev/null
+++ b/support/mnu/mnu.doc
@@ -0,0 +1,842 @@
+
+ *****************************************************************
+ * *
+ * Program MNU *
+ * *
+ * A configurable menu for starting applications under DOS *
+ * *
+ * ( English documentation ) *
+ * *
+ *****************************************************************
+ Prague, January 1993 Petr Olsak
+
+
+1. A BRIEF INTRODUCTION
+%%%%%%%%%%%%%%%%%%%%%%%
+
+See the file README.TXT
+
+
+2. DESCRIPTION OF THE PROGRAM
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+2.1 Start of the program
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The MNU program operates in the 80x25 text screen mode. If the screen is
+switched to another mode, the program can display incorrectly. In that
+case, it is recommended first to call the program "totext.exe", which
+redefines the screen mode.
+
+In the text mode, the MNU program does not depend on the way, how
+nonstandard ASCII characters (national specialities) are represented. All
+displayed texts are being read from the configuration file, which is to be
+prepared in agreement with the implemented coding. The correct display of
+national characters is not a part of the program, so that other technical
+means are to be used.
+
+The program is to be called with at least one parameter---the name of the
+configuration file (incl. the path if necessary). The other parameters are
+optional. These are the names of input and/or output files, and the program
+can use them following the commands from the configuration file.
+
+If the program is started without any parameter, it displays an error
+message, and terminates returning the error code 255. The same occurs if the
+configuration file cannot be opened for reading.
+
+A rule: Whenever the program terminates because of any error, an error
+message is displayed and the error code 255 is returned.
+
+
+2.2 Data in the configuration file
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The following data are read from the configuration file:
+
+ * Item texts
+ * Highlighted letters in item texts
+ * Item numbers---each item is assigned a number (a positive integer)
+ * Program action after choosing each item
+ * Item sequence in each window
+ * Structure of mutual calling of items
+ * Type of items (editable or non-editable)
+ * Explanatory texts in the windows
+ * Window sizes and their allocation on the screen
+ * All necessary colour attributes
+ * Help texts and their relation to individual items
+ * Sizes, allocations and colours of help windows
+ * Way of communication with the outer environment (input/output files,
+ environment variables)
+ * The hot keys definition
+
+There is a lot of other information in the configuration file. For more
+details see para 3.
+
+
+2.3 Starting item
+%%%%%%%%%%%%%%%%%%
+
+When started, the MNU program presents the item, the number of which
+corresponds with the content of the environment variable ``MNU''.
+
+An example of calling the MNU program:
+
+ set MNU=17
+ mnu config.mnu
+
+In this case, the item with number 17 is presented when the MNU program is
+started. (We suppose that such an item is defined in the file
+"config.mnu".)
+
+If the starting item belongs to a partial sub-menu involved in the
+mutual linkage of windows and items, all ``parent'' windows are opened
+automatically before the window with the particular item is opened.
+
+If the environment variable ``MNU'' does not exist or if its content is not
+of the type integer, it is considered as having the value zero.
+
+If there is no item defined with the number equal to the content of the MNU
+variable in the configuration file, the program displays an error message
+and is terminated.
+
+
+2.4 Selection of the item from the keyboard
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Within a window, the user switches the active item by arrows. Pull down
+menus are the exception -- left/right arrows cause a jump to the
+neighbouring window there (this is to be defined precisely in the configuration
+file).
+
+The key "Esc" returns the selection process to the ``parent'' window. If
+there is no such window (the active window is the ``root'' of the
+structure), then the program finds the item corresponding to the number 0.
+In the case such an item is not defined the program is terminated and the
+control is returned to DOS with the code 0. If the item exists, the program
+opens the corresponding window and offers this item as active. This
+procedure allows to configure the window with the last question of the type
+``Do you really want to finish?'', when the item with number 0 can contain
+the text ``Yes''.
+
+There are three possibilities of the "Enter" key reactions:
+
+ * The next window with items opens. More precisely: the specified item in
+ the next ``child window'' is offered as active.
+ * The program terminates its operation, closes all open windows, and
+ returns the error code equal to the number of the selected item. If the
+ item number is greater than 254, the programs returns the code 255.
+ * The program calls the process defined by a single DOS line (so-called
+ line process calling). In this case, the program resides in the computer
+ memory, calls the process required, and at the end of this process offers
+ the next specified item as active.
+
+The way of the "Enter" key reaction is defined in the configuration file.
+
+A special type is the so-called ``editable'' item. It allows to do a line
+editing right in the place of the item. The result of this editing is
+stored in a special buffer for later utilization in the ``line process
+calling'' or for including into output files. This way, it is possible to
+change the content of DOS environment variables, arrange parameters for a
+line process, etc.
+
+The built-in item editor works in the ``insert'' mode only. The keys "Del",
+"Backspace" and right/left arrows work as usual. If the first pressed key
+is an arrow key, the offered text is edited. Otherwise, the original text
+disappears and a new text can be entered. The "Esc" key returns to the
+original text, the "Enter" key keeps new text in the buffer and starts the
+``item actions'' defined in the configuration file. If the editation process
+does not begin the up/down keys can be used to select the required editable
+item else up/down keys does not work because it is not specified whether
+to confirm ("Enter") or to cancel ("Esc") of the edited text.
+
+The "F1" key calls the help corresponding to the active item. The help
+windows are configured in the configuration file, and they can contain,
+in any place, further items (highlighted notions), which allow jumping to other
+help windows. Thus, a structured help can be defined. The "Esc" key quits
+the help. In the case that the help window does not contain any item, the
+"Enter" key has the same meaning as the "Esc" key.
+
+If there is a ``highlighted letter'' defined in the item, the item can be
+selected by simple touching the key with this letter. The program reaction
+is the same as when arrows and the "Enter" key are used.
+
+In the case of any inconsistency in the configuration file (e.g. the number of
+the consequential item cannot be found) the error message occurs and the
+program terminates.
+
+2.5 Selection of the item by the mouse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+If the mouse driver is installed, the mouse cursor appears on the screen.
+Pressing the left mouse button causes the selection of the item under the
+cursor (the same function as "Enter"). Pressing the same button outside the
+window acts similarly as "Esc", i.e. the last opened window is closed. The
+right button calls and cancels the help. The middle button has no function.
+
+The program was tested with the ``Genius mouse'' only. It is possible that
+other mice could disobey (e.g. the Mickey mouse).
+
+
+3. FORMAT OF THE CONFIGURATION FILE
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Inspect the content of the file "texcfg.mnu". It can serve as an
+illustrative example. The following text may be difficult to understand
+without parallel keeping the content of that file in view.
+
+
+3.1 The basic structure
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+The whole configuration file divides into sections, where attributes and
+make-ups of individual windows are defined. Such a section begins with the
+character "^" in the first column of the first line. We call this line a
+``window-defining line''. The window-defining line is followed
+(optionally) by the definition "~param", which is local for the
+particular window. The text to be displayed in the window follows. In this
+text, individual items, incl. corresponding program actions after a selection
+of any of them, are given. The end of the section is in the place of a new
+window-defining line, or (not very often) of a global definition
+"~param".
+
+Prior to the first window-defining line, there may be arbitrary text
+(comment lines), and, next to it, global definitions "~param", "~start",
+"~final", "~hotkeys", "~sound", and "~copy". These definitions are written
+on separate lines introduced with the character "~".
+
+Accordingly, the structure of the configuration file is as follows:
+
+ comment lines (optional)
+ ~global definitions (optional)
+ ^the first window-defining line
+ ~param -- parameters for the first window
+ text of the window incl. description of items and actions
+ ~param -- global parameters (optional)
+ other comments (optional)
+ ^the second window define line
+ ... etc.
+
+The text of the window may exceed number of lines of the window. The
+exceeding lines (in the bottom) are ignored. It is possible to use them for
+further comments.
+
+It is not recommended to utilize this place for larger comments. The program
+searches data from the configuration file sequentially (line by line), so
+that extensive comments could result in a slow-down of the program execution.
+It is sensible to locate definitions of more frequent windows at the
+beginning. For instance, it is advisable to put helps at the end of the
+file.
+
+3.2 Active characters
+%%%%%%%%%%%%%%%%%%%%%%
+
+Active are those characters that mark off the structure of the
+configuration file. The other characters are usually to be displayed in a
+window, or they serve as a comment.
+
+Most of the characters are active only under some conditions. For instance,
+the character "~" is active only if in the first column. In another place
+it is interpreted as any other text character.
+
+The following table gives the list of the active characters:
+
+ Character Condition Meaning
+ ----------------------------------------------------------------------
+ "^" in the first column window-defining line
+ "~" in the first column global or local definition
+ "|" anywhere in the text
+ of the window marks off the beginning
+ and/or the end of the item
+ "#" immediate following the character "|"
+ opening an item this item is editable
+ "^" immediate following the character "|"
+ opening an item this item is ``auto-run item''
+ "!" immediate following the character "|"
+ opening an item marks the highlighted text
+ "^" inside an item marks the highlighted letter
+ "{" immediate following the character "|"
+ closing an item the action after the item selection
+ is defined and close in braces
+ "[%" in any place introduces the requirement for a
+ text substitution
+
+This table implies several restrictions on the window texts:
+
+ * No ``common'' line can begin with the characters "~" or "^" .
+ * The character "|" cannot be included in the window text. If necessary,
+ the character ³ with the extended ASCII code 179 can be used.
+ * Inside an item it is impossible to type the character "^" .
+ * In the whole configuration file you cannot use the pair "[%" -- this
+ starts an requirement for a text substitution anywhere.
+ * The text of a non-editable item cannot begin with the characters "!" or
+ "#" .
+
+The active characters were chosen so as to minimize the restrictions.
+
+
+3.3 Requirements for text substitutions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Anywhere in the text of the configuration file, the following construction
+can appear:
+
+ [%<NAME>%<LENGTH>]
+
+where the parameter <LENGTH> is optional.
+
+This construction is substituted by the content of the environment variable
+<NAME>. The length of the corresponding string counts <LENGTH>. It means that
+the superfluous characters (to the right) are omitted, if the content is
+longer, or the string is completed with blank characters, if the content is
+shorter. If the parameter <LENGTH> is not given, the length of the
+corresponding string is set equal to the length of the content of the
+environment variable.
+
+There is another possibility of a text substitution---to substitute a text
+from another file. That construction is of the form
+
+ [%<N>% <X>, <Y>, <LENGTH>]
+
+The text from the ``<N>-th file'' is substituted for this construction. The
+<N>-th file is that given as the <N>-th parameter in the command line of
+the MNU program call.
+
+Further, <Y> is the line number, and <X> the column number of the position
+in the file, where the text is to be read from, and <LENGTH> is the length of
+the resulting string. The text is being read only from the indicated line,
+and is, if necessary, completed with blank characters to the right. If <LENGTH> =
+is 0, then the length of the resulting string is equal to the length of the
+<Y>-th line in the file (or of its part if <X> is greater than 1).
+
+The parameter <LENGTH> is the only optional one; if it is not present, the
+program reads the file from the position <X>, <Y> to the end of file (more
+than only one line can be read).
+
+EXAMPLES.
+We suppose the program to be called in the following situation:
+
+ set ENVIN=babble
+ mnu config.mnu myfile.txt
+
+and that the file "myfile.txt" contains the following two lines:
+
+ experimental text
+ in two lines containing [%ENVIN%]
+
+In the following table the reader can find various examples:
+
+ construction result
+ --------------------------
+ [%ENVIN%3] bab
+ [%ENVIN%] babble
+ [%2% 1, 1, 5] exper
+ [%2% 10, 1, 9] tal text
+ [%2% 1, 1] experimental text
+ in two lines containing babble
+ [%2% 14, 2, 0] containing babble
+
+If the environment variable does not exist, the result of the construction
+is blank. The program does not report any error at that moment. For
+example, "[%%80]" means 80 spaces.
+Similarly, if the file cannot be opened for reading, the result of the
+construction is blank.
+
+For security reasons, the program does not allow any construction including a
+call of the file with the numbers 0 or 1 (the configuration file calls itself).
+
+The input files can contain the next requirements for text substitution.
+A never-ending recursive call of files is treated (for security) in such a
+way, that during the eighth attempt to open a new file the program displays
+an error (stack overflow), or an attempt to open a file for reading fails
+(number of open files is limited in DOS).
+
+If the text substitution construction calls a file containing
+other defining lines in its text, then such a construction is to be
+situated at the beginning of a line. The program reads only first
+characters on each line when scanning the definitions, and does not waste
+time with substitutions required in the middle of lines. Such substitutions
+are accomplished only when the program needs to read the whole line or the
+text of the window.
+
+If the global definition "~copy" precedes the first defining line, then all
+lines of the configuration file following this line are copied at the
+screen. The definition "~copy" does not contain parameters, so that its
+format is simply "~copy".
+
+When copying (by "~copy"), text substitutions are performed in agreement
+with the above rules. The MNU program finishes its activity when copying
+has been accomplished. That means that the definition "~copy" switches the
+program into a special mode, when no commands or definitions of the
+configuration file are performed, and no items or windows are treated. Only
+the character pair "[%" is active there.
+
+Such copying is reasonable particularly when the output is directed not to
+the screen, but into a file. This can be reached by an easy command:
+
+ mnu input next input > output
+
+A utilization of this program mode is possible for making installation
+batches and environment handling.
+
+
+3.4 Definition "~param"
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+The definition begins with the character "~", and its format is as follows:
+
+ ~param {<NUMBERS>} "<HEAD>" ; <COMMENT>
+
+The parameters "<HEAD>" and ; <COMMENT> are optional.
+
+*** <NUMBERS> -- are integers separated by spaces or commas. These numbers
+are arranged in the order
+
+{<X>,<Y>,<WIDTH>,<HEIGHT>,<FRAME>,<GROUND>,<ITEM>,<LETTER>,<A-ITEM>,<A-LETTER>}
+
+and their meaning is as follows:
+
+<X>, <Y> -- x and y coordinates of the upper left corner of the window
+(incl. the frame if exists)
+
+<WIDTH>, <HEIGHT> -- window width and height (incl. the frame)
+
+<FRAME> -- 0 : no frame, 1 : a simple frame, 2 : a double frame
+
+<GROUND> -- basic text color attribute for the window (0 to 255)
+
+<ITEM> -- text color attribute of inactive items for the window
+
+<LETTER> -- highlighted letter color attribute for inactive items
+
+<A-ITEM>, <A-LETTER> -- similar as <ITEM>, <LETTER>, but for active items
+
+If less than 10 parameters are given, the other parameters to the right
+keep their global or implicit values. If more than 10 numbers are given,
+the superfluous numbers (to the right) are ignored.
+
+The wildcard "*" used instead of a parameter leaves the parameter unchanged
+with the global or implicit value.
+
+*** <HEAD> -- text (heading) to overwrite the middle of the window frame
+top line. When not present, the frame is not interrupted.
+
+*** <COMMENT> -- the text separated by a semicolon is ignored.
+
+A global definition "~param" is valid for all windows until another global
+definition "~param" appears. More exactly, the next global definition
+"~param" overwrites some (or all) parameters of window defined here.
+
+On the other hand, a local definition "~param" influences parameters (all
+or some of them) only for the particular window.
+
+If neither global nor local definition determine the parameters, they keep
+their values predetermined as follows:
+
+ ~param {10, 5, 62, 17, 1, 31, 30, 30, 14, 14}
+
+i.e. a blue window approximately in the middle of the screen with a simple
+frame and yellow items.
+
+
+3.5 Window-defining line
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+is of the form
+
+ ^(<HELP>) <ITEMS> [<PARENT>] <<L-R>> \ ; <COMMENT>
+
+The types of parameters are identified by the shape of the brackets. The order
+of the parameters cannot be changed.
+
+All parameters (incl. brackets), with the only exception of the parameter
+<ITEMS>, are optional; the shortest window definition is of the form:
+"^ <ITEMS>".
+
+*** (<HELP>) -- if this parameter is present, a window for help is defined.
+ Be aware: The left parenthesis should immediately follow the character
+ "^" . <HELP> is a list of item numbers (separated by commas or spaces),
+ showing where you can call the help window from. For instance, the active
+ item is 17, and the user hits "F1". Then the program opens such a window,
+ which has the number 17 given (among others) in parentheses. If no such
+ window is defined, the program does not report any error, but merely
+ gives an acoustic signal (see the definition of "~beep" in para 3.8).
+
+If the parameter <HELP> is present, the parameter <ITEMS> is also optional.
+
+*** <ITEMS> -- a list of item numbers (non-negative integers),
+ corresponding to the item definitions in the window text. The items
+ follow in the same order.
+
+ If there is less numbers than items in the window text, the superfluous
+ items have a number given by the last number in the list ``<ITEMS>''.
+ This implies that more items with the same number can appear without
+ problems. The search algorithm searches only first item with given
+ number. If the list ``<ITEMS>'' is empty then the items are without
+ number (it is possible only in help window).
+
+ If there is more numbers than items, the superfluous numbers are
+ ignored. If the jump to an item with such an ignored number is
+ requested, the window opens, but no item is active there. The key
+ "Enter" gets the same function as the key "Esc", and the arrows work
+ only to the right or to the left (and only under the assumption that
+ the parameter <<L-R>> is defined).
+
+*** [<PARENT>] -- is a number defining the ``parent'' item for the window.
+ If the parameter <PARENT> is given, the program checks, whether the
+ window with the parent item is open, prior to opening of the particular
+ window. If the parent window is not open, the program opens it at
+ first. Thus a tree structure for the menu is given.
+
+*** <<L-R>> -- Two numbers of items, where the program jumps in the case
+ that the left, resp. the right arrow is pressed. The active window is
+ closed before the jump. If the parameter <L-R> is not present, the
+ right/up arrows (as well as the left/down arrows) have the same
+ meaning.
+
+ The parameter <L-R> allows to configure the ``pull-down'' menu, where the
+ left and the right arrows ``switch sub-menus''.
+
+*** "\" -- the presence of this character defines the so-called
+ ``automatic closing window''. If the parameter is present then the
+ window is closed automatic when its ``child window'' is being closed.
+ Poetic expressed, the parent, having given life to a child, cannot live
+ longer than his child.
+
+
+3.6 Window and item texts
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The text following the window-defining line is copied line by line into the
+window, starting immediately with the first line of the window (except the
+local definition "~param"). If the line is longer than the inner width of
+the corresponding window (have the frame in mind!), the rest of the line is
+ignored.
+
+If there are more lines than the inner height of the window, the
+superfluous lines are ignored.
+
+If there are less lines, the window has blank lines in the bottom. Such a
+situation can appear also in the case that the program comes across the end
+of the configuration file, or across a line beginning with the character
+"~" or "^" . Such lines can terminate the copying of the text into the
+window.
+
+Copying of item texts to the window is not standard. The copying starts
+when the character "|", introducing the item text, is first found. This
+character is not copied. If the character "#" resp. "^" resp. "!" follows
+immediately, the item is editable or co called ``auto-run item'' or
+highlighted text is to be set respectively (see para 3.9). Otherwise, the
+text which follows is copied. If the character "^" appears inside an item,
+this character is ignored, and the preceding (attention! not the following)
+character is marked as the highlighted letter. Retyping of the item ends,
+when the closing character "|" is found; this character is not copied.
+
+The item text can be followed by the character "{" (immediately after the
+closing character "|"). Inside the braces, the action in case of the item
+selection is given. This definition (incl. braces) is not copied.
+
+If the carriage return character appears inside the item text, the program
+displays an error massage and terminates.
+
+
+3.7 Definition of the action after the item selection
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The action, which is to be performed after the selection of the item, can be
+defined in braces after the closing character "|" of the item.
+This definitions is composed of some commands separated by commas or
+spaces. There can be no command at all (then the braces can be omitted).
+The list of possible commands is given in the following table:
+
+ command syntax meaning
+ ----------------------------------------------------------------------------
+ $<CODE> program terminates with given error-code number
+ <NUMBER> a ``goto'' command -- jump to the item with number <NUMBER>.
+ If the new item is in a not yet open window, the window
+ is opened (incl. the substructure, if necessary).
+ \ The character \ closes an active window.
+ * Closing of all windows on the screen.
+ "<TEXT>">N If N = 0, <TEXT> is called as a DOS line.
+ If N = 1, an error is reported.
+ If N > 1, <TEXT> is added as the last line into the
+ N-th file.
+ If N is the name of an environment variable, <TEXT> is
+ stored in it.
+ !>N or %>N N is to be greater than 1: reset of the N-th file for
+ writing. The contents of this file (if any) is erased.
+
+REMARKS
+
+*** The ``goto'' command is to be the last one in the action definition. The
+commands are executed in the order from the left to the right, and the
+``goto'' command passes the control to the next item, so that the commands
+given after it are never executed.
+
+*** If there is no ``goto'' command (there is no item to take on the control),
+the program closes all windows and terminates with the code equal to the
+current item number.
+
+*** The command "\" is equivalent to pressing the "Esc" key. If the
+active window is different from the latest opened window, some difficulties
+can appear. Such a situation appears if the programmer of the configuration
+file does not observe the tree menu structure, and without closing the
+windows in question, he jumps somewhere to the middle of the tree
+parent-child structure of windows. Then closing of a window gives automatic
+cause for closing all windows opened later.
+
+*** The commands "*" a "\" need not be separated from the others by a
+space nor by a comma. Thus, the following notations are equivalent and
+cause closing the window and jump to the item number 17:
+
+ {\, 17} or {\ 17} or {\17}
+
+*** Before calling a DOS line by the command "<TEXT>">0 (the ``line
+process calling''), it is senseful to use the command "*". The started
+process could scroll down the screen, and thus also all open windows would
+be scrolled together. The program MNU would then display objects chaotic on
+the screen. A correct example of calling a DOS line follows:
+
+ {* "dir a:">0, 17}
+
+This construction first closes all windows, then executes "dir a:", and
+finally opens again all windows up to the item 17.
+
+*** The command "<TEXT>">N (N greater than 1) only adds a new line to
+the already existing text in the file. If you wish to overwrite the old
+contents of the file, use the command !>N at first.
+
+*** The storing of new value in environment variable is local only during
+the MNU program run. If you can set global value of environment variable
+then you must open the auxiliary batch file and first you must store
+the text "set NAME=value" to this file. After terminating the MNU program
+the calling this auxiliary batch implies the setting "value" to the
+"NAME" globally.
+
+*** Commands "!>N" and %>N both reset the N-th file. The diference is in
+the way of storing the "%" character to the file. The second command
+invokes the special mode of writing to the file---all occurrences of
+characters "%" is duplicated. This is usefull for auxiliarity batches
+mentioned above, because DOS requires the per cent sign to be duplicated
+while batch processing.
+
+*** Once a file is used as an output one, it cannot be used for an input
+any more. A requirement for an input such as "[%N%...]" will return a
+blank string in such case.
+
+*** Strings "<TEXT>" can contain the special character "#". The latest
+edited text is substituted for this character. This way the results of
+editing of items can be passed to the output. See also para 3.9.
+
+
+3.8 Global definitions "~hotkeys", "~start", "~final", "~beep", "~mouse"
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The definition "~hotkeys" is of the form
+
+" ~hotkeys Fn{<REACTION>}, ... "
+
+where n is number of function key (in interval 1 to 10) and <REACTION> is
+a list of commands to be executed if associate function key is pressed.
+The list of commands has the same syntax and semantic as in action after
+the item selection, mentioned above in para 3.7. You can define at the most
+10 ``hot keys'' using the single "~hotkeys" definition line (separated by
+space or comma). If you define the "F1" key by "~hotkeys" definition you
+cannot use the help feasibility of the program MNU but, for example, you can
+call a special and better help program by the ``line process calling''.
+
+The definitions "~start" and "~final" can contain in braces the same
+commands as possible in the item starting action definitions.
+
+*** The definition "~start" introduces a list of commands, that are
+executed when the program starts. It is senseful to use e.g. commands
+"!>N" for the output file reset.
+
+If there is a ``goto'' command in the definition "~start", the program jumps to
+the given item regardless the contents of the environment variable "MNU".
+If there is no ``goto'' command there, the program jumps in agreement with the
+contents of the environment variable "MNU".
+
+*** The definition "~final" introduces a list of commands, that are executed
+when the program terminates without any error, after closing all windows.
+That's why some commands are senseless there. The ``goto'' command, as well
+as the commands "*", "\", are ignored.
+
+When the commands from the definition "~final" are executed, the symbol
+"#" represents the number of the selected item (hexadecimal number as
+text). This information can be saved in an output file.
+
+*** The definition "~beep" is of the form:
+
+ ~beep {<FREQUENCY>, <DURATION>}
+
+where <FREQUENCY> defines the frequency of the sound, and <DURATION>
+is its duration in milliseconds. A sound defined this way beeps always when
+the user hits a key, which the program is not able to interpret. If the
+definition is omitted or if at least one parameter is equal to zero, we get
+no sound (which is often better).
+
+*** In the case that the definition "~mouse" is present with the syntax:
+
+ ~mouse {<REG-CX>, <REG-DX>}
+
+then the mouse cursor is re-coloured in agreement with your wish by calling
+the system service "int 33h" with the registers state: "AX=10", "BX=1",
+"CX=<REG-CX>", "DX=<REG-DX>". If this definition is not present, the
+mouse cursor is red with white ink in any place (the cursor color is not
+changed with changing background colors). This implicit value corresponds
+to the definition "~mouse {255, 20224}".
+
+The five preceding global definitions have to be stated prior to the first
+window-defining line. Otherwise they are ignored.
+
+
+3.9 Editable item, auto-run item and highlighted text in the window
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+AN EDITABLE ITEM is of the form:
+
+ |#<TEXT>|{<ACTION>}
+
+where
+
+*** <TEXT> -- is the text offered for editing.
+
+*** <ACTION> -- is a list of commands to be performed, when the editing
+is terminating by the key "Enter" (see para 3.7). Strings of the type
+"<TEXT>", defined in these commands, can contain the character "#",
+for which the result of editing is substituted. For example,
+
+ "copy # c:">0
+
+means, that the result of editing should be a file name, which is to be
+copied to the disk "c:".
+
+EXAMPLE. The construction
+
+ |#[%FILE%8]|{"set FILE=#">2, \17}
+
+creates an item, offering the contents of the environment variable "FILE"
+(of the length of 8 characters) as the initial text for editing. The text
+"set FILE=" followed by the result of editing is then saved in the file
+number 2. Finally, the window is closed and the program jumps to the item
+number 17.
+
+REMARK. When the item is editable, the closing character "|" is to be
+followed by the character "{"; thus if there is no action defined, it is
+necessary to write: "{}". This difference from non-editable items is
+meaningful: the closing sign of the text to be edited is the pair "|{", so
+that there can appear the character "|" in the offered text. This increases
+the ability of the program to be ``foolproof''. The offered text is
+usually variable -- the result of the last editing. The user would cause
+the program collapse only if he entered the pair "|{" or "[%". Taking into
+account that the user can input from the keyboard about 100 characters, the
+probability of the program collapse due to user's mistake is roughly
+2/10000.
+
+THE AUTO-RUN ITEM is in the form
+
+ |^<TEXT>|{<REACTION>}
+
+where <TEXT> is the text of the item and <REACTION> is definition of
+reaction to be immediately processed. More exactly: the <REACTION> is
+processed in case that the item is highlighted. No "Enter" pressing is
+required. This situation can be occurs in three cases: first, the program
+activates this item as first offered item, second, the item is highlighted by
+``goto'' command, third, the item is highlighted using arrow keys.
+This possibility can be useful for configuring of complicated structures of
+windows.
+
+A HIGHLIGHTED TEXT in the window can be defined in the form:
+
+ |!<TEXT>|{}
+
+The text is displayed in the window colored as an inactive item. In fact,
+it is a common text, no item. To be used if we need a two-color text in
+the window.
+
+Notice that also here the closing pair "|{" is necessary; it has the same
+reason as in the case of an editable item. It is supposed that the
+highlighted text can be variable, for example the value of environment
+variable.
+
+
+4. ERROR MESSAGES AND PROGRAM RESTRICTIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The MNU program performs a syntax check when reading the configuration
+file. About 40 errors can appear there; the program displays an error
+message. It is not necessary to list all the error messages here; e.g. if
+the message reads "'}' expected", we should easy recognize the error.
+Moreover, the program displays the line number in the configuration file,
+where the error has appeared, and the error line is displayed on the screen
+in such a way, that in the place of the error the line is broken, and the rest
+of the line continues one line below.
+
+If the error occurs in another operation than reading the configuration
+file, the error line with its number are not displayed.
+
+Let us discuss only those error messages, that are connected with some
+program restrictions.
+
+"! out of memory"
+The error occurs if, opening more larger windows one over the other, the
+data memory of 64 kB is overflowed. This memory is sufficient for about 7
+simultaneously open windows of a full-screen size, which should be
+satisfactory, because it is senseless to open full-screen windows one over
+the other.
+
+Adding the length of the program and the memory preassumed for its data
+structures, we get 88 kB of the memory, i.e. the space occupied by the
+program in the operation memory. One should be aware of it if calling
+one-line DOS processes when the program resides in the memory.
+
+"! maximal number of open windows is out"
+The maximum number of simultaneously open windows is 25.
+
+"! the head is too long"
+The maximum length of the window heading is 35 characters.
+
+"! max 25 items in one window is allowed"
+The maximum number of items in a window is exceeded. Because there are no
+more lines on the screen and the items should not be arranged in a matrix
+(the program would misinterpret the arrow key control), this limitation is
+not important.
+
+"! the file number in interval 2..9 expected"
+The number of input/output files is limited to 8 (not counting the
+configuration file).
+
+"! stack of input files overflow"
+The maximum number of hierarchically open files (i.e. files, where for a
+construction is substituted another file with a construction, substituted
+by a further file, etc.) is limited to 8.
+
+"! the SIZE parameter is too long"
+The parameter <LENGTH> in the substitution construction is so long that
+the maximum length of the input line, i.e. 255 characters, is exceeded.
+
+
+5. EXAMPLES
+%%%%%%%%%%%
+
+See the file EXAMPLES.DOC
+
+
+6. HISTORY
+%%%%%%%%%%
+
+Euro-TeX-92: The first public version.
+
+* User can select between editable items by up/down arrows. (2.4)
+* The mouse cursor takes the same place as the highlighted item, when the
+ program starts.
+* Hot-keys definitions F1 to F10. (3.8)
+* Explicit error code, when program terminates (the "$" command, 3.7).
+* All items has a number now. If there are more items then length of the
+ list of item numbers, the last number of the list is used. (3.5)
+* Special mode for writing files---duplicating per cent sign. (3.7)
+* Auto-run items. (3.9)
+
+The last change: January 1993.
+
+
diff --git a/support/mnu/mnu.tex b/support/mnu/mnu.tex
new file mode 100644
index 0000000000..396511482d
--- /dev/null
+++ b/support/mnu/mnu.tex
@@ -0,0 +1,1405 @@
+
+% Program MNU -- The Documentation written in plain \TeX
+% ======================================================
+% January 1993 Petr Ol¨ k
+
+\hsize=159.2mm
+\vsize=239.2mm
+\raggedbottom
+
+\font\titl=cmbx10 scaled \magstep2
+\font\bigit=cmti10 scaled \magstep2
+\font\mflogo=logo10 % font for METAFONT logo
+
+\def\CS{$\cal C\kern-.1667em\lower.5ex\hbox{$\cal S$}\kern-.075em $}
+\def\CSTUG{\CS TUG}
+\def\METAFONT{{\mflogo META}\-{\mflogo FONT}}
+\def\LaTeX{L\kern-.36em\raise.5ex\hbox{\sevenrm A}\kern-.12em\TeX}
+
+\def\sect #1\par{\vskip30pt\line{\titl #1\hfil}\nobreak\bigskip}
+
+\def\subsect #1\par{\ifdim\lastskip=\bigskipamount \else\vskip 20pt\fi
+ \line{\bf #1\hfil}\nobreak\medskip}
+
+\catcode`\"=13
+\def"{\hbox\bgroup\let"=\egroup\setverb\tt}
+\def\setverb{\def\do##1{\catcode`##1=12}\dospecials\obeyspaces}
+\def\dd{{\tt\char34}}
+
+\catcode`\<=13
+\def<#1>{\leavevmode\hbox{\rm\it\lowercase{#1}\/}}
+
+%\def \uv#1{\vbox to0pt{\kern-.33ex\hbox{''}\vss}\kern-.1ex#1\kern-.1ex``}
+
+\def\begitems{\medskip\bgroup\catcode`\*=13 \narrower\narrower}
+\def\enditems{\par\egroup\medskip}
+{\catcode`\*=13 \gdef*{\par\noindent\llap{$\bullet$\ }\ignorespaces}}
+
+\def\quest{\medskip\indent\hangindent\parindent
+ \llap{\frame{\bf ?}\kern8pt}\ignorespaces}
+\def\answ{\medskip\indent\hangindent\parindent
+ \llap{\frame{\bf !}\kern8pt}\ignorespaces}
+\def\frame#1{\lower4pt\vbox{\hrule
+ \hbox to14pt{\vrule height10pt depth4pt\hfil #1\hfil\vrule}\hrule}}
+
+\def\bull{\medskip\indent \llap{$\bullet$\ }}
+\def\toa{$\to$}
+\def\m{\hskip1em\relax}
+
+\def\begtt{\par\medskip\bgroup\setverb\catcode`\"=12\obeylines\startverb}
+{\catcode`|=0 \catcode`\\=12 |gdef|startverb#1\endtt{|tt #1|egroup|medskip}}
+{\obeyspaces\gdef {\ }}
+
+% usage: \begtab{width}, width ... the width of right column
+\def\begtab#1{\medskip\line\bgroup\hfil
+ \vbox\bgroup\offinterlineskip
+ \def\title{\vrule height15pt depth8.5pt width0pt\cr
+ \noalign{\hrule} \vrule height15pt width0pt}
+ \def\:{\hfill &&}
+ \hrule\halign\bgroup\vrule##
+ &\vrule height12pt width0pt\hfil\quad##\quad\hfil&&\vrule##
+ &\quad\hbox to #1{\vtop{\hsize=#1\noindent##\unskip\strut}}\quad\cr
+ \vrule height15pt width0pt\relax}
+\def\endtab{\vrule depth9pt width0pt&\cr
+ \egroup\hrule\egroup\hfil\egroup\medskip}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% begin of text
+
+\null\vskip 30pt
+\centerline{\titl Program MNU}
+\bigskip
+\centerline{\titl A configurable menu for starting applications under DOS}
+\bigskip
+\centerline{\bigit Petr Ol\v s\'ak}
+\bigskip
+\centerline{Prague, January 1993}
+\bigskip\hrule\medskip
+
+\sect 1. A brief description
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The program MNU allows, together with its control batch (".bat"),
+repeated starting of various application programs. It has been developed
+for the \TeX\ packages, nonetheless, it can be utilized elsewhere.
+
+The batch "demotex.bat" starts an exhibition of possibilities of the
+program MNU itself. The second batch "demotex.bat" shows a more complicated
+example of configuration of emTeX used in \CS\TeX package. This example
+exhibits possibilities of MNU program itself on the one hand, and of its
+suggested configuration "cfg.mnu" suitable for the emTeX packages with DOS
+on the other hand. These examples are documented in chapter 5.
+
+The documentation is intended for the users, who wish to change the
+existing configuration of the system, where the program is applied, or who
+wish to develop a new one. Therefore some deeper knowledge of DOS is
+assumed, esp. some advanced skills in batch (".bat") programming.
+
+The program keeps up appearances of an integrated environment for starting
+of various processes. This environment is fully configurable, including
+window colours and shapes, names and ways of application of individual menu
+items, context help, etc. The process is controlled by the batch. In a
+definite moment, the batch starts the MNU program with a single parameter --
+the configuration file name (e.g. "cfg.mnu"). The program MNU reads
+a full description of menu structure from this file and displays menu items on
+the screen. Now the user can choose the particular item comfortably. When
+the item is chosen, the program MNU terminates and the control batch
+evaluates the error code corresponding to the respective item. In the
+batch, the chosen item number is determined using a set of "if errorlevel"
+commands, and the batch branches to separate application processes. When
+the application ends, the batch calls the MNU program again, and the user
+can choose a new item, and so on.
+
+The batch can also communicate with the MNU program by means of DOS
+``environment variables'', and of input and/or output files. The program can
+display and edit the content of these variables (if this is given in the
+configuration file). Moreover, there exists a special environment variable
+called ``MNU'' influencing the start of the program -- the item specified
+in this variable is offered as active when the program starts. Seeing that,
+the user does not need to choose tediously the next item, provided his
+activity proceeds in the ``normal'' sequence. For example, after the
+\TeX\ program run it is possible for the batch to examine (using the "if
+errorlevel" command) whether the translation ended without errors. If so,
+then the variable ``MNU'' can be set in such a way that the item "View" is
+active in the next call of the menu. In the menu environment, the user can
+do nothing but "Enter" pressing.
+
+The advantage of this ``batch'' philosophy is that the MNU program does not
+occupy the memory during the application run. Furthermore, concerning the
+system configuration, there are practically no limitations on variability
+in setting the behaviour of particular processes. The only limitations are
+due to the DOS itself. Only a batch allows to express all configuration
+possibilities of separate application programs.
+
+\medskip
+The list of files contained in the MNU program package is given in the
+following table:
+
+\begtab{25em}
+& "readme.txt" \: Basic information about the program &\cr
+& "mnu.doc" \: Detailed documentation of the program &\cr
+& "examples.doc" \: Description of some tricks used in the batches &\cr
+& "mnu.tex" \: Contents of three previous files in plain \TeX\ --
+ this text &\cr
+& "mnu.exe" \: The MNU program itself &\cr
+& "demo.bat", "demo.mnu" \: A simple example of program MNU possibilities &\cr
+& "demotex.bat", "cfg.mnu", \: &\cr
+& "sorry.mnu", "*.bat" \: A more complicated example of em\TeX
+ configuration &\cr
+& "totext.exe", "totext.c" \: Switches the screen to the text mode
+ $80 \times 25$ &\cr
+& "dupcent.exe", "dupcent.c" \: Duplicates {\tt\char37} (utility program)
+ &\cr
+& "kalk.exe", "kalk.hlp" \: The calculator -- an illustration of an
+ application program
+\endtab
+
+\medskip
+The software contained in the files listed above is in the public domain.
+The author transfers it to the \CSTUG\ association (Czechoslovak
+\TeX Users Group) and expects that they will care about its popularization
+and further distribution. It is not allowed to utilize these programs
+and/or their modifications for commercial purposes. That means, it is not
+allowed to sell this software (with the exception of a diskette copying
+fee), nor to include it in systems designed merely for commercial purposes.
+
+Since of the first public distribution of this product (Euro-\TeX\ 92)
+some unimportant improvements were made. This changes keep full
+compatibility with the old configuration files and offers some new
+possibilities (see the end of the documentation).
+
+The author will not more change or improve this software, esp.\ its basic
+conception. However, he welcomes all suggestions leading to elimination of
+errors, which can, unfortunately, appear in any software.
+
+The source code of the MNU program (written in C language) is not public.
+
+\medskip
+\noindent\halign{\bf #\hfil &\quad #\hfil\cr
+address: & Petr Ol\v s\'ak \cr
+ & Department of Mathematics \cr
+ & Faculty of Electrical Engineering \cr
+ & Czech Technical University \cr
+ & $\underline{\strut \hbox{166 27 PRAGUE}}$ \cr
+ & Czech republic \cr
+ & \cr
+email: & {\tt\char60}"olsak@csearn.bitnet>" \cr}
+
+
+\sect 2. Description of the program
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsect 2.1 Start of the program
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The MNU program operates in the $80 \times 25$ text screen mode. If
+the screen is switched to another mode, the program can display incorrectly.
+In that case, it is recommended first to call the program "totext.exe",
+which redefines the screen mode.
+
+In the text mode, the MNU program does not depend on the way, how
+nonstandard ASCII characters (national specialities) are represented. All
+displayed texts are being read from the configuration file, which is to be
+prepared in agreement with the implemented coding. The correct display of
+national characters is not a part of the program, so that other technical
+means are to be used.
+
+The program is to be called with at least one parameter---the name of the
+configuration file (incl. the path if necessary). The other parameters are
+optional. These are the names of input and/or output files, and the program
+can use them following the commands from the configuration file.
+
+If the program is started without any parameter, it displays an error
+message, and terminates returning the error code 255. The same occurs if the
+configuration file cannot be opened for reading.
+
+A rule: Whenever the program terminates because of any error, an error
+message is displayed and the error code 255 is returned.
+
+
+\subsect 2.2 Data in the configuration file
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The following data are read from the configuration file:
+
+\begitems
+
+ * Item texts
+ * Highlighted letters in item texts
+ * Item numbers---each item is assigned a number (a positive integer)
+ * Program action after choosing each item
+ * Item sequence in each window
+ * Structure of mutual calling of items
+ * Type of items (editable or non-editable)
+ * Explanatory texts in the windows
+ * Window sizes and their allocation on the screen
+ * All necessary colour attributes
+ * Help texts and their relation to individual items
+ * Sizes, allocations and colours of help windows
+ * Way of communication with the outer environment (input/output files,
+ environment variables)
+ * The hot keys definition
+
+\enditems
+
+There is a lot of other information in the configuration file. For more
+details see para 3.
+
+\subsect 2.3 Starting item
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+When started, the MNU program presents the item, the number of which
+corresponds with the content of the environment variable ``MNU''.
+
+An example of calling the MNU program:
+\begtt
+ set MNU=17
+ mnu config.mnu
+\endtt
+
+In this case, the item with number 17 is presented when the MNU program is
+started. (We suppose that such an item is defined in the file
+"config.mnu".)
+
+If the starting item belongs to a partial sub-menu involved in the
+mutual linkage of windows and items, all ``parent'' windows are opened
+automatically before the window with the particular item is opened.
+
+If the environment variable ``MNU'' does not exist or if its content is not
+of the type integer, it is considered as having the value zero.
+
+If there is no item defined with the number equal to the content of the MNU
+variable in the configuration file, the program displays an error message
+and is terminated.
+
+
+\subsect 2.4 Selection of the item from the keyboard
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Within a window, the user switches the active item by arrows. Pull down
+menus are the exception -- left/right arrows cause a jump to the
+neighbouring window there (this is to be defined precisely in the configuration
+file).
+
+The key "Esc" returns the selection process to the ``parent'' window. If
+there is no such window (the active window is the ``root'' of the
+structure), then the program finds the item corresponding to the number 0.
+In the case such an item is not defined the program is terminated and the
+control is returned to DOS with the code 0. If the item exists, the program
+opens the corresponding window and offers this item as active. This
+procedure allows to configure the window with the last question of the type
+``Do you really want to finish?'', when the item with number 0 can contain
+the text ``Yes''.
+
+\medskip
+There are three possibilities of the "Enter" key reactions:
+
+\begitems
+
+ * The next window with items opens. More precisely: the specified item in
+ the next ``child window'' is offered as active.
+ * The program terminates its operation, closes all open windows, and
+ returns the error code equal to the number of the selected item. If the
+ item number is greater than 254, the programs returns the code 255.
+ * The program calls the process defined by a single DOS line (so-called
+ line process calling). In this case, the program resides in the computer
+ memory, calls the process required, and at the end of this process offers
+ the next specified item as active.
+
+\enditems
+
+The way of the "Enter" key reaction is defined in the configuration file.
+
+A special type is the so-called ``editable'' item. It allows to do a line
+editing right in the place of the item. The result of this editing is
+stored in a special buffer for later utilization in the ``line process
+calling'' or for including into output files. This way, it is possible to
+change the content of DOS environment variables, arrange parameters for a
+line process, etc.
+
+The built-in item editor works in the ``insert'' mode only. The keys "Del",
+"Backspace" and right/left arrows work as usual. If the first pressed key
+is an arrow key, the offered text is edited. Otherwise, the original text
+disappears and a new text can be entered. The "Esc" key returns to the
+original text, the "Enter" key keeps new text in the buffer and starts the
+``item actions'' defined in the configuration file. If the editation process
+does not begin the up/down keys can be used to select the required editable
+item else up/down keys does not work because it is not specified whether
+to confirm ("Enter") or to cancel ("Esc") of the edited text.
+
+The "F1" key calls the help corresponding to the active item. The help
+windows are configured in the configuration file, and they can contain,
+in any place, further items (highlighted notions), which allow jumping to other
+help windows. Thus, a structured help can be defined. The "Esc" key quits
+the help. In the case that the help window does not contain any item, the
+"Enter" key has the same meaning as the "Esc" key.
+
+If there is a ``highlighted letter'' defined in the item, the item can be
+selected by simple touching the key with this letter. The program reaction
+is the same as when arrows and the "Enter" key are used.
+
+In the case of any inconsistency in the configuration file (e.g. the number of
+the consequential item cannot be found) the error message occurs and the
+program terminates.
+
+\subsect 2.5 Selection of the item by the mouse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+If the mouse driver is installed, the mouse cursor appears on the screen.
+Pressing the left mouse button causes the selection of the item under the
+cursor (the same function as "Enter"). Pressing the same button outside the
+window acts similarly as "Esc", i.e. the last opened window is closed. The
+right button calls and cancels the help. The middle button has no function.
+
+The program was tested with the ``Genius mouse'' only. It is possible that
+other mice could disobey (e.g. the Mickey mouse).
+
+
+\sect 3. Format of the configuration file
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Inspect the content of the file "demo.mnu" or "cfg.mnu". It can serve as an
+illustrative example. The following text may be difficult to understand
+without parallel keeping the content of that file in view.
+
+
+\subsect 3.1 The basic structure
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The whole configuration file divides into sections, where attributes and
+make-ups of individual windows are defined. Such a section begins with the
+character "^" in the first column of the first line. We call this line a
+``window-defining line''. The window-defining line is followed
+(optionally) by the definition "~param", which is local for the
+particular window. The text to be displayed in the window follows. In this
+text, individual items, incl. corresponding program actions after a selection
+of any of them, are given. The end of the section is in the place of a new
+window-defining line, or (not very often) of a global definition
+"~param".
+
+Prior to the first window-defining line, there may be arbitrary text
+(comment lines), and, next to it, global definitions "~param", "~start",
+"~final", "~hotkeys", "~sound", and "~copy". These definitions are written
+on separate lines introduced with the character~"~".
+
+Accordingly, the structure of the configuration file is as follows:
+\begtt
+ comment lines (optional)
+ ~global definitions (optional)
+ ^the first window-defining line
+ ~param -- parameters for the first window
+ text of the window incl. description of items and actions
+ ~param -- global parameters (optional)
+ other comments (optional)
+ ^the second window define line
+ ... etc.
+\endtt
+
+The text of the window may exceed number of lines of the window. The
+exceeding lines (in the bottom) are ignored. It is possible to use them for
+further comments.
+
+It is not recommended to utilize this place for larger comments. The program
+searches data from the configuration file sequentially (line by line), so
+that extensive comments could result in a slow-down of the program execution.
+It is sensible to locate definitions of more frequent windows at the
+beginning. For instance, it is advisable to put helps at the end of the
+file.
+
+\subsect 3.2 Active characters
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Active are those characters that mark off the structure of the
+configuration file. The other characters are usually to be displayed in a
+window, or they serve as a comment.
+
+Most of the characters are active only under some conditions. For instance,
+the character "~" is active only if in the first column. In another place
+it is interpreted as any other text character.
+
+The following table gives the list of the active characters:
+
+\begtab{16em}
+& Character && Condition && Meaning & \title
+& "^" && in the first column && window-defining line &\cr
+& "~" && in the first column && global or local definition &\cr
+& "|" && anywhere in the text of the window && marks off the beginning
+and/or the end of the item &\cr
+& "#" && immediate following the~character~"|" opening an item
+ && this item is editable &\cr
+& "^" && immediate following the~character~"|" opening an item
+ && this item is ``auto-run item'' &\cr
+& "!" && immediate following the~character~"|" opening an item
+ && marks the highlighted text &\cr
+& "^" && inside an item && marks the highlighted letter &\cr
+& "{" && immediate following the~character~"|" closing an item
+ && the action after the item selection is
+ defined and close in braces &\cr
+& "[%" && in any place && introduces the requirement for a text
+ substitution
+\endtab
+
+This table implies several restrictions on the window texts:
+
+\begitems
+ * No ``common'' line can begin with the characters "~" or "^" .
+ * The character "|" cannot be included in the window text. If necessary,
+ the~character~\vrule\ with the extended ASCII code 179 can be used.
+ * Inside an item it is impossible to type the character "^" .
+ * In the whole configuration file you cannot use the pair "[%" -- this
+ starts an requirement for a text substitution anywhere.
+ * The text of a non-editable item cannot begin with the characters "!" or
+ "#"~.
+\enditems
+
+The active characters were chosen so as to minimize the restrictions.
+
+\subsect 3.3 Requirements for text substitutions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Anywhere in the text of the configuration file, the following construction
+can appear:
+
+\medskip
+
+\indent "[%<NAME>%<LENGTH>]", where the parameter <LENGTH> is optional.
+\medskip
+
+This construction is substituted by the content of the environment variable
+<NAME>. The length of the corresponding string counts <LENGTH>. It means that
+the superfluous characters (to the right) are omitted, if the content is
+longer, or the string is completed with blank characters, if the content is
+shorter. If the parameter <LENGTH> is not given, the length of the
+corresponding string is set equal to the length of the content of the
+environment variable.
+
+\medskip
+There is another possibility of a text substitution---to substitute a text
+from another file. That construction is of the form
+"[%<N>% <X>, <Y>, <LENGTH>]". The text from the ``<N>-th file'' is
+substituted for this construction. The <N>-th file is that given as the
+<N>-th parameter in the command line of the MNU program call.
+
+Further, <Y> is the line number, and <X> the column number of the position
+in the file, where the text is to be read from, and <LENGTH> is the length of
+the resulting string. The text is being read only from the indicated line,
+and is, if necessary, completed with blank characters to the right. If <LENGTH> =
+is 0, then the length of the resulting string is equal to the length of the
+<Y>-th line in the file (or of its part if $<X> > 1$).
+
+The parameter <LENGTH> is the only optional one; if it is not present, the
+program reads the file from the position <X>, <Y> to the end of file (more
+than only one line can be read).
+
+{\bf Examples.} We suppose the program to be called in the following
+situation:
+
+\begtt
+ set ENVIN=babble
+ mnu config.mnu myfile.txt
+\endtt
+
+and that the file "myfile.txt" contains the following two lines:
+
+\begtt
+ experimental text
+ in two lines containing [%ENVIN%]
+\endtt
+
+In the following table the reader can find various examples:
+
+\begtab{20em}
+& construction && result & \title
+& "[%ENVIN%3] " && "bab" &\cr
+& "[%ENVIN%] " && "babble" &\cr
+& "[%2% 1, 1, 5] " && "exper" &\cr
+& "[%2% 10, 1, 9]" && "tal text " &\cr
+& "[%2% 1, 1] " && "experimental text "\hfil\break
+ "in two lines containing babble" &\cr
+& "[%2% 14, 2, 0]" && "containing babble"
+\endtab
+
+If the environment variable does not exist, the result of the construction
+is blank. The program does not report any error at that moment. For
+example, "[%%80]" means 80 spaces.
+Similarly, if the file cannot be opened for reading, the result of the
+construction is blank.
+
+For security reasons, the program does not allow any construction including a
+call of the file with the numbers 0 or 1 (the configuration file calls itself).
+
+The input files can contain the next requirements for text substitution.
+A never-ending recursive call of files is treated (for security) in such a
+way, that during the eighth attempt to open a new file the program displays
+an error (stack overflow), or an attempt to open a file for reading fails
+(number of open files is limited in DOS).
+
+If the text substitution construction calls a file containing
+other defining lines in its text, then such a construction is to be
+situated at the beginning of a line. The program reads only first
+characters on each line when scanning the definitions, and does not waste
+time with substitutions required in the middle of lines. Such substitutions
+are accomplished only when the program needs to read the whole line or the
+text of the window.
+
+\medskip
+If the global definition "~copy" precedes the first defining line, then all
+lines of the configuration file following this line are copied at the
+screen. The definition "~copy" does not contain parameters, so that its
+format is simply "~copy".
+
+When copying (by "~copy"), text substitutions are performed in agreement
+with the above rules. The MNU program finishes its activity when copying
+has been accomplished. That means that the definition "~copy" switches the
+program into a special mode, when no commands or definitions of the
+configuration file are performed, and no items or windows are treated. Only
+the character pair "[%" is active there.
+
+Such copying is reasonable particularly when the output is directed not to
+the screen, but into a file. This can be reached by an easy command:
+
+\begtt
+ mnu input next input > output
+\endtt
+
+\noindent A utilization of this program mode is possible for making
+installation batches and environment handling.
+
+
+{\catcode`\~=12
+\subsect 3.4 Definition "~param"
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+}
+The definition begins with the character "~", and its format is as follows:
+
+\begtt
+ ~param {<NUMBERS>} "<HEAD>" ; <COMMENT>
+\endtt
+
+The parameters \dd<HEAD>\dd\ and "; <COMMENT>" are optional.
+
+\bull <NUMBERS> -- are integers separated by spaces or
+commas. These numbers are arranged in the order
+
+\begtt
+ {<XMIN>, <YMIN>, <WIDTH>, <HEIGHT>, <FRAME>, <GROUND>, <ITEM>, <LETTER>, <A-ITEM>, <A-LETTER>}
+\endtt
+
+\noindent and their meaning is as follows:
+
+{\narrower\parindent=0pt
+<XMIN>, <YMIN> -- x and y coordinates of the upper left corner of the
+window (incl. the frame if exists)
+
+<WIDTH>, <HEIGHT> -- window width and height (incl. the frame)
+
+<FRAME> -- 0 : no frame, 1 : a simple frame, 2 : a double frame
+
+<GROUND> -- basic text color attribute for the window (0~to~255)
+
+<ITEM> -- text color attribute of inactive items for the window
+
+<LETTER> -- highlighted letter color attribute for inactive items
+
+<A-ITEM>, <A-LETTER> -- similar as <ITEM>, <LETTER>, but for active items
+
+}
+\medskip
+
+If less than 10 parameters are given, the other parameters to the right
+keep their global or implicit values. If more than 10 numbers are given,
+the superfluous numbers (to the right) are ignored.
+
+The wildcard "*" used instead of a parameter leaves the parameter unchanged
+with the global or implicit value.
+
+\bull <HEAD> -- text (heading) to overwrite the middle of the window frame
+top line. When not present, the frame is not interrupted.
+
+\bull <COMMENT> -- the text separated by a semicolon is ignored.
+\medskip
+
+A global definition "~param" is valid for all windows until another global
+definition "~param" appears. More exactly, the next global definition
+"~param" overwrites some (or all) parameters of window defined here.
+
+On the other hand, a local definition "~param" influences parameters (all
+or some of them) only for the particular window.
+
+If neither global nor local definition determine the parameters, they keep
+their values predetermined as follows:
+
+\begtt
+ ~param {10, 5, 62, 17, 1, 31, 30, 30, 14, 14}
+\endtt
+
+i.e. a blue window approximately in the middle of the screen with a simple
+frame and yellow items.
+
+
+\subsect 3.5 Window-defining line
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+is of the form
+
+\medskip\noindent
+" ^(<HELP>) <ITEMS> [<PARENT>] "{\tt\char60}"<L-R>> \ ; <COMMENT>"
+\medskip
+
+The types of parameters are identified by the shape of the brackets. The order
+of the parameters cannot be changed.
+
+All parameters (incl. brackets), with the only exception of the parameter
+<ITEMS>, are optional; the shortest window definition is of the form:
+"^ <ITEMS>".
+
+\bull "("<HELP>")" -- if this parameter is present, a window for help is defined.
+ Be aware: The left parenthesis should immediately follow the character
+ "^" . <HELP> is a list of item numbers (separated by commas or spaces),
+ showing where you can call the help window from. For instance, the active
+ item is 17, and the user hits "F1". Then the program opens such a window,
+ which has the number 17 given (among others) in parentheses. If no such
+ window is defined, the program does not report any error, but merely
+ gives an acoustic signal (see the definition of "~beep" in para 3.8).
+
+If the parameter <HELP> is present, the parameter <ITEMS> is also optional.
+
+\bull <ITEMS> -- a list of item numbers (non-negative integers),
+corresponding to the item definitions in the window text. The items follow
+in the same order.
+
+If there is less numbers than items in the window text, the superfluous
+items have a number given by the last number in the list ``<ITEMS>''.
+This implies that more items with the same number can appear without
+problems. The search algorithm searches only first item with given number.
+If the list ``<ITEMS>'' is empty then the items are without
+number (it is possible only in help window).
+
+If there is more numbers than items, the superfluous numbers are ignored.
+If the jump to an item with such an ignored number is requested, the window
+opens, but no item is active there. The key "Enter" gets the same function
+as the key "Esc", and the arrows work only to the right or to the left (and
+only under the assumption that the parameter <L-R> is defined).
+
+\bull "["<PARENT>"]" -- is a number defining the ``parent'' item for the
+window. If the parameter <PARENT> is given, the program checks, whether the
+window with the parent item is open, prior to opening of the particular
+window. If the parent window is not open, the program opens it at first.
+Thus a tree structure for the menu is given.
+
+\bull {\tt\char60}<L-R>">" -- Two numbers of items, where the program jumps
+in the case that the left, resp. the right arrow is pressed. The active
+window is closed before the jump. If the parameter <L-R> is not present,
+the right/up arrows (as well as the left/down arrows) have the same
+meaning.
+
+The parameter <L-R> allows to configure the ``pull-down'' menu, where the
+left and the right arrows ``switch sub-menus''.
+
+\bull "\" -- the presence of this character defines the so-called
+``automatic closing window''. If the parameter is present then the
+window is closed automatic when its ``child window'' is being closed.
+Poetic expressed, the parent, having given life to a child, cannot live
+longer than his child.
+
+
+\subsect 3.6 Window and item texts
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The text following the window-defining line is copied line by line into the
+window, starting immediately with the first line of the window (except the
+local definition "~param"). If the line is longer than the inner width of
+the corresponding window (have the frame in mind!), the rest of the line is
+ignored.
+
+If there are more lines than the inner height of the window, the
+superfluous lines are ignored.
+
+If there are less lines, the window has blank lines in the bottom. Such a
+situation can appear also in the case that the program comes across the end
+of the configuration file, or across a line beginning with the character
+ "~" or "^" . Such lines can terminate the copying of the text into the
+window.
+
+Copying of item texts to the window is not standard. The copying starts
+when the character "|", introducing the item text, is first found. This
+character is not copied. If the character "#" resp. "^" resp.~"!" follows
+immediately, the item is editable or co called ``auto-run item'' or
+highlighted text is to be set respectively (see para 3.9). Otherwise, the
+text which follows is copied. If the character "^" appears inside an item,
+this character is ignored, and the preceding (attention! not the following)
+character is marked as the highlighted letter. Retyping of the item ends,
+when the closing character "|" is found; this character is not copied.
+
+The item text can be followed by the character "{" (immediately after the
+closing character "|"). Inside the braces, the action in case of the item
+selection is given. This definition (incl. braces) is not copied.
+
+If the carriage return character appears inside the item text, the program
+displays an error massage and terminates.
+
+
+
+\subsect 3.7 Definition of the action after the item selection
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The action, which is to be performed after the selection of the item, can be
+defined in braces after the closing character "|" of the item.
+This definitions is composed of some commands separated by commas or
+spaces. There can be no command at all (then the braces can be omitted).
+The list of possible commands is given in the following table:
+
+\begtab{26em}
+& command syntax && meaning & \title
+& "$"<CODE> && program terminates with given error-code number &\cr
+& <NUMBER> && a ``goto'' command -- jump to the item with number
+<NUMBER>. If the new item is in a not yet open window, the window is opened
+(incl.~the substructure, if necessary). &\cr
+& "\" && The character "\" closes an active window. &\cr
+& "*" && Closing of all windows on the screen. &\cr
+& \dd<TEXT>\dd">"<N>
+ && If $<N> = 0$, <TEXT> is called as a DOS line. \hfil\break
+ If $<N> = 1$, an error is reported.\hfil\break
+ If $<N> > 1$, <TEXT> is added as the last line into the <N>-th file.
+ \hfil\break
+ If <N> is the name of an environment variable, <TEXT> is stored in
+ it. &\cr
+& "!><N>" or {\tt\char37><N>} && <N> is to be $\null > 1$: reset of the
+<N>-th file for writing. The contents of this file (if any) is erased.
+\endtab
+
+{\bf Remarks.}
+
+\bull The ``goto'' command is to be the last one in the action definition. The
+commands are executed in the order from the left to the right, and the ``goto''
+command passes the control to the next item, so that the commands given
+after it are never executed.
+
+\bull If there is no ``goto'' command (there is no item to take on the control),
+the program closes all windows and terminates with the code equal to the
+current item number.
+
+\bull The command "\" is equivalent to pressing the "Esc" key. If the
+active window is different from the latest opened window, some difficulties
+can appear. Such a situation appears if the programmer of the configuration
+file does not observe the tree menu structure, and without closing the
+windows in question, he jumps somewhere to the middle of the tree
+parent-child structure of windows. Then closing of a window gives automatic
+cause for closing all windows opened later.
+
+\bull The commands "*" a "\" need not be separated from the others by a
+space nor by a comma. Thus, the following notations are equivalent and
+cause closing the window and jump to the item number 17:
+
+\nobreak\medskip\noindent
+" {\, 17} " or " {\ 17} " or " {\17}"
+
+\bull Before calling a DOS line by the command \dd<TEXT>\dd">0" (the ``line
+process calling''), it is senseful to use the command "*". The started
+process could scroll down the screen, and thus also all open windows would
+be scrolled together. The program MNU would then display objects chaotic on
+the screen. A correct example of calling a DOS line follows:
+
+\begtt
+ {*"dir a:">0, 17}
+\endtt
+
+This construction first closes all windows, then executes "dir a:", and
+finally opens again all windows up to the item 17.
+
+\bull The command \dd<TEXT>\dd"><N>" ($<N> > 1$) only adds a new line to
+the already existing text in the file. If you wish to overwrite the old
+contents of the file, use the command "!><N>" at first.
+
+\bull The storing of new value in environment variable is local only during
+the MNU program run. If you can set global value of environment variable
+then you must open the auxiliary batch file and first you must store
+the text "set NAME=value" to this file. After terminating the MNU program
+the calling this auxiliary batch implies the setting "value" to the
+"NAME" globally.
+
+\bull Commands "!><N>" and {\tt\char37><N>} both reset the <N>-th file. The
+difference is in the way of storing the {\tt\char37} character to the file.
+The second command invokes the special mode of writing to the file---all
+occurrences of characters {\tt\char37} is duplicated. This is useful for
+auxiliary batches mentioned above because DOS requires the per cent sign
+to be duplicated while batch processing.
+
+\bull Once a file is used as an output one, it cannot be used for an input
+any more. A requirement for an input such as "[%<N>%...]" will return a
+blank string in such case.
+
+\bull Strings \dd<TEXT>\dd\ can contain the special character "#". The
+latest edited text is substituted for this character. This way the results
+of editing of items can be passed to the output. See also para 3.9.
+
+
+{\catcode`\~=12
+\subsect 3.8 Global definitions "~hotkeys", "~start", "~final", "~beep", "~mouse"
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+}
+The definition "~hotkeys" is of the form
+
+\medskip
+" ~hotkeys F<n>{<REACTION>}, ... "
+\medskip
+\noindent
+where <N> is number of function key (in interval 1 to 10) and <REACTION> is
+a list of commands to be executed if associate function key is pressed.
+The list of commands has the same syntax and semantic as in action after
+the item selection, mentioned above in para 3.7. You can define at the most
+10 ``hot keys'' using the single "~hotkeys" definition line (separated by
+space or comma). If you define the "F1" key by "~hotkeys" definition you
+cannot use the help feasibility of the program MNU but for example, you can
+call a special and better help program by the ``line process calling''.
+
+\medskip
+The definitions "~start" and "~final" can contain in braces the same
+commands as possible in the item starting action definitions.
+
+\bull
+The definition "~start" introduces a list of commands, that are executed
+when the program starts. It is senseful to use e.g. commands
+ "!><N>" for the output file reset.
+
+If there is a ``goto'' command in the definition "~start", the program jumps to
+the given item regardless the contents of the environment variable "MNU".
+If there is no ``goto'' command there, the program jumps in agreement with the
+contents of the environment variable "MNU".
+
+\bull
+The definition "~final" introduces a list of commands, that are executed
+when the program terminates without any error, after closing all windows.
+That's why some commands are senseless there. The ``goto'' command, as well
+as the commands "*", "\", are ignored.
+
+When the commands from the definition "~final" are executed, the symbol
+"#" represents the number of the selected item (hexadecimal number as
+text). This information can be saved in an output file.
+
+\bull
+The definition "~beep" is of the form:
+
+\begtt
+ ~beep {<FREQUENCY>, <DURATION>}
+\endtt
+
+\noindent
+where <FREQUENCY> defines the frequency of the sound, and <DURATION>
+is its duration in~milliseconds. A sound defined this way beeps always when
+the user hits a key, which the program is not able to interpret. If the
+definition is omitted or if at least one parameter is equal to zero, we get
+no sound (which is often better).
+
+\bull In the case that the definition "~mouse" is present with the syntax:
+
+\begtt
+ ~mouse {<REG-CX>, <REG-DX>}
+\endtt
+
+\noindent
+then the mouse cursor is re-coloured in agreement with your wish by calling
+the system service\m
+"int 33h"\m with the registers state:\m "AX=10", "BX=1", "CX=<REG-CX>",
+"DX=<REG-DX>".\m If this definition is not present, the mouse cursor is red
+with white ink in any place (the cursor color is not changed with
+changing background colors). This implicit value corresponds to the
+definition \m
+"~mouse {255, 20224}".
+
+\medskip
+The five preceding global definitions have to be stated prior to the first
+window-defining line. Otherwise they are ignored.
+
+\subsect 3.9 Editable item, auto-run item and highlighted text in the window
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+An editable item is of the form:
+
+\begtt
+ |#<TEXT>|{<ACTION>}
+\endtt
+
+where
+
+\bull <TEXT> -- is the text offered for editing.
+
+\bull <ACTION> -- is a list of commands to be performed, when the editing
+is terminating by the key "Enter" (see para 3.7). Strings of the type
+\dd<text>\dd, defined in these commands, can contain the character "#",
+for which the result of editing is substituted. For example,
+\dd"copy # c:"\dd">0"
+means, that the result of editing should be a file name, which is to be
+copied to the disk "c:".
+
+\medskip
+\vbox{
+{\bf Example.} The construction
+\begtt
+ |#[%FILE%8]|{"set FILE=#">2, \17}
+\endtt
+
+creates an item, offering the contents of the environment variable "FILE"
+(of the length of 8 characters) as the initial text for editing. The text\m
+"set FILE="\m followed by the result of editing is then saved in the file
+number 2. Finally, the window is closed and the program jumps to the item
+number 17.}
+
+Remark. When the item is editable, the closing character "|" is to be
+followed by the character "{"; thus if there is no action defined, it is
+necessary to write: "{}". This difference from non-editable items is
+meaningful: the closing sign of the text to be edited is the pair "|{", so
+that there can appear the character "|" in the offered text. This increases
+the ability of the program to be ``foolproof''. The offered text is
+usually variable -- the result of the last editing. The user would cause
+the program collapse only if he entered the pair "|{" or "[%". Taking into
+account that the user can input from the keyboard about 100 characters, the
+probability of the program collapse due to user's mistake is roughly
+2/10000.
+
+\medskip
+{\bf The auto-run item} is in the form
+
+\begtt
+ |^<TEXT>|{<REACTION>}
+\endtt
+\noindent
+where <TEXT> is the text of the item and <REACTION> is definition of
+reaction to be immediately processed. More exactly: the <REACTION> is
+processed in case that the item is highlighted. No "Enter" pressing is
+required. This situation can be occurs in three cases: first, the program
+activates this item as first offered item, second, the item is highlighted by
+``goto'' command, third, the item is highlighted using arrow keys.
+This possibility can be useful for configuring of complicated structures of
+windows.
+
+\medskip
+{\bf A highlighted text} in the window can be defined in the form:
+
+\begtt
+ |!<TEXT>|{}
+\endtt
+
+The text is displayed in the window colored as an inactive item. In fact,
+it is a common text, no item. To be used if we need a two-color text in
+the window.
+
+Notice that also here the closing pair "|{" is necessary; it has the same
+reason as in the case of an editable item. It is supposed that the
+highlighted text can be variable, for example the value of environment
+variable.
+
+
+\sect 4. Error messages and program restrictions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The MNU program performs a syntax check when reading the configuration
+file. About 40 errors can appear there; the program displays an error
+message. It is not necessary to list all the error messages here; e.g.~if
+the message reads\m "'}' expected"\m, we should easy recognize the error.
+Moreover, the program displays the line number in the configuration file,
+where the error has appeared, and the error line is displayed on the screen
+in such a way, that in the place of the error the line is broken, and the rest
+of the line continues one line below.
+
+If the error occurs in another operation than reading the configuration
+file, the error line with its number are not displayed.
+
+\medskip
+Let us discuss only those error messages, that are connected with some
+program restrictions.
+
+\bull
+"! out of memory"\m
+The error occurs if, opening more larger windows one over the other, the
+data memory of 64 kB is overflowed. This memory is sufficient for about 7
+simultaneously open windows of a full-screen size, which should be
+satisfactory, because it is senseless to open full-screen windows one over
+the other.
+
+Adding the length of the program and the memory preassumed for its data
+structures, we get 88 kB of the memory, i.e.~the space occupied by the
+program in the operation memory. One should be aware of it if calling
+one-line DOS processes when the program resides in the memory.
+
+\bull
+"! maximal number of open windows is out"\m
+The maximum number of simultaneously opened windows is 25.
+
+\bull
+"! the head is too long"\m
+The maximum length of the window heading is 35 characters.
+
+\bull
+"! max 25 items in one window is allowed"\m
+The maximum number of items in a window is exceeded. Because there are no
+more lines on the screen and the items should not be arranged in a matrix
+(the program would misinterpret the arrow key control), this limitation is
+not important.
+
+\bull
+"! the file number in interval 2..9 expected"\m
+The number of input/output files is limited to 8 (not counting the
+configuration file).
+
+\bull
+"! stack of input files overflow"\m
+The maximum number of hierarchically open files (i.e.~files, where for a
+construction is substituted another file with a construction, substituted
+by a further file, etc.) is limited to 8.
+
+\bull
+"! the SIZE parameter is too long"\m
+The parameter <LENGTH> in the substitution construction is so long that
+the maximum length of the input line, i.e.~255 characters, is exceeded.
+
+
+\sect 5. Examples
+%%%%%%%%%%%%%%%%%
+
+In the demo batches you can find some methods and tricks used with the MNU
+program. There are two examples.
+
+
+\subsect 5.1 The first simple example
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The first example shows a basic MNU program principles. This example
+describes not really application, but the basic principles of program MNU
+is clearly shown.
+
+The files used in the example are listed in the following table:
+
+\begtab{20em}
+& "demo.bat " \: The control batch &\cr
+& "demo.mnu " \: The configuration file &\cr
+& "envir.bat" \: The auxiliary batch (it will be created)
+\endtab
+
+\noindent{\bf Remarks}
+
+\bull The batch "demo.bat" controls the main loop of application processes.
+After terminating the MNU program the batch branches next executing by set
+of commands
+
+\begtt
+ if errorlevel ... goto ...
+\endtt
+\noindent
+One should have in mind that these "if errorlevel" commands must have a
+decreasing order of constants ("if errorlevel" does mean ``if errorcode is
+greater or equal to'').
+
+\bull Instead of the really application calls there are the "echo" commands
+in the control batch "demo.bat" only. You can remove this word ("echo") and
+write the really applications.
+
+\bull If the user changes the file name (value of the "FILE" environment
+variable), the program MNU writes the line
+
+\begtt
+ set FILE=<newname>
+\endtt
+\noindent
+into the file "envir.bat" (see file "demo.mnu", line 26). After terminating
+of the MNU program the control batch "demo.bat" calls this auxiliary batch
+(see line 44 in "demo.bat"). This is a way to set new value to environment
+variable globally.
+
+\bull The MNU variable is set to the probably next used item number after
+each applications. So that the user can press only the "Enter" key repeatedly
+to make the loop "Edit"---"Compile"---"Execute".
+
+\bull After the ``executing of compiler'' the line with test of error code
+of compiler is included (see line 29 in "demo.bat"). If the compiler does
+not end successfully, the batch sets the value 10 (instead 30) to MNU
+variable and this setting influences the next state of MNU program (the
+Edit item offers instead the Execute item). This command is commented out
+("rem") because the really compiler run does not preceded.
+
+\bull If user press the "Esc" key, the MNU program searches the item with
+number zero and the "Quit" item offers.
+
+
+\subsect 5.2 The second more complicated example
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This is the example of em\TeX\ configuration using the MNU program.
+The files listed below are really used in \CS\TeX\ package. In this package
+distributed by \CS TUG (Czechoslovak \TeX\ Users Group), the em\TeX\
+programs and MNU configuration are included. The MNU configuration is
+separated from the \CS\TeX\ package and included as the example here.
+
+\begtab{24em}
+& "demotex.bat " \: This batch starts the example &\cr
+& "texset.bat " \: Initialization batch &\cr
+& "texbat.bat " \: The main loop &\cr
+& "texrun.bat", \: &\cr
+& "others.bat", \: &\cr
+& "prints,bat", \: &\cr
+& "metafont.bat" \: The applications batches (called from "texbat.bat") &\cr
+& "cfg.mnu " \: The configuration file for menu &\cr
+& "sorry.mnu " \: The configuration file for ``sorry-messages'' &\cr
+& "texcfg.bat " \: User's configuration &\cr
+& "mfbat.bat " \: The auxiliary batch (it can be changed) &\cr
+& "gfbat.bat", \: &\cr
+& "dos.bat", \: &\cr
+& "envir.bat " \: The auxiliary batches (they will be created) &\cr
+& "dupcent.exe " \: Duplicates the "%" character (utility program) &\cr
+& "totext.exe " \: Sets the screen to text mode (utility program) &\cr
+& "kalk.exe " \: Calculator -- a simple application program &\cr
+& "kalk.hlp " \: help texts for "kalk.exe" &\cr
+& "dupcent.c", \: &\cr
+& "totext.c " \: The source codes for utility programs
+\endtab
+
+Unfortunately, this example cannot show the applications in really action,
+because application programs are other matter and they are not included in
+this small MNU package. If you are interested in this problem, you can take
+the whole \CS\TeX\ package from public international network archives.
+Note that the installation program of this package is based on MNU program
+too.
+
+You can run the staring batch "demotex.bat" and try the menu. The helps
+are translated from Czech language to English (more exactly to my poor
+English and bad English). So, the sense of individual items can be read
+from this helps.
+
+The files listed here can be used in various configuration of \TeX\
+systems, but some modifications are needed. If you intend to use these
+files as a motivation when designing the \TeX\ configuration for your
+computer, you will have to modify some parts as your needs can be.
+
+In any case, the files listed here can serve as a source of inspiration. At
+least you can find the key to a better understanding the philosophy
+of the communication between the control batch and the MNU program there.
+
+The remarks to individual tricks and most important parts of files used in
+this example follow here.
+
+
+\subsect Remarks to "demotex.bat"
+
+\bull There is only one line here---the call of the batch "texset.bat" via
+the command "command". The environment variable "COMSPEC" will be expanded
+to command "command" including path. The command "command" enlarges the
+system environment. Many environment variables will be used.
+
+\bull The "texset.bat" has four parameters. First: the format file name
+("csPLAIN" in the example in "demotex.bat"), second: the item text for
+\TeX\ executing ("PlainT^eX" in the example), third: the working and main
+filename ("%1" in the example) and fourth: the working filename if
+different ("%2" in the example).
+
+\bull The ``starting batch'' "demotex.bat" has others names in original
+\CS\TeX\ package. For example "plain.bat", "latex.bat" etc. This batches
+are placed in directory where the system "PATH" points. So that the user
+can call the \TeX\ system from his own current directory by the command
+(for instance)
+
+\begtt
+ latex <filename>
+\endtt
+\noindent
+All working files (".tex", ".dvi", ".log", etc.) will be created in the
+current directory.
+
+
+\subsect Remarks to "texset.bat"
+
+\bull There are "set" commands here to set the environment of em\TeX\
+variables and others. Some variables are used only in batches. The field
+signed as ``system dependent variables'' includes variables dependent on
+disk structure. Note that the first settings are nonstandard in demo-version
+of "texset.bat" because only demonstration without special path handling is
+done. The really settings can look as following:
+
+\begtt
+ set TEXDIR=c:\emtex <the main directory with programs>
+ set TEXDIRCFG=c:\emtex\cfg <the directory with configuration files>
+ set RAM=e:\temp <ram disk with directory for temporary files>
+ set EDIT=c:\editors\ne <the main editor>
+ set SHELL=c:\nc\nc <the file manager>
+\endtt
+
+\bull After environment settings the "texset.bat" calls the "texcfg.bat" if
+present (see line 57). So that the user can change the default setting in
+his own ``configuration batch'' "texcfg.bat" if this file is placed in
+current directory.
+
+\bull Some batches and configuration files ("texbat.bat", "cfg.mnu",
+"texrun.bat", "mfbat.bat") are copied into RAM disk to increase the speed
+(see lines 50--53 in "texset.bat"). This process is skipped in demo version
+because the environment variable RAM does not point to RAM disk. (see line
+50: ".. goto start").
+
+\bull The "texset.bat" calls the "texbat.bat"---the main loop of
+applications (see line 61).
+
+
+\subsect Remarks to main loop "texbat.bat"
+
+\bull The MNU is called here (compare with "demo.bat" from previous
+example). Then the process branches to individual applications or
+application batches.
+
+\bull The auxiliary batch "envir.bat" is called after each MNU run to
+restore the global environment setting (see line 5).
+
+\bull If the typical file of application is not found the process go to
+"sorry" label (line 139) and calls the MNU program with "sorry.mnu"
+configuration file to display a message about no-installed program (see
+line 80 for instance). This handling is included to control batches because
+no all applications may be installed---the installation program of \CS\TeX\
+offers many variabilities that no all programs can be installed.
+
+\bull The "texbat.bat" calls directly only some applications, others are
+called via application batches. You can compare this batches to
+``procedures'' in programming languages.
+
+
+\subsect Remarks to application batches "texrun.bat", "others.bat",
+"prints.bat" and "metafont.bat"
+
+\bull The error code from MNU is still stored and the process branches to
+individual applications again.
+
+\bull The ``sorry handling'' is similar as in the "texbat.bat".
+
+\bull The individual application will not work in demo version because they
+are not installed.
+
+\bull Some tricks are used here. These tricks are related to em\TeX\
+configuration itself and they are not in our first interest while we
+are studying the MNU philosophy.
+
+
+\subsect Remarks to "cfg.mnu" configuration file
+
+By means of questions and answers, we are going to look into some
+constructions in the file "cfg.mnu" installed. We focus on those
+parts of the file which need not be quite comprehensible even after reading
+the documentation through.
+
+\quest Where to look for the item 100 defined in the line " ^ 100 \" (see
+line 10).
+
+\answ This item does not exist. It is the case when there are less items
+(zero in this place) in the window than set in the definition line of the
+window. The window opens if the item is called, but there is no item
+active. The window is called as a parent window by the window with the
+basic menu (see line 16). Pressing the key "Esc" at the moment when only
+the basic menu is offered does not cause a jump to the non-existing item
+100, because the window is defined as automatically closeable (the
+character "\").
+
+\quest Why is the result of choosing (e.g.~"amstex") in\m "Formats menu"\m
+stored not only in the environment variable, but also in the file 2 in the
+form\m \dd"set FMT=amstex"\dd">2" (see line 122).
+
+\answ The command\m \dd"csAMSTEX"\dd">FMT"\m has a local character within
+the MNU program, and because the next command (i.e.~"*") means closing all
+windows and a jump onto the item 61, also the contents of the window with
+the non-existing item 100 is restored; it bears information about the
+chosen format. On the other hand, the command\m
+\dd"set FMT=amstex"\dd">2"\m enables to forward the information about the
+chosen format to the control batch via the file 2, i.e.~the file
+"envir.bat".
+
+\quest How to make sense of definitions of items in the "Diskette menu"
+(lines 172--179).
+
+\answ The environment variable "AR" means the direction of copying (from
+or onto the disk), and the variable "D" is the letter of the chosen diskette
+drive (either A or B). The batch works with both variables, and therefore
+the values as stored in the file "envir.bat" in the form of a command
+"set". Moreover, the value "D" is stored also locally, because it is used
+when opening the window with the item 105 (there is a variable text reading
+"Insert diskette to drive [%D%]" ).
+
+\quest In the window with ``final question'', the numbers in the window definition do
+not match with the number of items. Unlike the window 100, there are less
+numbers then items (lines 186--189).
+
+\answ The program jumps to the item 0 (i.e.~"Yes") when closing all
+windows, that is if "Esc" was pressed in the main menu. The item "No" does
+not need to have a number, because the program does not leave it, but the
+window with the item 3 is opened.
+
+\quest How to arrange the final question, where "No" is implicitly
+offered.
+
+\answ In the window definition, we write e.g.: " ^ 1, 0 "; and in the
+control batch, we use the commands "if errorlevel" to ensure that the batch
+terminates in the case of "errocode=1".
+
+\quest Why is the item "DOS" solved intricated using the file 3 (i.e. the
+auxiliary file "dos.bat", see line 203). Is it not sufficient to call a line process by a
+definition: "{*"\dd"#"\dd">0} "?
+
+\answ Yes, it will do. But there is a little defect here. The user would
+like to find the last edited value under the item "DOS". We cannot
+guarantee it other way than to store this value in a file. The MNU program
+should terminate and restart several times before the user wishes to use
+the item "DOS" again.
+
+\quest Why are items with the same number in "Print menu" ? (See
+line 49.)
+
+\answ Why not? If user chose the item, the error code of program
+terminating is set to the number of chosen item and this does not make any
+conflict. The batch "print.bat" branches next process by the environment
+setting and not only by the error code.
+
+\quest There is an error in the definition of the editable variable in
+ "METAFONT parameters"!
+The line 210
+\begtt
+ METAFONT |#[%4% 31, 1, 66]|{!>4, "[%4% 1, 1, 30]#">4}
+\endtt
+\hangindent\parindent
+means that the program first reads 66 characters of the text from the file 4
+("mfbat.bat") and opens the window with editable item.
+After editing, the file 4 is reset by the command "!>4". Thus, the
+following construction "[%4% 1, 1, 30]" returns a blank string from the
+resetted file instead of first 30 characters of the old contents of file
+as intended by the programmer of this definition.
+
+\answ Congratulations. If you have succeeded to discover this discrepancy
+by yourself, it is evident that you are an attentive reader of the
+documentation. The moment, when the substitution in the constructions
+"[%...]" is performed, is not stressed there. The substitution is done
+during opening the window, and all the text related to the opened window is
+kept in the memory in the substituted form. The commands defining the item
+reaction are performed only when the item has been chosen by the key
+"Enter". These commands are not read from the file, but from the memory,
+where the substitutions have been done. Therefore it works properly.
+
+
+\sect 6. History
+%%%%%%%%%%%%%%%%
+
+\noindent
+Euro-\TeX-92: The first public version.
+
+\begitems
+
+* User can select between editable items by up/down arrows. (2.4)
+* The mouse cursor takes the same place as the highlighted item, when the
+ program starts.
+* Hot-keys definitions F1 to F10. (3.8)
+* Explicit error code, when program terminates (the "$" command, 3.7).
+* All items has a number now. If there are more items then length of the
+ list of item numbers, the last number of the list is used. (3.5)
+* Special mode for writing files---duplicating per cent sign. (3.7)
+* Auto-run items. (3.9)
+
+\enditems
+
+\noindent
+The last change: January 1993.
+
+
+\bye
+
diff --git a/support/mnu/others.bat b/support/mnu/others.bat
new file mode 100644
index 0000000000..47abbcec6c
--- /dev/null
+++ b/support/mnu/others.bat
@@ -0,0 +1,54 @@
+rem ... the "subroutine batch" called from TEXBAT.BAT
+if errorlevel 136 goto gsview
+if errorlevel 135 goto texcad
+if errorlevel 134 goto bibtex
+if errorlevel 133 goto makein
+if errorlevel 132 goto dvips
+if errorlevel 131 goto dviout
+goto end
+
+:dviout
+ if not exist %TEXDIR%\dvi-out.exe goto sorry
+ %TEXDIR%\dvi-out %MAIN%
+ set MNU=130
+ if errorlevel 1 pause
+ if errorlevel 1 %RAM%\mnu %TEXDIRCFG%\sorry.mnu
+ set MNU=131
+ goto end
+
+:dvips
+ if not exist %TEXDIR%\dvips.exe goto sorry
+ %TEXDIR%\dvi-out -m %MAIN%
+ if errorlevel 1 pause
+ %TEXDIR%\dvips -a %MAIN%
+ goto end
+
+:makein
+ if not exist %TEXDIR%\csindex.exe goto sorry
+ %TEXDIR%\csindex %INDEXOPT% %MAIN%
+ goto end
+
+:bibtex
+ if not exist %TEXDIR%\csbibtex.exe goto sorry
+ %COMSPEC% /c%TEXDIR%\csbibtex %BIBTEXOPT% %MAIN%
+ goto end
+
+:texcad
+ if not exist %TEXDIR%\texcad\texcad.exe goto sorry
+ echo Pozor. Pri prvnim vyvolani programu TEXCAD musite uvest cestu pro BGI:
+ echo %TEXDIR%\texcad
+ echo Tento udaj zopakujte a ulozte uvnitr programu v nabidce OPTIONS
+ %TEXDIR%\texcad\texcad
+ goto end
+
+:gsview
+ %TEXDIR%\gs -I%TEXDIR%\gslib %MAIN%.ps > nul
+ goto end
+
+rem Zde lze analogicky zaradit dalsi software.
+
+:sorry
+ %RAM%\mnu %TEXDIRCFG%\sorry.mnu
+:end
+
+
diff --git a/support/mnu/prints.bat b/support/mnu/prints.bat
new file mode 100644
index 0000000000..ae10a78543
--- /dev/null
+++ b/support/mnu/prints.bat
@@ -0,0 +1,43 @@
+rem ... The "subroutine batch" called from TEXBAT.BAT
+if errorlevel 46 goto clearOP
+if errorlevel 45 goto editOP
+if not exist %MAIN%.opt set OPT=//
+if exist %MAIN%.opt set OPT=@%MAIN%.opt
+if errorlevel 43 goto laser
+if errorlevel 42 goto dot
+if errorlevel 41 goto preview
+goto end
+:preview
+ if not exist %TEXDIR%\fonts\lib%DPI%.fli goto sorry
+ if not exist %MAIN%.opt type %TEXDIRCFG%\messprn.txt
+ dvidrv dviscr @scr%DPI%.cnf /fl300 %OPT% %MAIN%
+ goto end
+:dot
+ if not exist %TEXDIR%\dot%DPI%.dot goto bsorry
+ if not exist %TEXDIR%\fonts\lib%DPI%.fli goto sorry
+ if %OPT%==// type %TEXDIRCFG%\messprn.txt
+ dvidrv dvidot dot%DPI%.dot @prn%DPI%.cnf %OPT% %MAIN% %MARK%
+ goto end
+:laser
+ if not exist %TEXDIR%\dvihplj.exe goto bsorry
+ if not exist %TEXDIR%\fonts\lib300.fli goto sorry
+ if %OPT%==// type %TEXDIRCFG%\messprn.txt
+ dvidrv dvihplj @hplj.cnf %OPT% %MAIN% %MARK%
+ goto end
+:editOP
+ type %TEXDIRCFG%\messprn.txt
+ echo press any key to enter to editor ...
+ %COMSPEC% /c pause > nul
+ %EDIT% %MAIN%.opt
+ set MNU=41
+ goto end
+:clearOP
+ del %MAIN%.opt
+ set MNU=41
+ goto end
+:bsorry
+ set MNU=49
+:sorry
+ %RAM%\mnu %TEXDIRCFG%\sorry.mnu
+ set MNU=41
+:end
diff --git a/support/mnu/readme.txt b/support/mnu/readme.txt
new file mode 100644
index 0000000000..6bfd104376
--- /dev/null
+++ b/support/mnu/readme.txt
@@ -0,0 +1,111 @@
+
+ *****************************************************************
+ * *
+ * Program MNU *
+ * *
+ * A configurable menu for starting applications under DOS *
+ * *
+ * ( A brief description ) *
+ * *
+ *****************************************************************
+
+The program MNU allows, together with its control batch (".bat"),
+repeated starting of various application programs. It has been developed
+for the TeX packages, nonetheless, it can be utilized elsewhere.
+
+The batch "demo.bat" starts a simple exhibition of possibilities of the
+program MNU itself. The second batch "demotex.bat" shows a more complicated
+example of configuration of emTeX used in CSTeX package. This example
+exhibits possibilities of MNU program itself on the one hand, and of its
+suggested configuration "cfg.mnu" suitable for the emTeX packages with DOS
+on the other hand. These examples are documented in EXAMPLES.DOC file.
+The documentation of program MNU is writen in MNU.DOC file or MNU.TEX
+file (plain TeX format).
+
+The documentation is intended for the users, who wish to change the
+existing configuration of the system, where the program is applied, or who
+wish to develop a new one. Therefore some deeper knowledge of DOS is
+assumed, esp. some advanced skills in batch (".bat") programming.
+
+The program keeps up appearances of an integrated environment for starting
+of various processes. This environment is fully configurable, including
+window colours and shapes, names and ways of application of individual menu
+items, context help, etc. The process is controlled by the batch. In a
+definite moment, the batch starts the MNU program with a single parameter --
+the configuration file name (e.g. "texcfg.mnu"). The program MNU reads
+a full description of menu structure from this file and displays menu items on
+the screen. Now the user can choose the particular item comfortably. When
+the item is chosen, the program MNU terminates and the control batch
+evaluates the error code corresponding to the respective item. In the
+batch, the chosen item number is determined using a set of "if errorlevel"
+commands, and the batch branches to separate application processes. When
+the application ends, the batch calls the MNU program again, and the user
+can choose a new item, and so on.
+
+The batch can also communicate with the MNU program by means of DOS
+``environment variables'', and of input and/or output files. The program can
+display and edit the content of these variables (if this is given in the
+configuration file). Moreover, there exists a special environment variable
+called ``MNU'' influencing the start of the program -- the item specified
+in this variable is offered as active when the program starts. Seeing that,
+the user does not need to choose tediously the next item, provided his
+activity proceeds in the ``normal'' sequence. For example, after the
+TeX\ program run it is possible for the batch to examine (using the "if
+errorlevel" command) whether the translation ended without errors. If so,
+then the variable ``MNU'' can be set in such a way that the item "View" is
+active in the next call of the menu. In the menu environment, the user can
+do nothing but "Enter" pressing.
+
+The advantage of this ``batch'' philosophy is that the MNU program does not
+occupy the memory during the application run. Furthermore, concerning the
+system configuration, there are practically no limitations on variability
+in setting the behaviour of particular processes. The only limitations are
+due to the DOS itself. Only a batch allows to express all configuration
+possibilities of separate application programs.
+
+The list of files contained in the MNU program package is given in the
+following table:
+
+ readme.txt Basic information about the program -- this text
+ mnu.doc Detailed documentation of the program
+ examples.doc Description of some tricks used in the demo batches
+ mnu.tex Contents of three previous files in plain TeX
+ mnu.exe The MNU program itself
+ demo.bat, demo.mnu A simple example of program MNU possibilities
+ demotex.bat, cfg.mnu,
+ sorry.mnu, *.bat A more complicated example of emTeX configuration
+ totext.exe, totext.c Switches the screen to the text mode 80x25
+ dupcent.exe, dupcent.c Duplicates "%" (utility program)
+ kalk.exe, kalk.hlp The calculator -- an illustration of an
+ application program
+
+The software contained in the files listed above is in the public domain.
+The author transfers it to the CSTUG association (Czechoslovak TeX Users
+Group) and expects that they will care about its popularization and further
+distribution. It is not allowed to utilize these programs and/or their
+modifications for commercial purposes. That means, it is not allowed to
+sell this software (with the exception of a diskette copying fee), nor to
+include it in systems designed merely for commercial purposes.
+
+Since of the first public distribution of this product (Euro-TeX 92)
+some unimportant improvements were made. This changes keep full
+compatibility with the old configuration files and offers some new
+possibilities (see the end of the documentation MNU.DOC).
+
+The author will not more change or improve this software, esp. its basic
+conception. However, he welcomes all suggestions leading to elimination of
+errors, which can, unfortunately, appear in any software.
+
+The source code of the MNU program (written in C language) is not public.
+
+address: Petr Olsak
+ Department of Mathematics
+ Faculty of Electrical Engineering
+ Czech Technical University
+
+ 166 27 PRAGUE
+ --------------------------
+ CZECH REPUBLIC
+
+email: olsak@csearn.bitnet
+
diff --git a/support/mnu/sorry.mnu b/support/mnu/sorry.mnu
new file mode 100644
index 0000000000..0b8f8c6a94
--- /dev/null
+++ b/support/mnu/sorry.mnu
@@ -0,0 +1,124 @@
+ ****** Config. file MNU for messages about non installed programs *******
+ *************************************************************************
+ 18.12.92 Petr Olsak
+
+~param {3, 2, 76, 23, 1, 48, 62} " Sorry " ;
+
+^235
+
+ The dictionary "[%MARK%]" is not installed at this computer
+ in right path.
+
+ The spell-checker is a possession of CSTUG (Czechoslovak TeX Users Group).
+ It is not in public domain, free copying is prohibited.
+ If you are the member of this group, you can get the spell-checker
+ without any additional fee.
+
+^131
+
+ The program DVIOUT is not installed at this computer in right path.
+ You can get this program from installation diskettes of CSTeX package
+ by selecting required item in installation menu.
+
+^132
+
+ The program DVIPS is not installed at this computer in right path.
+ You can get a functional part of this program package from installation
+ diskettes of CSTeX package by selecting required item in
+ installation menu.
+ You can get a full package of DVIPS by public international network
+ archives.
+
+^133
+
+ The program MAKEINDEX is not installed at this computer in right path.
+ You can get this program from installation diskettes of CSTeX package by
+ selecting required item in installation menu. This way leads to
+ uncompleted package of MAKEINDEX, but the Czechoslovak special program
+ CSINDEX is added.
+
+ You can get a full package of MAKEINDEX by public international network
+ archives.
+
+
+^134
+
+ The program BIBTEX is not installed at this computer in right path.
+ You can get this program from installation diskettes of CSTeX package by
+ selecting required item in installation menu. This way leads to
+ uncompleted package of BIBTEX, but the Czechoslovak special program
+ CSBIBTEX is added.
+
+ You can get a full package of BIBTEX by public international network
+ archives.
+
+
+^135
+
+ The program TEXCAD is not installed at this computer in right path.
+
+ This program is included into CSTeX package and you can get it from
+ installation diskettes CSTeX by selecting required item in installation
+ menu.
+
+ Other way to get the program TEXCAD is copying it from public
+ international network archives.
+
+
+^136 137 138
+
+ The software you require is not installed at this computer.
+
+^41, 42, 43
+
+ The Fonts [%DPI%]dpi are not installed at this computer
+ in right path. You can install this fonts from installation diskettes
+ by selecting the required item in the installation menu.
+
+ You need following diskettes:
+
+ CSTeX-1 : installation program
+ CSTeX-6 to 8 : 180dpi (24-pin dot matrix printer, low resolution)
+ CSTeX-9 to 12 : 240dpi (9-pin dot matrix printer, hight resolution)
+ CSTeX-13 to 18 : 300dpi (laser printer).
+
+^49
+
+ The required driver is not installed at this computer in right path.
+
+ The emTeX drivers DVISCR, DVIHPLJ, and DVIDOT are installable from
+ CSTeX installation diskettes. You can get the full emTeX package
+ from public international network archives.
+
+^52, 53, 54, 55, 56, 57, 58
+
+ The program METAFONT is not installed at this computer in right path.
+ You can get this program from installation diskettes of CSTeX package
+ by selecting the required item in the installation menu.
+ The CSTeX installation offers three types of METAFONT program:
+ emTeX: mf186, mf386
+ sbTeX: sbmf.
+
+ All programs you can get from public international network archives,
+ but without batch files, which support the MNU configuration of TeX.
+
+
+^33, 233, 58, 102
+
+ The format "[%FMT%]" for version [%TEXVER%]
+ is not installed at this computer in right path.
+
+ If you have installed the source codes of required format (from CSTeX
+ installation diskettes), you can generate this format by running the
+ INITEX.BAT file.
+
+^31 101
+
+ The type of TeX program: "[%TEXVER%]" is not installed at this computer
+ in right path.
+
+~
+******** end of file SORRY.MNU
+
+
+
diff --git a/support/mnu/texbat.bat b/support/mnu/texbat.bat
new file mode 100644
index 0000000000..df850b4946
--- /dev/null
+++ b/support/mnu/texbat.bat
@@ -0,0 +1,165 @@
+rem ... The "subroutine batch" called from TEXSET.BAT
+rem ................................. running menu:
+:menu
+%RAM%\mnu %RAM%\cfg.mnu %RAM%\envir.bat %RAM%\dos.bat %RAM%\mfbat.bat
+call %RAM%\envir
+rem ................................. chose process:
+if errorlevel 255 goto syserr
+if errorlevel 235 goto spell
+if errorlevel 233 goto EXview
+if errorlevel 232 goto EXtex
+if errorlevel 231 goto EXedit
+if errorlevel 169 goto load
+if errorlevel 168 goto save
+if errorlevel 151 goto parmf
+if errorlevel 141 goto cstocs
+if errorlevel 131 goto others
+if errorlevel 125 goto dosbat
+if errorlevel 124 goto archive
+if errorlevel 52 goto metafont
+if errorlevel 41 goto prints
+if errorlevel 38 goto usercom
+if errorlevel 36 goto tie
+if errorlevel 34 goto specEd
+if errorlevel 33 goto view
+if errorlevel 32 goto TeX
+if errorlevel 31 goto edit
+if errorlevel 29 goto quit
+if errorlevel 27 goto editor
+if errorlevel 26 goto shell
+if errorlevel 24 goto clear
+goto quit
+rem ................................. running Edit -> TeX -> View:
+:edit
+ %EDIT% %WORK%.tex %EDITPAR%
+ set EDITPAR=
+ set MNU=32
+ goto menu
+:TeX
+ set MNU=33
+ call %RAM%\texrun %MAIN% tex
+ goto menu
+:View
+ %TEXDIR%\dvidrv dviscr @scr.cnf %SCROPT% %MAIN%
+ set MNU=31
+ goto menu
+:specEd
+ %EDIT% %MARK%
+ set MNU=32
+ goto menu
+:editor
+ %EDIT% %F3FILE%
+ goto menu
+rem ................................. Experiment:
+:EXedit
+ %EDIT% %MAIN%.try %EDITPAR%
+ set EDITPAR=
+ set MNU=232
+ goto menu
+:EXtex
+ set MNU=233
+ call %RAM%\texrun %MAIN% try
+ goto menu
+:exView
+ %TEXDIR%\dvidrv dviscr @scr.cnf %SCROPT% %MAIN%
+ set MNU=231
+ goto menu
+rem ................................. others bats:
+:prints
+ call %TEXDIRCFG%\prints
+ goto menu
+:others
+ call %TEXDIRCFG%\others
+ goto menu
+:metafont
+ if not exist %TEXDIRCFG%\metafont.bat goto sorry
+ call %TEXDIRCFG%\metafont
+ goto menu
+rem ................................. correction of document:
+:spell
+ if not exist %TEXDIR%\cstug\velky.%MARK% goto sorry
+ if %MARK%==ces set MARK=C
+ if %MARK%==slv set MARK=S
+ if %MARK%==ang set MARK=A
+ %TEXDIR%\cstug\texspell %WORK%.tex =%MARK% %SPELLOPT%
+ set MNU=32
+ goto menu
+:tie
+ %TEXDIR%\vlnka %WORK%.tex
+ set MNU=32
+ goto menu
+:usercom
+ %COMSPEC% /c %USERCOM%
+ goto menu
+:cstocs
+ if errorlevel 141 set MARK=-i1 -o0
+ if errorlevel 142 set MARK=-i0 -o1
+ if errorlevel 143 set MARK=-i2 -o0
+ if errorlevel 144 set MARK=-i0 -o2
+ if errorlevel 145 set MARK=-i1 -o2
+ if errorlevel 146 set MARK=-i2 -o1
+ echo CSTOCS %MARK% %WORK%.tex
+ %TEXDIR%\cstocs %MARK% %WORK%.tex
+ if errorlevel 1 %COMSPEC% /c pause
+ set MNU=31
+ goto menu
+rem ................................. Special functions:
+:dosbat
+ set MNU=25
+ @echo on
+ @call %RAM%\dos
+ @echo off
+ goto menu
+:clear
+ if not %MAIN%==%WORK% echo delete %WORK%.bak
+ if not %MAIN%==%WORK% del %WORK%.bak
+ echo delete %MAIN%.bak %MAIN%.log %MAIN%.dvi %MAIN%.aux %MAIN%.lq %MAIN%.hp %MAIN%.fx
+ for %%f in (bak log dvi aux lq hp fx) do del %MAIN%.%%f
+ goto menu
+:shell
+ echo Quit the shell to return to TEX-MENU-SYSTEM.
+ %SHELL%
+ goto menu
+:parmf
+ set MNU=152
+ goto menu
+:save
+ set > %RAM%\file.mnu
+ echo echo **** CONFIGURATION from file %MARK%.bat **** > %MARK%.bat
+ dupcent %RAM%\file.mnu set >> %MARK%.bat
+ echo set MNU=31 >> %MARK%.bat
+ del %RAM%\file.mnu
+ set mnu=65
+ goto menu
+:load
+ set MNU=66
+ call %MARK%
+ goto menu
+rem ................................. Sorry
+:sorry
+ %RAM%\mnu %TEXDIRCFG%\sorry.mnu
+ goto menu
+rem ................................. Diskette:
+:archive
+ if %AR%==from goto fromdisc
+ echo copy %D%:%MAIN%.tex
+ copy %D%:%MAIN%.tex
+ if not %WORK%==%MAIN% echo copy %D%:%WORK%.tex
+ if not %WORK%==%MAIN% copy %D%:%WORK%.tex
+ set MNU=31
+ goto menu
+:fromdisc
+ echo copy %MAIN%.tex %D%:
+ copy %MAIN%.tex %D%:
+ if not %MAIN%==%WORK% echo copy %WORK%.tex %D%:
+ if not %MAIN%==%WORK% copy %WORK%.tex %D%:
+ set MNU=31
+ goto menu
+rem ................................. Final:
+:syserr
+ echo SORRY - Error in configuration of TeX system.
+ echo Please ask the system engineer to solve this problem.
+:quit
+ %KBD% %TEXDIR%\kbd /u
+ %LASTCOM%
+
diff --git a/support/mnu/texrun.bat b/support/mnu/texrun.bat
new file mode 100644
index 0000000000..16b4829635
--- /dev/null
+++ b/support/mnu/texrun.bat
@@ -0,0 +1,24 @@
+rem ... The "subroutine batch" called from TEXBAT.BAT
+:start
+if not exist %TEXDIR%\%TEXVER%.exe goto bsorry
+set MARK=
+set EDITPAR=
+if %TEXVER%==tex386 set MARK=b
+if not exist %TEXDIR%\%MARK%texfmts\%FMT%.fmt goto sorry
+:run
+rem ... for csSLITEX and tex.exe we need to enlarge font-memory:
+set OPT=
+if %FMT%==csSLITEX set OPT=/mf48000
+if %TEXVER%==tex386 set OPT=
+if exist %RAM%\ed.bat del %RAM%\ed.bat
+%TEXDIR%\%TEXVER% /mt25000 /a%RAM%\ed.bat &%FMT% %1.%2
+if exist %RAM%\ed.bat call %RAM%\ed
+if exist %RAM%\ed.bat goto start
+if errorlevel 2 %ERRCOM%
+goto end
+:bsorry
+set MNU=31
+:sorry
+if exist %FMT%.fmt goto run
+%RAM%\mnu %TEXDIRCFG%\sorry.mnu
+:end
diff --git a/support/mnu/texset.bat b/support/mnu/texset.bat
new file mode 100644
index 0000000000..99113d86f4
--- /dev/null
+++ b/support/mnu/texset.bat
@@ -0,0 +1,72 @@
+@echo off
+rem ... The "subroutine batch" called from main batch DEMOTEX.BAT
+if "%1==" goto end
+echo This is TeX-menu-system, Version Jan-30-1993 (for DOS)
+rem =========== system dependent values ===============
+set TEXDIR=.
+set TEXDIRCFG=.
+set RAM=.
+set EDIT=echo RUN editor
+set SHELL=c:\nc\nc
+set TEXVER=tex
+set SCROPT=/oi-
+set EMTEXED=echo RUN editor %%2 %%3 -n%%1
+set SPELLOPT=@K
+set INDEXOPT=-z keybcs2
+set BIBTEXOPT=/k
+set KBD=rem
+set TMP=.
+rem ===================================================
+set VLNKA=KkOoUuVvSsZzAI
+set DVIDRV=/pr:{,$TEXDIRCFG:\}@f
+set TEXCONFIG=%TEXDIRCFG%
+set ERRCOM=call %RAM%\errbat
+set USERCOM=call bat.bat
+set LASTCOM=echo ...... End of TeX system, bye !
+set GFOPT=gftopk %%MF%%.180 %%MF%%.pk
+set FMT=%1
+set FFMT=%2
+set WORK=%3
+set MAIN=%3
+if not "%4" == "" set WORK=%4
+set MF=%MAIN%
+set PATH=%TEXDIR%;%PATH%
+set TEXFMT=%TEXDIR%\texfmts;.
+set BTEXFMT=%TEXDIR%\btexfmts;.
+set TEXTFM=%TEXDIR%\tfm;.
+set TEXINPUT=%TEXDIR%\texinput;.
+if %FMT%==INIT %TEXDIRCFG%\inibat
+set MFBAS=%TEXDIR%\mfbases;.
+set BMFBAS=%TEXDIR%\bmfbases;.
+set MFINPUT=%TEXDIR%\mfinput;.
+set MFJOB=%TEXDIR%\mfjob
+set OUTHP=lpt1
+set OUT24=lpt1
+set OUT9=lpt1
+set DPI24=180
+set MNU=31
+if "%WORK%"=="" set MNU=121
+
+if exist %RAM%\texbat.bat goto start
+rem ............................... copy frequently used files to RAM disk
+mkdir %RAM%
+copy %TEXDIRCFG%\ram\*.* %RAM% > nul
+rem ............................... message + user-configuration
+:start
+if exist %TEXDIR%\cfg\message.txt type %TEXDIR%\cfg\message.txt
+if exist texcfg.bat call texcfg
+rem ............................... system keyboard driver + START!
+%KBD% %TEXDIR%\kbd /yy
+if not exist %RAM%\texbat.bat goto diskful
+%RAM%\texbat
+rem ............................... remove temporary files
+if %RAM%==%TEXDIR%\cfg\ram goto end
+for %%t in (%RAM%\*.*) do del %%t
+rmdir %RAM%
+goto end
+
+:diskful
+echo Disk full or no exists the %RAM% ! ?
+%KBD% %TEXDIR%\kbd /u
+:end
+
diff --git a/support/mnu/totext.c b/support/mnu/totext.c
new file mode 100644
index 0000000000..f3fb1c19ba
--- /dev/null
+++ b/support/mnu/totext.c
@@ -0,0 +1,62 @@
+
+/* Program TOTEXT sets the grafic state of screen to the tex mode 80x25 */
+/************************************************************************/
+/* 16.8.92 Petr Olsak */
+
+/* If the grafic state is in text mode, program do nothing and terminates.
+ In the other case program writes message, waits to key pressing
+ (or mouse buttom pressing) and then it return to the text mode.
+ The program is used after METAFONT run in the TeX-menu-system.
+*/
+
+#include <dos.h>
+#include <stdio.h>
+
+struct REGPACK reg;
+
+int mpresent;
+
+unsigned int mouseinit (void) /* true if mouseOK */
+{
+ reg.r_ax = 0;
+ intr (0x33, &reg);
+ return reg.r_ax;
+}
+
+unsigned int mhit (void) /* returns buttoms status */
+{
+ if (!mpresent) return 0;
+ reg.r_ax = 3;
+ intr (0x33, &reg);
+ return reg.r_bx;
+}
+
+int Mykbhit(char *ac) /* input char from keyboard without Ctrl-Break check */
+{
+ reg.r_ax=0x0600;
+ reg.r_dx=0x00FF;
+ intr (0x21, &reg);
+ if (reg.r_flags & 0x0040) return 0;
+ *ac = reg.r_ax % 256;
+ return 1;
+}
+
+main()
+{
+ unsigned char mode;
+ char c=0;
+
+ reg.r_ax = 0x0F00;
+ intr (0x10, &reg);
+ mode = reg.r_ax % 256;
+ if (mode != 2 && mode != 3 && mode != 7)
+ {
+ mpresent = mouseinit();
+ printf("press ENTER to return to the text mode ...");
+ while (c != 13 && !mhit()) Mykbhit(&c);
+ reg.r_ax = 0x0003;
+ intr (0x10, &reg);
+ }
+ return 0;
+}
+