Using code pages in TEX (the cptex macro package) March 28, 1994

1 Introduction

Now you can simply type all your national and special characters in TEX as you normally type it with your keyboard and see it on the screen. The only thing you must do is to input the cp.tex file (Plain-TEX) or to include the suitable cpnnn-option in your \documentstylecommand, where nnn is the number of the code page you are using with your computer.

Currently the following code pages are available:

• CP 437 : The DOS and OS/2 code page 437 (U. S. PC encoding).
• CP 850 : The DOS and OS/2 code page 850 (International PC encoding).
• CP 8859 : The ANSI code page ISO-8859-1 (Latin 1)

used by Microsoft Windows and most Unix systems.

• CP 8859w: The ANSI code page ISO-8859-1 (Latin 1)

with extensions from Microsoft Windows.

2 Registration

If you like this TEX macro package, please send me a fee about $ 25 or more for registration, so that I can make them better and create more TEX-macros. If you send $ 50 or more you will receive additional macros for a fine \slashfrac and for using PostScript fonts and colors (needed by cpps!). Please state the version of the software that you currently have.

Send check or money order to: Martin Krämer Adolf-Kolping-Straße 4 D–49179 Ostercappeln (Germany)

My e-mail address is: kraemer@mathematik.Uni-Osnabrueck.DE

P. S.: If you have some nice pictures from Marina Sirtis (Counselor Deanna Troi in STTNG), please mail me.

3 List of files

This package contains the following files:

cpdoc.tex  This documentation as LaTEX-file
cpdoc.dvi  This documentation as DVI-file
cptable.ps A sample PostScript-file with tables of the code pages
cpemtex.zip Some .bat- and .cmd-files for emTEX-installation
lamac.tex  Some macro extensions from LaTEX for use with Plain-TEX
cp.tex  The main Plain-TEX input file
cpps.tex  The Plain-TEX input file for use with PostScript-DVI-drivers
cp.sty  The main style option file
cp437.sty  The style option file for code page 437
cp850.sty  The style option file for code page 850
cp8859.sty The style option file for code page 8859
cp8859w.sty The style option file for code page 8859w
cpps.sty  The style option file for use with PostScript-DVI-drivers

4 Installation

To use this macro package you need a TEX executable program from version 3 on, i. e. a TEX with full 8-bit character support.

To install the package just copy all the .tex- and .sty-files in your texinputs-directory.

If you want to use the PostScript-option cpps, you need additionally the style file colors.sty and some macros for using PostScript-fonts in LaTEX which you can get from me (see Registration).

4.1 Installation notes for emTEX

To use this package with emTEX you must first rebuild the .fmt-files with options “-8 -o -r” to enable full 8-bit character support. For this purpose you can use the included .batand .cmd-files for DOS and OS/2. Just unzip the cpemtex.zip-file with the option -d and copy the files from the created tex8fmts- and btex8fmt-directories in the emtex\texfmtsand emtex\btexfmts-directories respectively and execute the copied .bat- or .cmd-files.

5 Features

The code page styles offer a lot of features against the standard TEX-macros for typing national and special characters. Some of these things are listed below:

• The non-math version of the commands for national and special characters work now correctly also in math mode (with respect of displaystyle, textstyle, scriptstyle and scriptscriptstyle).

• The special math constructs used for some characters work also properly in text mode with the correct font selection.

• The commands work properly in the protect modes of \write and \edef/\xdef. The commands expand simply to itselves with proper spacing after control sequences consisting of letters in protected write mode.

• The control sequences consisting of letters ignore also a following empty pair of braces (“{}”) for easy usage and proper kerning (e. g. \ss{} is always correct: Stra\ss{}e or Flu\ss{}␣).

• All commands for national characters work properly in any combination of \lowercase and \uppercase (e. g. \uppercase{\ae{} ä ß} produces “\AE{} Ä \SS{}”).

• The additional code page characters work fine in verbatim-environments, they just produce their layouts. And most of them work also fine in tt-style, i. e. then they have the same width.

6 Usage

To use the cptex macro package just put an “\input cp”-command at the beginning of your document (Plain-TEX) or put the suitable cpnnn-option in your \documentstyle-command, where nnn is the number of the code page you are using with your computer. The main cp-option selects by default no code page as the cp.tex-file does.

If you are using also the file german.sty, then it must be loaded before any cpxxx-file to work correctly.

6.1 Selecting a code page

With the command \selectcodepage[opt1, opt2, …]{number} you select the code page number with options opt1, opt2, . . .. The option-list can be left out. The command sets implicitly a language-specific option (see \selectlanguage) if specified in the code page and german.sty is used. This can be overriden by the option original.

The \selectlanguage-command from german.sty will also activate or deactivate a given language-specific option.

The cpnnn-options select by default the code page nnn with no explicit options.

6.1.1 Common options for all code pages

The following options are available for all code pages:

original Resets original meanings for the specific code page
german  Language-specific option for German (see specific code page)
ascii  Using true ASCII instead of TEX’s ASCII version (this affects

the characters *, <, >, \{, | and \} to work also fine in non-math mode)

fullascii Using full ASCII with apostrophe and grave accent instead of quotes
vert  Using \vert instead of broken vertical line

(only available if character 124 is a broken vertical line)

This options can be also used with the dummy code page texascii, which is defined in

cp.tex or cp.sty.

6.1.2 Code page 437 (U. S. PC encoding)

This code page is used by DOS and OS/2. The corresponding style option cp437 enables the full 256 character set (except TAB, LF and CR, which keep their special meanings – but the symbols are accessible via macros). In Plain-TEX the male/female symbols and the musical notes are currently not available.

The following options are available:

german Using es-zet instead of beta
emdash Using em-dash instead of graphic symbol for horizontal line
neg  Using logical not instead of end of line symbol
Vert  Using \vert and \Vert instead of the corresponding graphic symbols

6.1.3 Code page 850 (International PC encoding)

This code page is used by DOS and OS/2. The corresponding style option cp850 enables the full 256 character set (except TAB, LF and CR, which keep their special meanings – but the symbols are accessible via macros). In Plain-TEX the male/female symbols and the musical notes are currently not available.

The following options are available:

emdash Using em-dash instead of graphic symbol for horizontal line
Vert  Using \vert and \Vert instead of the corresponding graphic symbols

6.1.4 Code page ISO-8859-1 (Latin 1)

This ANSI code page is used by Microsoft Windows and most Unix systems. The corresponding style option cp8859 enables all defined characters in the upper half of the character set. The undefined charcters are made invalid, i. e. they produce a TEX-error if encountered.

The following option is available:

german Using german right quote instead of english left quote

6.1.5 Code page ISO-8859-1 (Latin 1) with extensions

This code page is a superset of the standard ANSI code page with some additional characters used by Microsoft Windows. The corresponding style option cp8859w enables all defined characters in the upper half of the character set. The undefined charcters are made invalid, i. e. they produce a TEX-error if encountered.

The following option is available:

german Using german right quotes instead of english left quotes

6.2 Character layout improvements

To improve the quality of the printed characters you have the following possibilities:

1. If you have the AMS-TEX-fonts available, then include a macro with the definitions for the additional AMS-TEX-symbols before including any cpxxx-file.

2. If you are using a PostScript-DVI-driver, then include also the cpps.tex-file (after the cp.tex-file) in your document (Plain-TEX) or the cpps-option in your \documentstylecommand.

3. Use possibilities 1 and 2 together. This gives nearly a perfect layout for all characters.

7 Future enhancements

The following tasks will be implemented in a future version of this package:

• Implementing an option for making some special characters (accents and the surdsymbol) to work as the corresponding macros.

• Making some character layout improvements with L^{A}_{M}S-TEX-fonts.

• Support for the new TEX DC/EC-fonts.

• Full support for PostScript fonts.

• New code pages (e-mail me your wishes).

• Support for VM/CMS-TEX (if someone has an EBCDIC-TEX with 8-bit character support, then please e-mail me for some testing).

• Adding a program to convert TEX-files between the code pages.