1

I found a lot of answers to my questions in this forum but this time I have to create a new question.

I wanted to use the letter ø in my document, and because there was no easy solution for this, someone told me to use the command \char28 to create this letter.

As I understand, this solution is specific to the font I am using because it is somehow printing the letter stored in the slot that is defined by the number.

My question is now how can I find out which number produces which letter in my PDF?

Thank you in advance.

  • If your question is about printing the letter ø there is an easy answer: \usepackage[utf8]{inputenc}. Welcome to TeX.SE – Moriambar Apr 7 '17 at 19:11
  • 2
    the standard command for ø in both plain tex and latex is \o or you can simply use ø if you are using the inputenc package. using numbers should be a last resort and even then only use them to set up command definitions so if you change encoding you only have to change the numbers in one place. – David Carlisle Apr 7 '17 at 19:12
  • 1
    "I wanted to use the letter ø in my document, and because there was no easy solution for this, someone told me to use the command \char28 to create this letter. " Really seems like you're asking the wrong question to me – Au101 Apr 7 '17 at 19:21
8

The standard command for ø in both plain tex and latex is \o or you can simply use ø if you are using the inputenc package. Using numbers should be a last resort and even then only use them to set up command definitions so if you change encoding you only have to change the numbers in one place.

However to answer the question as asked, use texdoc encguide to see the encodings known to latex

In the first table of appendix A you see ø in position hex 1C (decimal 28) in the OT1 classic 7-bit font used by tex originally and still the default in latex on 8bit tex systems. In the 8bit T1 encoding (table on page 22) you see ø in position hex F8 (decimal 248). It is also in position hex F8 in Unicode (the TU encoding as used in lualatex and xelatex by default).

However you should almost never need these numbers.

  • Thank you for your answer. This is exactly what I wanted to know :) – Guemmel Apr 7 '17 at 20:40
  • Is the inputenc package really enough, without any option, to input all Unicode characters directly? I can't check myself now. – lblb Apr 8 '17 at 18:59
  • '@lblb inputenc is enough to understand all unicode code points (that is, it can decode UTF-8 encoding) but by default, with no packages you have a font with 256 characters so no, it can not handle all of Unicode. the initial settings do however cover all Unicode code points that can be reasonably covered by T1 encoded font, that is all the latin1-characters and all the standard accents combined with those characters as base. – David Carlisle Apr 8 '17 at 19:33

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.