1

When I typed, an apostrophe ' displays the text "âAZ". Does anyone have an idea of why this might be?

I'm using an atom package to compile the LaTeX file.

  • 3
    what is atom ? I would guess you did not use the ' but the right quote and that you entered the ' character in UTF-8 but declared the file encoding as latin 1 (or did not declare an encoding at all) but as you have shown no example, it is just a guess. – David Carlisle Mar 17 '17 at 21:20
  • 1
    Welcome to TeX. SE. Please show a minimal working example, which will reproduce your probe, Help us to help you! – Zarko Mar 17 '17 at 21:28
  • 1
    You have something like \usepackage[T1]{fontenc} in your file, but you don't have \usepackage[utf8]{inputenc} as well. Those three letters are what happens when the numeric value of the tokens created by \IeC{\'} get mapped to glyphs. If you include \usepackage[utf8]{inputenc} in your preamble you should get what you want. The atom editor is just running latexmk, so it shouldn't be the issue (I think). – Charles P. Schaum Mar 17 '17 at 22:03
  • @CharlesP.Schaum most likely inputenc is the required solution although the standard T1 internal processing such as \IeC{\'} won't generate those three byte sequences, rather the input file must have UTF-8 characters which are not being combined (as ascii input is assumed) – David Carlisle Mar 17 '17 at 22:57
11

Presumably you do not get âAZ but âĂŹ

\documentclass{article}
\usepackage[T1]{fontenc}

\begin{document}

[’]

\end{document}

Produces

enter image description here

To see why, see that is U+2019 that is, the character with value hex 2019.

In UTF-8 encoding, characters in that range take three bytes, in this case E2 80 99

Unless told to interpret such triples via the declaration

\usepackage[utf8]{inputenc}

pdftex will assume three bytes denote three input characters with codes E2, 80 and 99 respectively.

If you specify the 256-character single-byte encoding, T1, is being used for fonts with the declaration

\usepackage[T1]{fontenc}

then latex will typeset the characters in those slots in T1 encoding which are â, Ă, Ź

E2 (â) matches the encoding of â in Latin-1, but 80 and 99 are in the control character range in latin 1 and Unicode but the TeX-specific T1 encoding fills the full 256 range with characters as control character slots are not useful for typesetting.

enter image description here

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}

[’]

\end{document}
5

Add \usepackage[utf8]{inputenc} to fix the issue.

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.