字符分类

mayflowers posted @ 2008年6月23日 19:07 in Latex , 1137 阅读

字符编码是以8-bit 为基础存储的,所以共有256个,在TeX中分为了16个类,分别编号为0到15:

  • 0 Escape character ( \ )
  • 1 Beginning of group ( { )
  • 2 End of group ( } )
  • 3 Math shift ( $ )
  • 4 Alignment tab ( & )
  • 5 End of line ( return )
  • 6 Parameter ( # )
  • 7 Superscript ( ^ )
  • 8 Subscript ( _ )
  • 9 Ignored character ( nulli )
  • 10 Space ( Space )
  • 11 Letter (A, . . . , Z and a, . . . , z)
  • 12 Other character (none of the above or below)
  • 13 Active character ( ~ )
  • 14 Comment character  ( % )
  • 15 Invalid character ( delete )

在这256个编码中,ASCII 码是7-bit 编码的,故其存储时最高位是0,即 0XXX XXXX,其中包含了所有的英文字符及标点、数字及控制键(还有一个换行,键盘上没有)。ASCII 编码没有用到128个编码即 1XXX XXXX 用来表示汉字是不够的,所以汉字在此基础上又加了一个字节,即用两个字节即16-bit 来存储,其中第一个字节最高位为1,这样最多会有 128*256 个中文字符。系统发现一个字节的最高位是 1 时,就会把这一位和下一位当成一个中文字符处理,否则就认为是一个 ASCII 码。

在TeX的字符分类中,第13类 active character 的作用是当tex 读取到这类字符时不将其输出,而是去执行其代表的动作。

\catcode '\<字符> = <类> % 将 <字符> 设为 <类>;
\def <字符>{\action% 定义 <字符> 代表的动作。
% 这样当系统遇到 <字符> 并不显示该字符而是执行 \action.
% 其中 <字符> 可以使用 ^^xx, xx 表示内码的16进制值。
How To Increase CIBI 说:
2022年8月07日 15:01

It basically means that if you have a bad CIBIL score then your chances of getting credit may lower heavily which means you might not be able to receive the loan, credit card, or the EMI on any product you want not accepted. How To Increase CIBIL Score From 600 To 750 One of the important aspects is that a CIBIL score may improve to 750 and more but it sometimes takes more than 3 months to maintain better financial stability, and if you are in pique to get better credit and loans? Then you should follow our below article which will help with the steps to follow to improve your CIBIL Score from 0 to 750 in quick time.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter