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.

Is there a macro for formatting numbers in programming style 0x hex notation, e.g. instead of -1155484576 have 0xbb20b460. I would like to embed these numbers in a math mode context.

E.g. if I just type

$\langle 0xbb20b460, 0xd4d95138, 0x3d93cb7a \rangle$

the numbers aren't properly displayed.

share|improve this question
1  
Put \text{} around them (amstext or amsmath packages). Also, since the notation 0x is used in programming, perhaps you could also use a monospaced font. Use \texttt{} in this case. –  JLDiaz Mar 3 '13 at 1:15
    
Thanks, just using \texttt is actually not that bad, looks ok. –  Emit Taste Mar 3 '13 at 10:27
1  
I'd choose \mathtt, so not to risk the font comes out italic in an italic context. –  egreg Mar 6 '13 at 11:41
add comment

1 Answer

up vote 3 down vote accepted

Ok, so using \texttt or \mathtt is fine.

share|improve this answer
add comment

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.