EmTeX and the WorkPlace Shell

You don't need an integrated TeX environment to use emTeX under OS/2 2.0. An integrated environment comes with OS/2 2.0: the WorkPlace Shell. Here's a tutorial.

Note: texit.cmd can also be used from the command prompt under OS/2 1.3.

This has to be done only once:

Create an emTeX folder and put there program icon for texit.cmd. (see your OS/2 documentation for details). texit.cmd is available in the directory where you've found this file.

Enter "%**n" (omit the quotes) in the "Parameters" field of the program objects and leave the "Working directory" field empty.

You can also create program objects for vp.cmd (using the same settings) and prthplj.cmd, for instance. Then, you can print a DVI file by moving the icon of the DVI file onto the icon for vp.cmd or prthplj.cmd.

Make a copy of the "Data File" icon in the "Templates" folder (use Ctrl and the right mouse button) and rename it "TeX File.tex". (You'll get asked whether you want to keep the extension. Answer "No".)

This has to be done once per document:

Create a folder for your document: Drag a Folder icon from the Templates folder to somewhere. Rename the folder "textest", for instance. Drag the "TeX File.tex" icon from the Templates folder to the "textest" folder to create a new TeX document. Rename it "textest.tex".

This is how to use the icons:

Double-click on the icon to invoke the editor. %Format: lplain \documentstyle{article} \begin{document} Blah blah bla \end{document}

and save the file. Move the icon onto the texit.cmd icon. LaTeX will be invoked to compile the text. If the dvitest.dvi etc. icons don't show up automatically, select "Refresh" for the textest folder. Move the textest.dvi icon onto the dvipm icon to preview. Move the textest.dvi icon onto the prthplj icon to print.

Using menus

Put texit2.cmd (available in the same directory as this file) into a directory listed in the PATH environment variable, c:\emtex for instance. Change the "TeX File.tex" object in the Templates folder by opening the Settings notebook, choosing the Menu tab, selecting the "~Open" entry in the upper list box, selecting the lower "Create another..." button, filling the dialog box with "TeX" (Menu item name) and "texit2.cmd" (Program name).

After doing that, new "TeX File.tex" objects will have an additional item in the Open menu, TeX. Selecting that item will run texit2.cmd, which will call texit.cmd (which will call emTeX) to compile your TeX file (the "TeX file.tex" object).

texit.cmd details

texit.cmd is a batch file (written in REXX - it will run under OS/2 1.2 extended edition, OS/2 1.3 and OS/2 2.0) for running emTeX. It reads the first line of the input file to find out what format file to use for the input file. For instance, place %format lplain in the first line of your file to automatically choose lplain.fmt. You can also use %Format: lplain %format: lplain and %format lplain Text after the name of the format file will be ignored. You can insert any number of blanks between "%" and "format". You can insert any number of blanks between "format" (or "format:") and the name of the format.

The batch file also runs an editor if you correctly set the EMTEXED environment variable and exit TeX by typing e (see texware.doc or tex.doc). texit.cmd automatically chooses a unique temporary file name for the /a option.

texit.cmd calls tex386.exe if you're using OS/2 2.0 and if tex386.exe is present. Otherwise, texp.exe is used.

Icon for dvipm

Here's how to set the dvipm icon for vp.cmd: Open the settings notebook for dvipm.exe. Select the "General" page. Edit the icon. Select "Save as" and store the icon into dvipm.ico, for instance. Quit Icon Editor. Now you can select dvipm.ico as icon for vp.cmd.

This does not yet work

To make dvipm be called when you double-click a DVI file icon, open the settings for vp.cmd, select the Association tab, type "*.dvi" in the "New Name" field and press the "Add" button.

As the name of the Desktop folder contains special characters (a blank, for instance), this works only for DVI files in 'sane' directories, that is, folders that are not subfolders of the desktop folder.