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.

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:enter image description here

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

share|improve this question
    
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
1  
@doncherry: The font is PT Sans. It does have Å as normal text displays fine. –  pg-robban Aug 24 '11 at 17:36
1  
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

4 Answers 4

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}

MakeUppercase example

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}
\pagestyle{headings}
\begin{document}
\tableofcontents
\chapter{Test}
\section{test}
...
% repeat chapters and sections many times to get a TOC longer than a page
\end{document}

headings example

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

\usepackage{fancyhdr}
\pagestyle{fancy}
share|improve this answer
    
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}}

Regarding your current example:

  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.

share|improve this answer
    
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
2  
"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
up vote 1 down vote accepted

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).

share|improve this answer

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.

share|improve this answer

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.
http://tex.stackexchange.com/questions/26412/bug-in-swedish-babel
tex.stackexchange.com
crawl=CC-MAIN-2014-52
88438
application/http; msgtype=response
sha1:SGYZ2TJU5UQACMXA6XYL4BYL75LOUJWF
<urn:uuid:692e405a-6bc4-44d6-9474-9985fa345518>
2014-12-18T14:34:57Z
198.252.206.140
sha1:2TJOX3C6OCIB2YAR5MQ22DADOLGITSGY
<urn:uuid:5fc7be5d-add1-4af4-86b1-f4803be716de>
http://tex.stackexchange.com/questions/26412/bug-in-swedish-babel
response
<urn:uuid:9fc222ab-70d1-4444-a819-26c31225f74d>
robots: classic
hostname: ip-10-231-17-201.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2014-52
operator: CommonCrawl Admin
description: Wide crawl of the web with URLs provided by Blekko for December 2014
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf