Re: unicode failure with inputenc package



On Jun 3, 12:29 pm, Ulrike Fischer <ne...@xxxxxxxxxxx> wrote:
Am Tue, 3 Jun 2008 04:14:27 -0700 (PDT) schrieb r:

Readers,

I tried to add the degree sign (°) and received the error shown below.
According to a search in this forum, this package is supposed to be
utf8 compliant (Frank Mittelbach, 26-05-03). I have read the package
documentation for inputenc (my local disk installation
file:///usr/share/doc/tetex-doc-3.0/latex/base/inputenc.dvi), but this
does not state that utf8 is included (there is a list of various latin
iso, ibm cp encodings amongst others). I'm confused by this apparent
contradiction.

I also tried \textdegree but the result was also an error: "undefined
control sequence".

inputenc can declare any unicode char, but as default it sets up only
the commands for a small part of unicode -- the chars it thinks you will
use in the document -- and it use the encodings you loads with fontenc
to determine this part.

The textdegree sign is part of the TS1-encoding. So you should load the
TS1-encoding, then ° will be mapped to \textdegree, and you should also
define \textdegree. Both together can be done by loading the package
textcomp:

\documentclass[a4paper, 12pt]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[utf8]{inputenc}
\begin{document}
° \textdegree
\end{document}

--
Ulrike Fischer

What to do if I want all utf8 character encoding to be accepted
automatically for all tex documents that I create?
.