[Moved from StackOverflow.com]

How can I format certain characters without using macros? For example, if I want to make all instances of the character ‘f’ bold, how can I make TeX do it automatically?

I’m using XeLaTeX to process my document.

(Actually, the document is written in Simplified Chinese. The Asian full stop symbol (‘。’, U+3002) in my fonts, however, have their small circle placed at the center, which is inconsistent with the standard of the Chinese Mainland. Since full stops appear after every sentence, it would seem too cumbersome to use macros.)

  • Can you not make it active and then define it like a macro to get the behavior you want? – TH. Sep 16 '10 at 9:17
  • Shame I didn’t know how. – ȷ̇c Sep 16 '10 at 9:42

One way is to make the char active and then define it. Here an example (its dangerous to do it for ascii chars I'm doing it only as example!)



If you only want to use another glyph in your font you can also use a mapping, like the tex-text mapping which maps e.g. -- to \endash. You need teckit to generate such mappings.



If you're talking about characters in text mode, I'm afraid there isn't a good way to do this automatically. However, Paul Isambert's xesearch package might be able to achieve the effects you're after.


You'd better use a Chinese font for Simplified Chinese, e.g. 'SimSun', 'Adobe Song Std' and free 'AR PLBaosong2GBK Light'. The full stop is at correct position for Chinese Mainland.

In XeTeX, these work can be done by using \XeTeXinterchartoks and \XeTeXcharclass, this is how xeCJK and ucharclass package works. See this question for detailed (but lowlevel) example: Font selection in XeTeX for specific characters

BTW, it seems you didn't know xeCJK package. It can deal with Simplified Chinese punctuations properly.

  • Thanks and yes I do know and use the xeCJK package which is almost mandatory for typesetting Chinese text (isn’t it?) and have quite a number of Chinese fonts (most are Big5-encoded). My current solution is based on Ulrike's answer. – ȷ̇c Feb 24 '11 at 6:06
  • Big5 fonts may be still inconsistent with the standard of the Chinese mainland, some glyphs are different. Strict publishers might refuse to use them. In addition, some OpenType fonts, like Adobe Song Std, support different punctuation positions. – Leo Liu Feb 24 '11 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.