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.

Is there a way to change the headers in XeLaTeX? Basically I just want my headers (pagenumber, author and title) to be bold, but none of the solutions suggested for LaTeX seems to have any effect on the headers. Is it because I'm using XeLaTeX? Here's my code:

\documentclass[twoside,12pt]{book}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}

\begin{document}

\fancyhead{}
\fancyhead[LE,RO]{\bfseries \thepage}
\fancyhead[CO]{Titleoftext \bfseries}
\fancyhead[CE]{\bfseries Authoroftext}

\end{document}
share|improve this question
3  
Your code works fine except \fancyhead[CO]{Titleoftext \bfseries} . You should write \fancyhead[CO]{\bfseries Titleoftext}. Otherwise \bfseries has no effect. –  Thorsten Jan 13 '12 at 11:00
    
It does nothing with XeTeX. –  Leo Liu Jan 13 '12 at 12:34
    
No clue if this is your problem, but in addition to \pagestyle{fancy} you need to issue \thispagestyle{fancy} after \maketitle and every chapter. See also this question. –  rdhs Jan 13 '12 at 12:51
    
@Thorsten: neither of both versions give me a bold header. it seems \bfseries has no effect 'cause I'm using XelaTex. Is this possible? –  david Jan 13 '12 at 13:23
2  
@david Please complete your example. We need to have a minimal working example to see what your problem is. Because when I'm completing your code to a working example I get bold text. –  Thorsten Jan 13 '12 at 15:14

1 Answer 1

If I add to your code snippet the missing parts it does what you want:

\listfiles
\documentclass[twoside]{book}
\usepackage{fancyhdr} 
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\bfseries \thepage}
\fancyhead[CO]{\bfseries Titleoftext }
\fancyhead[CE]{\bfseries Authoroftext}

\begin{document}
foo  \newpage bar

\end{document}

the file list:

*File List*
book.cls 2007/10/19 v1.4h Standard LaTeX document class
bk10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
fancyhdr.sty
***********
share|improve this answer
    
@Thorsten: it's similar to mine, except that I'm using {book} and xelatex. does this make any difference? –  david Jan 13 '12 at 17:08
    
@david: I changed it to class book and it also works. Insert \listfiles and compare the file list of the log file –  Herbert Jan 13 '12 at 17:10
    
@david No, it doesn't. As Herbert says, there's no difference wheter you use the article or the book class. –  Thorsten Jan 13 '12 at 17:17

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.