TeX/catcode

< TeX

< TeX

Synopsis

\catcode`\[char]=[num]

Description

\catcode is the command that's used to change the category code of a character. The category code tells TeX what to do when it encounters that character later in the text. A general assignment looks something like

\catcode`\@=11

which defines the @ character to be a letter.

The category codes in TeX are as follows:

Using category codes, it is possible to completely reconfigure TeX and allows support for international users.

A character of code 13 is called active. In a sense it is treated as if it were a command sequence in of itself, and definitions can be given in the normal fashion. Hence to define ~, Plain TeX has

\def~{...}


This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.