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 following in my preamble, I’m just getting a plain straight line as my header and the page number displayed at the bottom center of my page.

\documentclass{book}

\usepackage[paperwidth=5in,paperheight=7in]{geometry}

\usepackage{fancyhdr}

\pagestyle{fancy}

\begin{document}

\begin{center}

  \section*{Etsuko's picnic}

\end{center}

TEXT

\end{document}

I thought the default fancyhdr trait was to print the name of the corresponding chapter as the header. But in my case nothing is being printed.

I wanted to have the name of the corresponding chapters as the headers of each page in my book. How can I achieve that?

share|improve this question
    
Please edit your question and add a complete example that reproduces the problem. –  Ian Thompson Jun 27 '12 at 14:18
    
I have given a complete example. However, I just want an answer to the question that I have posed at the end rather than reproducing the problem (assuming that it IS a problem). –  harisibrahimkv Jun 27 '12 at 14:23
    
You shouldn't use unnumbered (i.e., "starred") \chapter and \section commands if you want their arguments to show up in the header line. Note, furthermore, that on pages with a \chapter command the default style is to omit the header line. –  Mico Jun 27 '12 at 14:26
    
With your original example I got chapter names in the headers. Your new example doesn't have any chapters in it! Unless other users can reproduce the problem that you describe, it is very difficult to help you. –  Ian Thompson Jun 27 '12 at 14:27
    
I think I am confusing between sections and chapters here. Basically, I just want to have the headings for each of the articles/stories in my book but they should be unnumbered. Also, I want these headings of the chapters in the headers of the pages that contain the content of that heading. Can I achieve that? –  harisibrahimkv Jun 27 '12 at 14:29

1 Answer 1

up vote 2 down vote accepted

Make all sections unstarred first. Then add the following in the preamble:

\setcounter{secnumdepth}{0}

Solved. :)

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.