4TeX LST files

To allow users to add or change the functionality of 4TeX, the program not only starts 4DOS batch files but also uses 4TeX LST files. These LST files can be found in the same directory as the 4TEX.EXE and have the file extension ".LST". Most of these files are language specific. The first two characters of the filename indicate the language. For instance, the file that contains the list of all TeX format files for the US English language is US_FRM.LST, for Dutch it is NL_FRM.LST, and the DE_FRM.LST is used for the German language. There are also four LST files which areindependent of the language: GRAPHTYPE.LST, OWNTREE.LST, HYPHEN.LST and MAGSTEPS.LST

All (except one) language dependent LST files have the same structure. The odd lines of the file contain a description that is used when displaying a 4TeX selection menu. The even lines are the commands that are used when programs are started or are passed through 4DOS batch files. For instance the US English format LST file US_FRM.LST could look like:

LaTeX 2e
   LATEX.EXE
Huge LaTeX 2e
   HUGELATEX.EXE
Plain TeX
   TEX.EXE
Huge Plain TeX
   HUGETEX.EXE
Plain e-TeX
   ETEX.EXE &plain-etex
Plain pdfTeX
   PDFTEX.EXE  &plain-pdftex
pdfLaTeX
   PDFLATEX.EXE
ConTeXt (English)
   &4DOS context.btm . en
ConTeXt (Dutch)
   &4DOS context.btm . nl

When pressing the "Choose format" button in the main menu the "Choose (La)TeX format" menu is displayed:

From this example it is clear that the odd lines of US_FRM.LST are displayed in the menu. When selecting for instance the "pdfLaTeX" this means that the program PDFLATEX.EXE is used when you press the "Compile" button in the 4TeX menu.

NB: The even lines can be indented but this is not required. The only purpose is to make odd lines and even lines easier distinguishable.

NB: The odd lines specify a program with or without parameters and with or without a full pathname. Since the executables of the Web2C distribution are all stored in the same directory this directory is added to the PATH environment string and hence there is no need to add a full pathname to the program name.

NB: You can easily add your own programs to a LST file by adding two lines (a description line and a line specifying the program). It is also possible to rearrange the LST file so that the selections you prefer are displayed first.

Below you will find a list and explanation of all the LST files that are used. Some of these LST have extra functionality/options which is explained below.

US_BIBED.LST

A list of all the editors that can be used for BibTeX files. There is one special option in this file: instead of typing the program name of your editor you can use
   &editor

4TeX will use the editor that is specified in the 4TEX.INI file as the BibTeX editor.

US_FRM.LST

A list of all the compilers and (La)TeX formats that can be used with 4TeX.

When the special command &4DOS is used, a 4DOS session is started (with appropriate parameters as specified in the 4TEX.INI file) and the program (often a batch file and specified as a parameter after the &4DOS statement) is executed. E.g. for ConTeXt we need not only compile the document but also do some extra things. This is solved in a batch file called CONTEXT.BTM You will see that the lines in US_FRM.LST will look like

   ConTeXt (English)
      &4DOS context.btm . en

US_INTRO.LST

An informational text that is displayed during the 4TeX initialization and hence doesn't follow the convention of odd and even lines.

US_PRD.LST

A list of all the possible print destinations. Note that there is one special printer destination: Print to File. This option requires a blank line as program name, and will display a file dialog menu asking to which file the output should be written.

US_PRN.LST

A list of all available printer types. Note that using the same printer program with different parameters provides another printer type.

US_SPELL.LST

A list of all available languages for spell checking. In 4TeX we use 4Spell. It is easy to change the spell-checker to, e.g., ISpell by changing the spell-checker program in 4TEX.INI.

US_UTILS.LST

This probably will be the first LST file a user wants to change. It contains many 4TeX screens: all specified by a program name with an ampersand (&) in front of it. For instance &bibtex will start the 4TeX BibTeX menu. Also the &web2cbin string as part of a program path will be changed into the pathname where the Web2C windows executables are stored. This allows specifying programs without hard coding the pathname. Since you often want to start utils with the main TeX file name (or part of the name) or the Current TeX file name the following strings are possible.

&mainpath
the pathname of the main TeX file
&mainfile
the filename (without file extension) of the main TeX file
&mainext
the file extension of the main TeX file
&main
the full Main TeX file name (path + file + extension)
&currentpath
the pathname of the Current TeX file
&currentfile
the filename (without file extension) of the Current TeX file
&currentext
the file extension of the Current TeX file
&current
the full Current TeX file name (path + file + extension)

For instance, the string &mainpath&mainfile.dvi for main TeX file c:\texfiles\sample.tex will expand to c:\texfiles\sample.dvi. This makes it possible to create your own programs or batch files and passing the correct files to them.

Below a list of all 4TeX screens that can be called:

&bibtex
BibTeX menu
&makeindex
MakeIndex menu
&metafont
Metafont menu
&metapost
MetaPost menu
&advance
Advance 4TeX options
&makeformat
Generate (La)TeX format menu
&cleanup
Clean up files menu
&conversiontools
Conversion menu
&graph
Graphic conversion menu
&project
View TeX project
&mandoc
Select and show manual page
&helpdoc
Select and show Windows help file
&run
Run program

When the special command &4DOS is used, a 4DOS session is started (with appropriate parameters as specified in the 4TEX.INI file) and the program (specified as a parameter after the &4DOS statement) is executed. This &4DOS option makes it possible to redirect console output programs to the "redirection" window. When the &4DOS option isn't specified the output of console programs is echoed to a "Dos" box instead of redirected to the "redirection" window.

US_VIEW.LST

A list of available previewers. Note that the PostScript previewer and PDF previewer use the same 4DOS batch file with different parameters. This is again an example how a user could add his own functionality to 4TeX.

GRAPHTYP.LST

This LST file is not language specific. It contains a list of all available graphic formats that are supported in the graphic conversion menu. The even lines indicates how the graphics formats (specified in the odd lines) are displayed. If not specified a default viewer (ImageMagick) is used.

OWNTREE.LST

This file is used during the 4TeX initialization. This file contains all the subdirectories of the "owntextreedir" (see 4TEX.INI) that have to be created.

HYPHEN.LST

This LST file is not language specific, but has the same structure of odd and even lines as described above. This file is used when generating new (La)TeX formats, i.e. it contains a list of all available hyphenation files that can be used when generating a format.

MAGSTEPS.LST

This file is not language specific. It contains a list of available magnifications of a printer (see printer options).

NB: When using a batch file (.BAT) or a 4DOS batch file (.BTM) as the program that has to be executed within 4TeX, the menu will automatically start a 4DOS session (with parameters as specified in the 4TEX.INI file with the parameter 4DOSOptions) and run the batch file. When the batch file doesn't contain a pathname it will assume that it is stored in the directory specified by the parameter 4TeXBTMDir in 4TEX.INI. When specifying a program without a pathname the PATH environment string is used. It is also possible (as within Windows) to use programs that have other than .EXE and .COM extensions. I.e. 4TeX will use the programs with these files as specified under the "Windows Viewer type". For instance entering "US_4TEX.HLP" as a program will start the windows help system and displaying the 4TeX help file.