# Bug in swedish-babel?

When I use the Swedish babel package, the header on the even sides of the table of contents is written "INNEHåLL" (note the lower-case å which should be an Å). If I use the English version, it correctly says CONTENTS. Is this a bug?

I don't have a minimal example for this as it requires at least a page worth of chapters for the contents but here is a screenshot:

Edit: If I use the book class I can get an empty page with this behavior. I managed to strip down all packages I'm using and it appears that the issue is caused by the fontspec package:

\usepackage{fontspec,xltxtra,xunicode}

Edit 2: I changed now to polyglossia. Here is my current preamble. The commented packages are probably the ones giving me trouble:

%!TEX TS-program = XeLaTeX
%!TEX encoding = UTF-8 Unicode

\documentclass[12pt]{book}
\usepackage{geometry}
\geometry{a4paper}

%\usepackage{polyglossia}
\usepackage{fancyhdr}

\usepackage{enumerate}
\usepackage{amssymb}
\usepackage{unicode-math}

\usepackage{array}
\usepackage{rotating}

\usepackage{hyperref}

%\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}

\setmainfont{PT Sans}
\setmonofont[AutoFakeBold=1.4, AutoFakeSlant=0.2]{Inconsolata}

\usepackage[parfill]{parskip}

\usepackage{graphicx}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\graphicspath{{ill/}}

\usepackage{listingsutf8}


Edit 3 My solution so far was the following (can't self-answer yet):

1) Changed babel to polyglossia.

2) Deleted fontspec (included by polyglossia) and amssymb (incompatible with polyglossia).

3) Changed listingsutf8 to listings and now using unicode-math

-
Really wild guess: I noticed you're not using CM or LM as a font, but I have no clue which font this is. Perhaps your font doesn't have an capital Å (either not at all or just not in slanted/italic). –  doncherry Aug 24 '11 at 17:23
@doncherry: The font is PT Sans. It does have Å as normal text displays fine. –  pg-robban Aug 24 '11 at 17:36
Use polyglossia instead of babel when compiling with xelatex. Also see this question. –  lockstep Aug 24 '11 at 17:38
If I use polyglossia I get the following error: Command \Finv already defined –  pg-robban Aug 24 '11 at 17:47

Check if you use \uppercase somewhere and replace it by \MakeUppercase. This is a usual weakness of \uppercase, it doesn't show effect on macros in its argument. Compare:

\documentclass{report}
\usepackage[swedish]{babel}
\begin{document}
\uppercase{Inneh\aa ll}

\MakeUppercase{Inneh\aa ll}
\end{document}


That's not a bug in babel. It can be a weakness in your code, as above, in a package or in the way you are using a package for the headers.

It works as expected for example with the default headings pages style:

\documentclass{report}
\usepackage[swedish]{babel}
\begin{document}
\tableofcontents
\chapter{Test}
\section{test}
...
% repeat chapters and sections many times to get a TOC longer than a page
\end{document}


It works also if you use fancyhdr and fancy page style:

\usepackage{fancyhdr}
\pagestyle{fancy}

-
Thanks for your answer. However, I localized the issue - see my edit. –  pg-robban Aug 24 '11 at 17:39

You original problem with babel can be solved like this:

\addto\captionsswedish{%
\def\contentsname{Innehåll}}


1. Don't use listingsut8 with xelatex. Use listings

2. Do you really need amssymb? (It's the source of the Command \Finv already defined). If yes you must load it before fontspec (so before polyglossia as it loads fontspec), but be aware that some of its definitions will be overwritten.

-
I don't think I need amssymb, so I have removed it now and replaced with unicode-math. Also, it looks like I could get rid of fontspec as well. –  pg-robban Aug 24 '11 at 18:20
"get rid of" is a bit harsh. You should use it, but both polyglossia and unicode-math already load it, so you don't have to do it yourself (but it doesn't do much harm if you do it anyway). –  Ulrike Fischer Aug 24 '11 at 18:25
I see. I'm fairly new to xelatex and I don't have too much experience with latex in general, so I guess I have a lot of studying to do. –  pg-robban Aug 24 '11 at 18:29

Here's how I solved it, with a combination of help from answers and comments:

1) Changed babel to polyglossia.

2) Deleted font-spec and moved amssymb to the top (as it was incompatible with polyglossia).

-

Not entirely sure how babel modifies the contents, but how about trying the following:

\renewcommand{\contentsname}{Inneh\aa ll}


Your \chaptermark should use \MakeUppercase to modify this and make it UPPERCASE in the header.

-