6

I am using WinEdt to write my thesis and I used

\usepackage[latin1]{inputenc}

to get the French accents to be understood automatically. It works fine for the first 2 chapters, but for some reason, when I add more chapters, it gives me this weird symbol whenever I use accents. This doesn't really make sense as the chapters are all joined to the document the same way!

I really can't see what's wrong.

Any idea?

So here's what it looks like:

\documentclass[msc, index, hyperref, prelimtm]{theseUL1_2} 
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc} 
\usepackage{lmodern}    
\usepackage[francais]{babel}
...
\begin{document}
...

\include{chap1/chap1}
\include{chap2/chap2}
\include{chap3/chap3}

\end{document}

The chapters are in different files all starting with

\chapter{name}
...
3
  • 5
    I would guess that your later chapters are being written in utf-8 encoding rather than latin1. If your weird symbol involves accented capital A that's almost certainly the case. Jul 17, 2013 at 16:28
  • @DavidCarlisle: It seems like it could be the case. I do I correct that?
    – Crystel
    Jul 17, 2013 at 18:20
  • This is not directly related to the issue at hand, but I notice that the class loaded in this MWE is the old Université Laval class, which has been superseded by ulthese, part of TeX Live and MikTeX. The new class thoroughly documents the use of French and English and the possible choices for fonts. Was there any specific reason to use the old class? Jul 17, 2013 at 20:33

1 Answer 1

7

I guess you are using version 7 or 8 of WinEdt. As David Carlisle pointed out, your problem is that, when you create a new document in those versions of WinEdt, they are automatically created in utf-8 encoding.

I suggest to use utf-8 encoding for all of your files.

First of all, put

\usepackage[utf8]{inputenc}

in your main file.

This is what you can do to give utf-8 encoding to the ones that have latin1 encoding:

  1. Download the add-on ANSI2UTF8 and install it in WinEdt.
  2. Launch the command Convert to UTF-8 from the File menu and select 1252 ANSI Windows Latin 1 (Western European)

Now your document has uft-8 encoding. Repeat the step for all files that have latin1 encoding and then you would be able to compile it.

P.S.

To know which files are in uft-8 encoding and which are not, select Document Settings from the Document menu and then the Format page.

For the ones in utf-8 encoding you will see something like:

enter image description here

For the ones in latin1 encoding, you will see "ANSI" instead of "UTF-8".

9
  • grrrr... It seems like it should work. However as I was converting the files I converted one that I guess was already in UTF-8 which resulted in all the accents in the code being changed to weird symbols: Les résultats.
    – Crystel
    Jul 17, 2013 at 19:05
  • Of course it gives me the error inputenc Error: Unicode \char u8:f not set up for use with Latex. The rest compiles just fine with the package UTF-8.
    – Crystel
    Jul 17, 2013 at 19:11
  • I'm sorry to have added the edit in the answer a bit late... You have to check the file that was already in utf-8 encoding and adjust it manually... :-( Jul 17, 2013 at 19:15
  • 1
    No, I mean use the "search and replace" feature to substitute things like é with whatever it means. Even better, you should have a .bak file in the same folder where your .tex file is. This is the file as before the last saving. Jul 17, 2013 at 19:24
  • 1
    é means that the file is in utf8 but being processed as latin1. As I said in the initial comments the accented A is a sure givaway. You shouldn't have needed search/replace just label the file as utf8. Jul 17, 2013 at 20:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .