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 reason why the following verbatim section doesn't work as expected:

\begin{verbatim}
© copyright blahblah .....
\end{verbatim}

In fact I get: Âl’ copyright blah blah

Instead of the nice ©.

I will use the (c) notation, but anyway if you have a better solution, it will be welcome.


Full MWE demonstrating problem:

\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\begin{verbatim}
© copyright blahblah .....
\end{verbatim}
\end{document}
share|improve this question

1 Answer 1

up vote 17 down vote accepted

fontenc package deals with font encodings in the output file (pdf generally). But the font encodings in the input file are handled by inputenc package. Adding \usepackage[utf8]{inputenc} solves the problem.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}        %%<---- add this
\begin{document}
  \begin{verbatim}
     © copyright blahblah .....
  \end{verbatim}
\end{document}

enter image description here

Bonus There is a special offer for now ;)

To get rid of the warnings regarding font substitutions (and have some aesthetic looks), you may prefer to use some font like libertine:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{libertine}
\begin{document}
  \begin{verbatim}
     © copyright blahblah .....
  \end{verbatim}
\end{document}

enter image description here

share|improve this answer
    
A relevant post on the importance of that character encoding, and why the copyright symbol wasn't working without it: There Ain't No Such Thing as Plain Text. Or the article that's distilling, The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!). –  doppelgreener Mar 5 at 22:49
    
Thank you, it's work fine ! –  alexbuisson Mar 6 at 14:50

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.