Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need a replacement for the \Unicode macro from CJK. It takes two decimal numbers as arguments and inserts #1*256 + #2 into the token stream (or something like that; it's a way to write Unicode characters by code like A in XML).

That should be possible with a tiny bit of lua code. Any pointers?

share|improve this question
    
Would \char\numexpr#1*256+#2\relax suffice? –  egreg May 16 '11 at 20:35
    
That seems to work, too. Please create an answer so that I can accept this. –  Aaron Digulla May 16 '11 at 21:19

1 Answer 1

up vote 4 down vote accepted

As far as I can tell, a definition such as

\newcommand{\Unicode}[2]{\char\numexpr#1*256+#2\relax}

should be what you need.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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