[texhax] Using accented characters in source

Lars Madsen daleif at imf.au.dk
Sat May 1 19:28:36 CEST 2010


Michael Barr wrote:
> Now I have a simple way of actually entering an accented character in my 
> source code (using AllChars) I began to wonder if it is easy to get TeX 
> to interpret them correctly.  This is obviously a Windows-specific 
> question. If I compile the file
> 
> \documentclass{article}
> \usepackage[french]{babel}
> \begin{document}
> Université
> \end{document}
> 
> with or without the second line, the output is simply Universit.  This 
> doesn't surprise me because the Windows code page does not match any of 
> the font encodings, as far as I know.  Still I expected that the é would 
> generate some output.  It is hex 82 and, from the table on page 261 of 
> The LaTeX Companion, first edition, I would have expected C with an 
> acute accent.
> 
> It is not really important; only for a few foreign words in an English 
> language text, but I am still curious.  I can always say Univerist\'e 
> (or I could make the è active and define it to be that, but then it 
> wouldn't hyphenate.
> 
> Michael Barr
> 
> 

you need inputenc, LaTeX use ansii by default, så the é is ignored. Next 
you need ti figure out which input encoding your file is written in. 
This depends on the editor.

In try one of the following

\usepackage[ansinew]{inputenc} % std win encoding
\usepackage[latin1]{inputenc} % latin 1
\usepackage[applemac]{inputenc} % this is the default in TeXShop on MAC
\usepackage[utf8]{inputenc} % default in many linux dists, and in
% TeXWorks on all platforms



-- 

/daleif


More information about the texhax mailing list