Quantcast
Channel: Convert integer to its ASCII character - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 4

Convert integer to its ASCII character

$
0
0

In the ASCII table, …

  • ! (exclamation mark) is also a printable character and its decimal representation is 33
  • a (latin small letter a) is a printable character and its decimal representation is 97
  • } (right curly bracket) is also a printable cahracter and its decimal representation is 125

I want to know if there's a macro in LaTeX that converts a decimal representation to its ASCII character.

\symbol{...} returns a for 97 and ! for 33. I thought that \symbol{...} accomplished what I am looking for, but it returns ˝ (double acute accent) for 125.

\documentclass{article}\begin{document}\symbol{33} % exclamation mark\symbol{97} % latin small letter a\symbol{125} % it should return "right curly bracket", but it returns ˝ (double acute accent)\end{document}

enter image description here

My question is: In the context of LaTeX, is there a built-in macro to convert an integer (i.e. decimal representation) to its ASCII character? The macro should work for any printable character in ASCII (i.e. between the range 32 to 126.)

I found this question which is similar to my question, but it was conflated with the definition of "extended ascii table".


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images