No Disconnect

Things I’d rather not forget

Insert characters around characters in XeLaTeX (for RTL languages)

leave a comment »

In typesetting RTL documents in XeLaTeX, I have found that characters such as colons or parentheses don’t set properly—adjacent numbers disappear, etc. The code below makes TeX place empty hbox’s around each colon in a document. No further references to macros are necessary.

 

\def\colon{:}
\catcode`:=\active
\def:{\hbox{}\colon\hbox{}}
Advertisement

Written by nodisconnect

December 3, 2011 at 3:36 am

Posted in TeX/LaTeX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.