The (u)ptex manual states that the CJK characters have kcatcode 16-18 (14-20), however, it seems impossible to assign catcode 13 (active characters) to them.
Admittedly, assigning CJK characters as active characters has very limited usage. But it may be helpful in some cases (to do some trick), for example, I notice that in a printed Japanese bunko book, the contents delimited by full-width brackets “()” always has a smaller font size. If we are able to change the character code of these brackets, we can actually write very decent code like this (though with a little bit risk):
\makeatletter
\let\old@lparen(
\let\old@rparen)
\catcode`(=\active
\catcode`)=\active
\protected\def({\begingroup\small\old@lparen}
\protected\def){\old@rparen\endgroup}
\makeatother
However, this will throw an error as stated in the manual.
While such issues always have a workaround (for example defining a user macro and apply such macro every time), I wonder:
- if there is any trick that could achieve similar effect?
- In XeLaTeX, such modification is actually feasible! What is the reason behind the design of (u)ptex to prevent catcode modification of Unicode characters?
Any help or explanation is much appreciated. Thank you!
The (u)ptex manual states that the CJK characters have
kcatcode16-18 (14-20), however, it seems impossible to assign catcode 13 (active characters) to them.Admittedly, assigning CJK characters as active characters has very limited usage. But it may be helpful in some cases (to do some trick), for example, I notice that in a printed Japanese bunko book, the contents delimited by full-width brackets “()” always has a smaller font size. If we are able to change the character code of these brackets, we can actually write very decent code like this (though with a little bit risk):
However, this will throw an error as stated in the manual.
While such issues always have a workaround (for example defining a user macro and apply such macro every time), I wonder:
Any help or explanation is much appreciated. Thank you!