I have

 (appendq! prettify-symbols-alist '(
           ("_\\infty" .    (? (bl . cl) ?∞))     ;; works
           ("_{-\\infty}" . (? (bl . cl) "-∞"))   ;; does not work

to prettify the text _{-\infty} to -∞ in a subscript (I am writing LaTeX). While the first works, the second does not work. Presumably something’s wrong with escape characters, but I could not find the flaw. Any help appreciated.

Thanks to the response below, this works:

           ("_\\infty" .    (? (bl . cl) ?∞))
           ("_{-\\infty}" . (? (bl . cl) ?- (br . cl) ?∞))

1 Answer 1


You've used a list for your CHARACTER argument, regarding which compose-region tells you:

If it is a vector or list, it is a sequence of alternate characters and composition rules, where (2N)th elements are characters and (2N+1)th elements are composition rules to specify how to compose (2N+2)th elements with previously composed N glyphs.

So your elements have to be characters and composition rules, whereas "-∞" is a string, not a character.

No doubt you will want to decide how you want to compose the individual characters of that string, and use the appropriate composition rule between them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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