TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use the unicode character ∞ in a LaTeX document. I use the default font. If this character is not defined in this font, I can replace it by $\infty$.

How can I do that?

I tried to play with \DeclareUnicodeCharacter{}{$\infty$} but did not find what to put in the first argument.

share|improve this question
2  
You should consider using xelatex for this. You can find an answer to your question here – Hamed Jan 15 at 15:10
    
oh I just see you tagged your question unicode-math are you using that package (and so xetex or luatex) if so DeclareUnicodeCharacter is completely the wrong thing and I will delete my answer. – David Carlisle Jan 15 at 15:14
    
No, sorry, I don't use xetex not luatex. – Colas Jan 15 at 15:57
    
I retagged then:-) – David Carlisle Jan 15 at 16:55
    
Thanks (I should have done it...) – Colas Jan 15 at 16:58
up vote 12 down vote accepted

∞ is U+221E so you want, for (pdf)teX

 \DeclareUnicodeCharacter{221E}{\ensuremath{\infty}}
share|improve this answer
    
Is there a difference if you use \ensuremath{\infty} vs $\infty$ in that declaration? – Alenanno Jan 15 at 16:39
2  
@Alenanno {$\infty$} would be wrong, possibilities are what I have or (arguably better) just {\infty} try $ x < ∞ $ to see the difference:-) – David Carlisle Jan 15 at 16:53

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.