Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unicode does not work in table of contents?

616 views
Skip to first unread message

David Portabella

unread,
Sep 19, 2007, 6:12:29 AM9/19/07
to
This simple example has three chapters. the second one has a title
with unicode characters in it.
("Abstract" in French is "Résumé").

Using pdflatex:
While the chapter is well written (with the two accents),
in the table of contents appears: "R[Please insert into
preamble]sum[Please insert into preamble]"

+++++++++++++++++++
\documentclass[12pt]{book}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[francais, english]{babel}
\usepackage[pdftex]{color,graphicx}
\usepackage[pdftex,bookmarks,colorlinks,breaklinks]{hyperref}

\begin{document}

\tableofcontents

\chapter{Abstract}
\chapter{Résumé}
\chapter{Resum}

\end{document}
+++++++++++++++++++++

What can be the problem?

Many thanks,
DAvid

Robin Fairbairns

unread,
Sep 19, 2007, 11:27:30 AM9/19/07
to
David Portabella <david.po...@gmail.com> writes:
>This simple example has three chapters. the second one has a title
>with unicode characters in it.
>("Abstract" in French is "R=E9sum=E9").

>
>Using pdflatex:
>While the chapter is well written (with the two accents),
>in the table of contents appears: "R[Please insert into
>preamble]sum[Please insert into preamble]"
>
>+++++++++++++++++++
>\documentclass[12pt]{book}
>\usepackage{ucs}
>\usepackage[utf8x]{inputenc}
>\usepackage[francais, english]{babel}
>\usepackage[pdftex]{color,graphicx}
>\usepackage[pdftex,bookmarks,colorlinks,breaklinks]{hyperref}
>
>\begin{document}
>
>\tableofcontents
>
>\chapter{Abstract}
>\chapter{R=E9sum=E9}

>\chapter{Resum}
>
>\end{document}
>+++++++++++++++++++++

(note that something has converted your utf-8 (or whatever) into
iso-latin-1. i converted the source back while checking what had
happened.)

you don't mention the warnings from hyperref on first pass, saying
things like

Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `\begingroup' on input line 13.

which were the first sign that things were going to turn out bad.

>What can be the problem?

the bad news is, it appears to be a bug in the way ucs.sty/utf8x.def
process utf-8.

the good news is, the latex utf8.def seems not to have that bug, so

\usepackage[utf8]{inputenc}

(without loading ucs.sty) seems to do the business.

of course, this doesn't help if you were intending to write stuff in
unicode greek or urdu or whatever, but if you're sticking to french,
the latex offering will be good enough for you.

i don't know what one does about bugs in ucs.sty; istr someone saying
its author isn't interested any more, but i'll see if i can rouse
him.
--
Robin Fairbairns, Cambridge

Georg Baum

unread,
Sep 19, 2007, 12:54:25 PM9/19/07
to
Robin Fairbairns wrote:

> (note that something has converted your utf-8 (or whatever) into
> iso-latin-1. i converted the source back while checking what had
> happened.)

His newsreader did that (and declared it correctly).

> the bad news is, it appears to be a bug in the way ucs.sty/utf8x.def
> process utf-8.
>
> the good news is, the latex utf8.def seems not to have that bug, so
>
> \usepackage[utf8]{inputenc}
>
> (without loading ucs.sty) seems to do the business.

Not here (tetex 3): every other pdflatex run works, but inbetween you get
the messed up toc. But what works here is

\usepackage[utf8x,utf8]{inputenc}

(with ucs.sty).

> of course, this doesn't help if you were intending to write stuff in
> unicode greek or urdu or whatever, but if you're sticking to french,
> the latex offering will be good enough for you.

Then it would probably be better to use latin1, since not all packages work
with utf8 (e.g. listings).

> i don't know what one does about bugs in ucs.sty; istr someone saying
> its author isn't interested any more, but i'll see if i can rouse
> him.

He says it himself on his homepage: http://www.unruh.de/DniQ/latex/unicode/


Georg

Joost Kremers

unread,
Sep 19, 2007, 1:13:57 PM9/19/07
to
David Portabella wrote:
> This simple example has three chapters. the second one has a title
> with unicode characters in it.
> ("Abstract" in French is "Résumé").

>
> Using pdflatex:
> While the chapter is well written (with the two accents),
> in the table of contents appears: "R[Please insert into
> preamble]sum[Please insert into preamble]"

note: if you only need french accents, you may as well use latin1 as input
encoding, which means you can drop the ucs package.

however, as to your problem, i had the same issue the other day (and i
certainly cannot use latin1, so...) the message that appeared was a bit
more verbose, however, and told me to put the following in the preamble:

\PrerenderUnicode{áž }

áž (d with dot below) being one of the characters that were causing me
problems.

i have no idea what this command does, but it solved the problem for me.

HTH


--
Joost Kremers joostk...@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

Joost Kremers

unread,
Sep 19, 2007, 1:16:44 PM9/19/07
to
David Portabella wrote:
> This simple example has three chapters. the second one has a title
> with unicode characters in it.
> ("Abstract" in French is "Résumé").
>
> Using pdflatex:
> While the chapter is well written (with the two accents),
> in the table of contents appears: "R[Please insert into
> preamble]sum[Please insert into preamble]"

note: if you only need french accents, you may as well use latin1 as input


encoding, which means you can drop the ucs package.

however, as to your problem, i had the same issue the other day (and i
certainly cannot use latin1, so...) the message that appeared was a bit
more verbose, however, and told me to put the following in the preamble:

\PrerenderUnicode{ḍ}

ḍ (d with dot below) being one of the characters that were causing me

Jellby

unread,
Sep 19, 2007, 1:52:47 PM9/19/07
to
Among other things, Joost Kremers saw fit to write:

> note: if you only need french accents, you may as well use latin1 as input
> encoding, which means you can drop the ucs package.

For French, it's probably better to use latin9, as it includes œ, Œ (\oe,
\OE).

--
Ignacio __ Fernández Galván
/ /\
Linux user / / \ PGP Pub Key
#289967 / / /\ \ 0x01A95F99
/ / /\ \ \
http://djelibeibi.unex.es
/________\ \ \
jellby \___________\/ yahoo.com

Message has been deleted

David Portabella

unread,
Sep 19, 2007, 2:46:56 PM9/19/07
to
On Sep 19, 6:54 pm, Georg Baum <Georg.B...@gmx.de> wrote:
> [...]

> But what works here is
> \usepackage[utf8x,utf8]{inputenc}
> (with ucs.sty).

It works!

Many thanks,
DAvid

0 new messages