1

I am writing in French and there are many accents. I can see them in the whole document except in the table of contents.

When I compile and preview my document in Texmaker, I can see the french accent in the table of contents:

enter image description here

But when I check the actual pdf that is produced with Adobe Acrobat Reader or Preview/Aperçu (Mac OS X 10.6.8 default pdf viewer), the accents are replaced by special characters as shown on the screenshot below:

enter image description here

This is a part of my preamble:

\documentclass[12pt,a4paper,twoside,french]{article}
\usepackage{mathptmx}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{prettyref}
\usepackage{hyperref}
\usepackage{babel}
\addto\extrasfrench{%
   \providecommand{\og}{\leavevmode\flqq~}%
   \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%
}

The TOC file entries look like:

\select@language {french}
\contentsline {section}{Introduction}{1}{section*.2}
\contentsline {section}{\numberline {1}Contexte actuel}{2}{section.1}
\contentsline {subsection}{\numberline {1.1}Contexte socio-\'economique}{2}{subsection.1.1}

How can I fix it?

esmitex
  • 783
  • 1
    Probably you have to use \usepackage[utf8]{inputenc}. See http://tex.stackexchange.com/a/34608/13670 – Cylian Apr 01 '13 at 11:57
  • If I use just utf8 I have to type all accents like \'{e} and I have to write around 20 pages like that. There are too many accents to type. Besides, I get this error ! Package inputenc Error: Unicode char \u8:�de not set up for use with LaTeX. – esmitex Apr 01 '13 at 12:08
  • 1
    How does one of the entries look in the. toc-file? – Ulrike Fischer Apr 01 '13 at 12:21
  • Are your source tex files properly saved in the utf8 format? – pluton Apr 01 '13 at 13:24
  • I had started it in LyX a longtime ago and then after getting a new drive in my machine, and reinstalling my OS, I switched from LyX to Texmaker and when I open my file it tells me that the encoding cannot be properly read and I have to choose one in a long list from ISO .... to UTF... I tried to create a document from scratch in TexMaker and copy paste everything but I get error and I cannot compile it. – esmitex Apr 01 '13 at 13:42
  • 2
    maybe it's a font embedding problem. You could try \usepackage{lmodern} like in http://stackoverflow.com/questions/464140/embedding-fonts-in-pdf-from-latex-source-with-pdflatex – Vincent Nivoliers Apr 01 '13 at 13:56
  • Yes that works. But I have to write in Time News Roman 12pt well they said or an equivalent font... but school can be annoying about that. – esmitex Apr 01 '13 at 14:12
  • Then I think you should have a look at http://tex.stackexchange.com/questions/10391/how-to-embed-fonts-at-compile-time-with-pdflatex to know how to embed the fonts You use in the pdf. – Vincent Nivoliers Apr 01 '13 at 14:25
  • 2
    Well I found the problem I was using \usepackage{mathpmx} with \usepackage{amsfont} just by deleting the second one it would fix the accent problem and keep the font as "Times News Roman" – esmitex Apr 01 '13 at 14:27

2 Answers2

1

Try loading:

\usepackage[latin1]{inputenc}

If this doesn't work, then please try:

\usepackage[applemac]{inputenc}
Mario S. E.
  • 18,609
1

I fixed the problem by removing the package usepackage{amsfont}. I didn't notice that I was using two fonts packages at the same time.

esmitex
  • 783
  • this is indeed peculiar. amsfonts is loaded automatically by amssymb, and you have also specified that, but haven't said that you removed it. so you are still loading amsfonts (check your log). thus it appears that amsfonts may actually be compatible with mathptmx, just not when loaded twice. if you can confirm this, i will put it on the ams list of things to be looked into. – barbara beeton Apr 05 '13 at 16:51
  • I am using \usepackage{mathptmx} \usepackage{amsfonts} \usepackage{amssymb} and it works now but before that I had one extra amsfonts – esmitex Apr 12 '13 at 14:49