Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am writing a paper in english but will need to provide a danish abstract and use the little word "Köppen" as well. For some reason I seam not to be able to get the them to work. This example:

\documentclass{article}
\usepackage[german, danish, english]{babel} % danish and english languages
\usepackage{float}  % provides the ploat placement parameter H
\usepackage[ansinew]{inputenc} % provides the characters Æ, Ø, Å, æ, ø, å

\begin{document}
ö ø %å
\end{document}

compiles but gives me ö and à rather than ö and ø as they should as long is the file is saved in utf-8. If I save it in ISO Latin 9 the world is hole again and I get what I was wishing for.

The problem is that all my files are saved in utf-8 and I would like to not go through the process of changing them all.

Is there a setup to write documents containing ä, ö, ü, å, ø and æ using utf-8 encoding? I tried to play with these packages but di not get anywhere really.

\usepackage[german, danish, english]{babel} % danish and english languages
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}

I know this should be easy to figure out but I have a deadline in 10 days and this just drives me up the wall. There are still bigger fish to fry and i only need a hand full of these little obnoxious ö's and co. Please help me keep my sanity (well, whats left of it anyways).


Side note: I love LaTeX for many reasons but the text encoding is driving my crazy. Why does it have to be so unnecessarily complicated? I mean I can type all these letters right here with no problem?!

share|improve this question
2  
why don't you change \usepackage[ansinew]{inputenc} to \usepackage[utf8]{inputenc}? –  musicman May 19 at 8:46
    
\usepackage[utf8]{inputenx} \usepackage[T1]{fontenc} –  Sveinung May 19 at 8:50
    
As others have said, tell LaTeX that you use utf8 if that's what you use. I just want to add that the maybe confusing "ansinew" is actually Windows-1252. An extension of Latin-1 by Microsoft that in the Microsoft world often is called "ansi" for historical reasons, even though it is not an ANSI standard. –  pst May 19 at 9:02
    
@musicman I ... Betriebsblind? Thanks! –  MatoBehr May 19 at 9:13
    
@pst Thats great info. Will this change have any other influence on the output? Is any formatting influenced by it? The "ansinew" came from a template that I am to use (from University) which had been encoded int Latin 9. I have saved it with utf8 encoding now and all works. Just concerned that there might be reasons why I should keep it at Latin 9 with ansinew. –  MatoBehr May 19 at 9:16

1 Answer 1

up vote 13 down vote accepted

If the file is saved in UTF-8, then just use

\usepackage[utf8]{inputenc}

If you are saving the file in ISO Latin 9, then

\usepackage[latin9]{inputenc}

If you do not know the encoding of the file, then package selinput helps, e.g.:

\usepackage{selinput}
\SelectInputMappings{
  adieresis={ä},
  germandbls={ß},
  Euro={€},
}

The packages chooses the right encoding for inputenc depending on the given glyph mappings.

share|improve this answer
    
So the option in inputenc has to reflect the actual encoding of the file. Will the selection of one or the other have any influence on the resulting pdf? Or are they interchangeable as long as they are matching (encoding of file and option in usepackage)? –  MatoBehr May 19 at 9:18
    
@MatoBehr: Yes, the encoding option for inputenc must match the encoding used in the TeX file. If the correct encoding is specified, then it does not matter much, which input encoding is used. –  Heiko Oberdiek May 19 at 9:26
2  
+1 I'd missed selinput before. That seems a very sensible idea, thanks:-) –  David Carlisle May 19 at 9:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.