emTEX 3.0 [3a]

Implemented by Eberhard Mattes

08.08.1990

Contents

1 Starting TEX 2 1.1 MS-DOS and PC-DOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 OS/2 protected mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 Changing the size of the internal tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.5 Pathnames in the command line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.6 Using the quotes character in the command line . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.7 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Calling an editor automatically on an error 4 3 Directories and environment variables 6 4 Virtual memory under DOS 6 5 80286 processor 7 6 bigTEX 7 7 Miscellaneous 7

7.1 End of line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7.2 End of file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7.3 Interrupting emTEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7.4 File names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7.5 errorlevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

A Character translation with the /c option 8 B Known errors 8

1 Starting TEX

1.1 MS-DOS and PC-DOS

tex [options] [&format] [input file] [TEX commands]

1.2 OS/2 protected mode

texp [options] [^&format] [input file] [TEX commands]

1.3 Options

Options are entered on the command line by preceding the option name with either “-” or “/”; options must be separated by at least one space — uppercase and lowercase letters are not at present distinguished. If an option or a set of options are always used then they can be put in the environment variable EMTEXOPT, these options will be processed before those on the command line. The following options are available:

/7 When reading the input file, the 8th bit of each character will be zeroed — the use of some editors (such as WordStar) make this necessary.

/8 Allow the use of the full 8-bit character set on input. This option may only be used with INITEX, that is, after the /i option, and will be set in the generated fmt file. The following character codes may not be used (however, see /r): 0–8, 10–11, 14–31, 127 and 255.

/a* This option sets the name of the file which will be written when an error occurs and E is entered in response to TEX’s prompt: the argument of this option is mandatory. The name of the file may immediately follow /a or be separated from it by “:”, “=” or “:=”. If a path name is used, “\” must be used for the directory separators. Further information on the use of this option will be found in section 2.

/b               \batchmode.

/c* set the tcp file to be used in converting code pages. The name of the file to be used may immediately follow /c or be separated from it by “:”, “=” or “:=”. When this option is selected /8 is ignored; /r can be used together with /c, however, and will be processed in addition to the tcp file. Further information will be found in the description of maketcp and in Appendix A. The default extension for the file is tcp and it will be sought first in the current directory and then in the directories listed in the TEXINPUT environment variable. The use of accented characters in your input text, converted by the table in the tcp file, makes your text impossible to process with ordinary versions of TEX. If you wish to send your text to someone who does not use emTEX, you can convert it to the normal style of input with the texconv program.

/d do not use Expanded Memory (LIM) (DOS only).

/e               \errorstopmode.

/i activate INITEX mode. INITEX is often a separate program, here it is an option on the TEX used for normal processing. INITEX is used to read a macro file, such as plain.tex or lplain.tex, and convert it into a form which needs less processing, the corresponding fmt file. A number of options can only be used in INITEX mode, these options must follow /i.

/l OS/2 protected mode only: select a low priority for this program so that TEX practically only runs when the computer has nothing better to do — not recommended when run in interactive mode.

/m* this option allows the size of TEX’s internal tables to be altered: see section 1.4.

/n               \nonstopmode.

/o allow the full 8-bit character set to be used on output, that is, including the codes from 128–254. This option may only be used with INITEX, that is, after the /i option, and will be set in the generated fmt file. Displaying an “ä” (code page 850) without option /o will give ^^84 but with /o it will give “ä”.

/r normally the only control characters accepted on input are tab (\char9) and form feed (\char12). With option /r all the control characters (codes 0–31) are accepted except for 26 ([figure: Ctrl]+[figure: Z]) which emTEX interprets as end of file when it appears at the beginning of a line. This option may only be used with INITEX, that is, after the /i option, and will be set in the generated fmt file.

/s               \scrollmode.

1.4 Changing the size of the internal tables

The five forms of the /m* option change the way memory is divided up between TEX’s internal tables. It is not usually necessary to use this option as the default sizes will cope in most cases. The number may immediately follow the letter denoting the table or be separated from it by “:”, “=” or “:=”. There are fourteen forms of the same error message which TEX can issue, the five forms which can be repaired appear in the second column — use the option in the first column with a value greater than the default size (or the last size you tried), but within the range shown, to try and clear the error.

Option Error message:  Range  Default
TeX capacity exceeded, sorry […] from–to  DOS / OS/2
/mn# semantic nest size  20–3000  40 / 100
/mf# font memory  5000–65500  32766
/mp# pool size  20000–65500  50000
/ms# save size  100–16000  600
/mt# pattern memory  5000–65500  10000

If, for instance, the option environment variable is set as shown below

set emtexopt=/ms:2000 /mp45000

then ‘save size’ will be increased and ‘pool size’ will be reduced. See also [1], pages 300–301. bigTEX has a maximum value for /mf# of 262141, the default is 81920.

1.5 Pathnames in the command line

If you have to enter a pathname in the command line then you must use “/” instead of “\” as TEX sees this character as the start of a control sequence. As emTEX will take “/” preceded by a space as the start of an option, and pathname which would start with “/” must be preceded by the drive descriptor. For example:

tex /mytexts/myfile Error option /my not recognized

but with the drive desciptor

tex d:/mytexts/myfile the file d:/mytexts/myfile is processed

1.6 Using the quotes character in the command line

If you want to pass a quotes character (") to TEX via the command line, you must enter it as “\"”.

1.7 Examples

In this example, TEX is called as INITEX to create plain.fmt, the special characters in code page 850 will be converted into the appropriate TEX control sequences and characters in the range 128–254 will be output as the corresponding font character rather than the default hexadecimal (DOS):

     tex -i -c:850_tex plain -o \dump

In this example, LaTEX is run in \scrollmode to process the file myfile.tex:

     tex -s &lplain myfile

2 Calling an editor automatically on an error

When TEX encounters an error and the input is being read from a file, entering “E” at the resulting prompt can cause an editor to be run (see [1], page 34). To make use of this facility the option /a* must be entered to set the name of a file into which TEX will write the name of the file being processed when the error occurred, the line number in this file at which the error appeared and the name of the log file in which the transcript of the run was recorded. The text in the environment variable EMTEXED will be used to determine how this information is to be written: in this text “%1” will be replaced by the line number, “%2” with the full pathname of the input file and “%3” by the full pathname of the log file. If a literal percent sign is needed in the text, it must be entered as “%%”. After making any replacements, the resulting text is written to the file set by /a*. If EMTEXED does not appear in the environment, this text will be used:

     emtexed %1 %2 %3

If, for instance, you want the Norton Editor to be run on an error, you can set EMTEXED to

     set emtexed=ne +%1 %2

With the option /a=ed.bat but no EMTEXED, suppose that an error has been discovered in line 172 of the input file test.tex in the directory d:\mytex: after leaving emTEX with “E” the file ed.bat will contain the following line

emtexed 172 d:\mytex\test.tex d:\mytex\test.log

To run the editor automatically after leaving emTEX you must call emTEX from a batch file similar to the following:

@echo off
rem texed.bat
if exist texed2.bat del texed2.bat
tex /a=texed2.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
if exist texed2.bat texed2

If emTEX is being run on a network then, to avoid conflict, each user must have their own batch file — this can be arranged by using the environment variable EMTEXED. If you do not use the environment variable then you must provide another batch file called emtexed.bat (or emtexed.cmd for OS/2) which calls the editor. Here is another example for the Programmer’s WorkBench (or the Microsoft Editor) running under OS/2 — it is recommended that the editor is left loaded all the time. emTEX is called with this batch file:

@echo off
rem glatexed.cmd
set emtexed=%%2 %%1
texp -a=c:\ init\ emtexed.m -x ^&lplaing %1 . . . %9

If you then define the following macros for the Programmer’s WorkBench

texed:=Arg "c:\\init\\emtexed.m" Setfile Begfile _texed1
_texed1:=Arg Setfile -> _texed2
_texed2:=Setfile Arg Arg " [0-9]" Psearch -> _texed3
_texed3:=Right Arg Endline Lasttext Mark _texed4
_texed4:=Arg Refresh Lasttext Mark

(or for the Microsoft Editor:)

texed:=Arg "c:\\init\\emtexed.m" Setfile Arg Mpage _texed1
_texed1:=Arg Setfile -> _texed2
_texed2:=Setfile Arg Arg " [0-9]" Psearch -> _texed3
_texed3:=Right Arg Endline " " Emacscdel Mark _texed4
_texed4:=Arg Refresh Lasttext Mark

and assign the macro to a key with

texed:Ctrl+E

then pressing [figure: Ctrl]+[figure: E]will put the cursor on the desired line. The directory c:\init and the file c:\init\emtexed.m must exist before you can use the [figure: Ctrl]+[figure: E]keystroke.

3 Directories and environment variables

A file to be opened is first searched for in the current directory, then in the list of directories given in the appropriate environment variables and, finally, in the default directory. The defaults are:

  \emtex\texinput for input files.
  \emtex\tfm  for tfm files.
  \emtex\texfmts for fmt files and tex.poo.

The appropriate environment variables are:

EMTEXED Mask for calling an editor (see section 2).

EMTEXOPT Options (see section 1.3).

TEXFMT Directories for fmt files and tex.poo.

TEXTFM Directories for tfm files.

TEXINPUT Directories for input files and the tcp file.

TMP Directory for temporary files.

The environment variables TEXFMT, TEXTFM and TEXINPUT may contain lists of directories which are separated from each other by semicolons. bigTEX uses the same environment variables and default directories with the following exceptions (since it must use different fmt files):

BTEXFMT Directories for fmt files and tex.poo.

  \emtex\btexfmts  fmt files and tex.poo.

4 Virtual memory under DOS

If expanded memory (LIM) is available and the /d option is not in effect, it will be used for data which will not fit into conventional memory (below 640 K). If too little (or no) expanded memory is available or the /d opion has been selected then, when necessary, emTEX will automatically create a temporary file into which data will be written which can no longer be kept in memory. The environment variable TMP can be used to determine the drive and directory where this file will be created. For instance, the command

     set tmp=H:\

will cause the file to be created in the root directory of drive H:. Note that a drive alone is not enough, a directory must be given. If possible, this file should go on a RAM disk. If this variable is not set then emTEX puts the file in the root directory of the current drive. If there is a choice, emTEX uses expanded memory more efficiently than a RAM disk. The less conventional memory available, the slower emTEX runs: it is often better to reduce the amount of expanded memory the EMS driver makes available as this will, for many drivers, reduce the amount of conventional memory it uses — the standard version of emTEX needs up to 512 KBytes of conventional memory, bigTEX up to 2560 KBytes of expanded memory.

5 80286 processor

If the machine has an 80286 CPU or above then, under DOS, tex286.exe can be used instead of tex.exe. The 286 version is a bit smaller and faster than the 8086/88 version. To use it, delete tex.exe and rename

tex286.exe to tex.exe.

6 bigTEX

This version^{1} of TEX makes more memory available but is noticeably slower than the standard version. It uses different fmt files; its default directory for these files is \emtex\btexfmts. The default directory can be changed by setting the environment variable BTEXFMT to a different search path. bigTEX is called by btex, btex286 or btexp (sections 1.1 and 5 are to be used with the appropriate changes). Please note that when creating a new format file with bigTEX (/i) a lot of conventional memory is needed: you should remove all TSRs (even KEYB), all device drivers in your config.sys that are not essential to this run and reduce the numbers of buffers and files to the minimum. You can, however, run btexp under OS/2 instead as the fmt files are interchangeable.

7 Miscellaneous

7.1 End of line

The control characters CR, CR/LF and LF are all taken as end of line markers — the length of a line may not exceed 1024 characters (bigTEX: 3000). If the editor used to create documents adds [figure: Ctrl]+[figure: Z]to the end of a file then this character must be immediately preceded by CR, CR/LF or LF — the last line may not end simply with [figure: Ctrl]+[figure: Z].

7.2 End of file

A [figure: Ctrl]+[figure: Z]character appearing at the beginning of a line is taken as an end of file marker. If a [figure: Ctrl]+[figure: Z]is not the first character of a line, it is taken to be a control code (see /r): if [figure: Ctrl]+[figure: Z]is intended to mark the end of a file then is must immediately follow CR, CR/LF or LF.

7.3 Interrupting emTEX

emTEX can be interrupted by [figure: Ctrl]+[figure: C](see [1] page 299) though this will only take effect when the following character is displayed on the screen. Under OS/2, emTEX can be terminated by [figure: Ctrl]+[figure: Break]though this should only be used in an emergency. If you can’t find a way to make emTEX stop, then, while it is waiting for input (and only then), enter [figure: Ctrl]+[figure: Z]followed by [figure: �].

7.4 File names

File names are truncated to 8 + 3 characters — at present simply by removing the following characters; for instance lcirclew10.tfm will be reduced to lcirclew.tfm before the file is sought. This method may be changed in a future release. Pathnames for files which appear in text input to TEX must have the “\” changed to “/” as “\” is taken as introducing a control sequence name; for example:

1bigTEX is still under development, a pre-release version is included here: the release version will be faster than this one.

\input /mytexts/myfile

7.5 errorlevel

In batch files the command “if errorlevel” can be used to determine whether emTEX has found an error while processing the document. emTEX returns 0 if no error has been found, returns 1 if only warning messages were issued, 2 if an error was found or the run was interrupted by [figure: Ctrl]+[figure: C]and 3 if emTEX stopped because of an internal error or because it ran out of memory or couldn’t proceed for any other reason.

A Character translation with the /c option

At present only one tcp file is provided: 850_tex.tcp. This converts some of the characters in code page 850 into TEX control sequences:

á \'a  â \^a  à \`a
ä \"a  ã \~a  å \aa{}
ā \b a  æ \ae{}  Á \'A
Â \^A  À \`A  Ä \"A
Ã \~A  Å \AA{}  Æ \AE{}
ç \c c       Ç \c C  é \'e
ê \^e  è \`e  ë \"e
É \'E  Ê \^E  È \`E
Ë \"E  í \'\i{}  î \^\i{}
ì \`\i{}  ï \"\i{}  Í \'I
Î \^I  Ì \`I  Ï \"I
ñ \~n  Ñ \~N  ó \'o
ô \^o  ò \`o  ö \"o
õ \~o  ø \o{}          ō \b o
Ó \'O  Ô \^O  Ò \`O
Õ \~O  Ö \"O  Ø \O{}
ú \'u  û \^u  ù \`u
ü \"u  Ú \'U  Û \^U
Ù \`U  Ü \"U  ÿ \"y
Ý \'Y  ý \'y  ß \ss{}
¶ \P{}  § \S{}  / c \leavevmode\hbox{\rm\rlap/c}
£ \pounds\{\}  \begin{matrix}c \\ ◯ \end{matrix} \copyright\{\}

Characters containing the control sequences \' or \` do not work in the LaTEX tabbing environment.

B Known errors

There is no error message when the disk becomes full while writing a file unless it is a temporary file under DOS.

References

[1] Donald E. Knuth. The TEXbook. Addison-Wesley, Reading, Massachusetts, 1984.