[prev] [prev-tail] [tail] [up]

5.2 The compilers 

The emTeX TeX compiler for MS-Dos comes in six different versions:
for 8088/8086 processors
for 80186 and better processors
for 8088/8086 processors and very large documents
for 80186 and better processors and very `difficult' documents
for 80386 and better processors; this is a `big' version
for 80386 and better processors; this is a `huge' version. Its capacity is even higher than `big' TeX. There is no huge TeX compiler available for processors lower than 80386.

However, in 4TeX only the 80386 versions are used, i.e., tex386.exe and htex386.exe.

These programs use the emx dos-extender by default. If they detect there is no vcpi-host, but there is a dpmi-host, they will use the rsx dos-extender instead. This situation is likely to occur if you run 4TeX in an MS-Dos-box under MS-Windows or os/2.

If your machine doesn't have at least 3MB of memory, [h]tex386 may run very slowly. You'll need even more memory if a large part of it is already occupied (RAM disks, operating system).

Memory settings 

In case you find that TeX cannot compile a file because its capacity is exceeded (it will write such a message on screen and in the log file), and you are sure the TeX code is correct, you may need to use the huge version of the TeX compiler (see above).

The TeX compilers have default values for memory settings which can be changed to some extend by setting the environment variable EMTEXOPT. In section 5.2.2 some settings are listed. See the emTeX documentation (use [F3]) for more details and the [Ctrl][E] key in the main menu (Section 4.1).

The variable EMTEXOPT can be changed by pressing [Ctrl][E] in the main menu. 4TeX will show the current setting and all possible parameters and their ranges. You can edit the current setting. Press [Enter] when you have finished editing, and you will return to the main menu.

Note: The variable EMTEXOPT is automatically reset to its default by 4TeX each time you choose a new main file or format file.

5.2.1 Preparation 

The remainder of this section is of interest mainly for those who want to set up their own system. Or maybe you are just curious about what happens behind the scenes.

In order to make installation easier we define the environment variable EMTEXDIR which denotes the root of the complete 4TeX system, e.g. if you have installed 4TeX on the c: drive you set EMTEXDIR=C:\EMTEX. In case you run 4TeX from CD-rom and your CD-rom drive is drive D: you set EMTEXDIR=D:\EMTEX.4

TeX also needs some environment variables that tell it where to look for its files:

for .tfm files that contain font metrics. for styles and macros which are not in the format file; see below. for .fmt files, that contain hyphenation patterns and macros.

The big TeX version tex386 looks for the parameter BTEXFMT:

The huge version (htex386) looks for HTEXFMT.

Note: When TeX tries to find a any TeX text or macro input file it first searches the current directory, then the directories listed in TEXINPUT. We suggest that you run TeX from the directory where you keep your text files. However, it is also possible to add a directory to the TEXINPUT variable, e.g.,

4TeX will do that for you if you set MYTEXINPUT in texuser.<os> to such a directory. Similar remarks apply to the [B|H]TEXFMT variable and .fmt files.

The emTeX compilers can automatically search subdirectories of a given path. E.g., if you specify TEXINPUT=%EMTEXDIR\inputs! (note the exclamation mark), the compiler will search %EMTEXDIR\inputs and all its subdirectories (e.g., %EMTEXDIR\inputs\pstricks and %EMTEXDIR\inputs\bibtex) for input files. Note that the order in which subdirectories are searched is not determined. One exclamation marks stands for searching one level deeper, no more. If you want the compiler to search an the entire branch (subsubdirectories and deeper) you should supply two exclamation marks after the path name.

Beware that that currently not all programs that use these variables are capable of subdirectory searching, and some programs use a different syntax. 4TeX deals with these incompatibilities where necessary.

5.2.2 Command line 

The syntax of the compilers is

[H]TEX386 [options] [&<format>] [input file]
In the on-line documentation you can find a complete listing of options. Only a few options need to be described here (see also [Ctrl][E] in the main menu; Section 4.1): The &<format>5 parameter indicates a format file with preloaded macros and hyphenation patterns. These files reside in the directory indicated by [B|H]TEXFMT. For plain TeX the format is plain; for LaTeX latex2e. For the (obsolete) LaTeX version 2.09 the format is lplain. Most LaTeX formats provided by 4TeX contain hyphenation patterns for English, French, Dutch and German--which is why extra memory is claimed for hyphenation patterns. Format files are generated by running the TeX compiler with the /i option. This process is described in Sections 4.8 and 5.2.4.

[input file] should represent the name of a text file. An extension .tex is assumed if none is given. If no input file is given, TeX will run interactively, i.e., it will show the TeX prompt from which you can enter text.

Thus, a TeX command line might look something like

This command processes mytext.tex, using the (precompiled) LaTeX macro package latex2e.fmt and creates mytext.dvi from which the appropriate printer program can generate output. Error messages, statistics etc. will be written to the logfile mytext.log.

Any selection of options can be put in the environment variable EMTEXOPT--as is done by 4TeX. For example:

This would simplify the above command line to For details on running TeX, see your favorite TeX book. Remember: if you get the ? prompt, then you can terminate the TeX compilation by typing [X] followed by [Enter].

In case TeX can't find a file and asks you to type in a name, you can stop TeX by entering [Ctrl][Z], or cause it to skip a file by entering null. You can interrupt TeX by pressing [Ctrl][Break].

5.2.3 Connecting an editor 

TeX files can be prepared using any ascii editor. It is very convenient if the editor can display line numbers, as we will discuss below. While PC Magazine's ted won't do, the Norton Editor, Emacs, vde and WordPerfect's pe are all fine. If you don't mind changing editors, we suggest using TSE if you run 4TeX on MS-Dos, os/2 or MS-Windows 3.x. If you run MS-Windows 95 or MS-Windows NT PFE would be an excellent choice.

When TeX encounters an error and prints a questionmark, one of the answers you can give is [E] (from Editor). If the system is set up properly, this answer results in TeX being terminated and the editor of your choice being called.

Here is how it works: if TeX was called with an option /a<filename> and you entered [E] after the ? prompt, TeX will write certain information to <filename>. The environment variable EMTEXED controls what information. EMTEXED may contain parameters %1 for the line number, %2 for the input file and %3 for the logfile. For TSE Junior 4.0 you might set EMTEXED as follows:

Then TSE would load %2, which is the input file, and jump to line %1, which is the line where the error occurred. For PFE would have a similar effect. For vde: With vde you can't enter a line number on the command line; all you can do is load both the input file and the logfile.

Note: In a batch file (e.g., autoexec.bat) you'll need double percent signs:

Now we can load TeX from a batch file such as the following:
 @echo off
 if exist e.bat del e.bat
 tex386 /mt:65000 /ae.bat &plain %1
 if exist e.bat e.bat
When the compiler has finished, it may have written the batch file e.bat. If this batch file exists, it is called. e.bat in its turn will call your editor.

5.2.4 Format files 

4TeX version 4.71 as you find it on the CD-rom supports the following format files:

Except for conTeXt, which is only available as `huge' format, all formats are available in both `big' and `huge' format.

For documentation on plain TeX, LaTeX, and others we refer to the books listed in the bibliography and the on-line documentation.


With TeX 3.0 it has become possible to load hyphenation patterns for more than one language. To take advantage of this new feature some extra book keeping is needed. Babel is a TeX program that provides a simple way to generate TeX format files (see below) with multiple languages, and some control sequences to switch languages within one TeX document.

4TeX supports hyphenation patterns for the UK English, US English, Dutch, German, French, Russian, Portugese, Greek, Italian, Spanish, Polish, Turkish and several other languages, some even in different flavors. This means that you can generate a format (see Format menu, Section 4.8) that supports hyphenation for one or more of the languages above. From within a LaTeX document you can switch to and from any of these languages, provided you have included the matching LaTeX style files such as francais or dutch (see documentation of Babel).

Generating new format files

On the CD-rom (nearly) all format files are available in two versions: one `big' version (for BigTeX) and one `huge' version (for HugeTeX). The first resides in the directory indicated by BTEXFMT, and is generated by tex386. The second resides in the directory indicated by HTEXFMT, and is generated by htex386.

The easiest way to generate new formats is to start 4TeX and run the Format utility (see Section 4.8). Below we will describe step by step how you can generate a format file from the command line. All the environment variables that are needed are set by 4TeX, so the easiest way to generate formats is from a MS-Dos shell on top of 4TeX. Use [F9] from the main menu to start the shell.

First we will show how to generate the standard plain format.

The `huge' version is generated in much the same way, with these exceptions: Next we will generate the standard LaTeX format. The `huge' version is generated in much the same way, with these exceptions: Generating the LaTeX 2.09 format files with the New Font Selection Scheme takes a few more steps. The `huge' version is generated in much the same way, with these exceptions: The SliTeX formats (splain.fmt) are generated in almost the same way as the plain formats.

[prev] [prev-tail] [front] [up]