Re: section title as running header

Pétiard François <[email protected]>
Newsgroups gmane.comp.tex.miktex
Message-ID <[email protected]>
Le 22/06/2011 06:45, Per Ting a écrit :
> Hi,
>
> I realize that this is not the appropriate forum to ask this question. I
> apologize for posting this question.  I have already posted it on
> comp.text.tex but have received no response.
>
> I am writing a book where the running headers of even pages are
> chapter titles and running head of odd pages are section titles. The
> last section of each chapter is a section called "Problems". I would
> like this section to have no section number, appear in the TOC without
> section number and be justified under the title of other sections (not
> under the number of other sections) and appear in the heading of odd
> pages as "Problems" with no section number. What I have been doing is
> the following. At the end of Chapter 1 I have added:
>
> \newpage
> \def\mr{\large{\it Problems}}
> \let\rightmark\mr
> \section*{Problems}
> \addcontentsline{toc}{section}{Problems}%
>
> This causes:
> 1- "Problems" to appear in the TOC without section number but left
> justified under other sections that start with section number
> 2-When Chapter 2 starts, on odd pages I do not have section number,
> rather "Problems" appears for the entire book as the header on odd
> pages.
>
> How can I solve these two problems? How cabn I reset the running
> header to the section number again at the beginning of Chapter 2 and
> have "Problems" correctly justified in TOCs.
>

Something like that ?

%%%%%%%%%%%%%%%%%%%%%
\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{lipsum}
\begin{document}
\pagestyle{headings}
\tableofcontents
\chapter{One}
\section{one}
\lipsum
\section{two}
\lipsum
\section{three}
\lipsum
\section{four}
\lipsum
\newpage
\markright{\large{\it Problems}}
\section*{Problems}
\addcontentsline{toc}{section}{\string\kern2.3em Problems}%
\lipsum
\chapter{Two}
\section{one}
\lipsum
\section{two}
\lipsum
\section{three}
\lipsum
\section{four}
\lipsum
\newpage
\def\mr{\large{\it Problems}}
\let\rightmark\mr
\section*{Problems}
\addcontentsline{toc}{section}{\string\kern2.3em Problems}%
\lipsum
\end{document}
%%%%%%%%%%%%%%%%%%%%%

François

-- 
[email protected]


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.