Please how can I insert these unicode symbols in the range u2400 to u2421. They are names of control characters.

You can see them here: http://unicode.org/charts/PDF/U2400.pdf

I could find the package keystroke which has very nice keys, but that is not what I want.


-- Edited:

Quoting Marco: "The problem is to find a font that contains these characters."


It mostly depends on your setup. If you're using XeLaTeX or LuaLaTeX and fontspec it all boils down to

\newfontfamily{\lowasciifont}{Free Sans}

in the preamble and \lowascii{2400} and so on in the document. Example:

\newfontfamily{\lowasciifont}{Free Sans}

\lowascii{2400} \lowascii{2401}

enter image description here

Without XeLaTeX or LuaLaTeX I don't know of any font that has those symbols. One might conceive to create suitable Type1 fonts from FreeSans, but it's quite a job and probably its easier to fake those symbols with some low level trick.

Here's an example:

  \sbox0{#1}\dimen0=\wd0 \box0
  \sbox0{#2}\moveright\dimen0\copy0 \advance\dimen0\wd0

In the text you can say

A \lowascii{NUL} \lowascii{LF} B

and get

enter image description here

  • You did a very good job on this explanation. Thanks! I think if I don't find a font, I'll probably do the trick you taught. – Dr Beco Apr 10 '12 at 15:02
  • 3
    The "Free Mono", "Free Sans" and "Free Serif" fonts have the symbols. Also "Arial Unicode MS". – egreg Apr 10 '12 at 15:09
  • Dear @egreg, can't find more information about free mono and free sans. Google think these words are to wide as keywords. Do you know a place where I can find the name of the symbols inside these fonts? Thanks in advance! – Dr Beco Apr 10 '12 at 15:34
  • @DrBeco The "Free" fonts are already available in TeX Live: they are part of the GNU project. – egreg Apr 10 '12 at 15:36
  • Ok, but I still need to know the character name. For example, like in keystrokes package, I can use \Del. How can I get the character names for those fonts? – Dr Beco Apr 10 '12 at 15:38

The problem here is not how to enter the characters. You enter them as you enter all other characters, which depends on your keyboard layout and editor configuration. Either you enter them directly, you create a mapping for often used ones or you enter the unicode values directly. E.g. in vim you can do this with <CTRL-V>u<unicode_number>.

The problem is to find a font that contains these characters.

  • Thanks for clarification. I'll edit the question to include the problem description you gave. – Dr Beco Apr 10 '12 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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