leftpage: chaptertitle and sectiontitle
rightpage: subsectiontitle
Is this possible at all? The manual of fancyhdr and of latex
are a bit unclear, but they seem to indicate that this is NOT
possible (only *two* titles can be in the headers, it seems,
not three). Is this correct?
Is there a trick around the limitation? (Without changing the output
routine ,,,)
Christoph
P.S. In fact, I have a smaller problem with fancyhdr. Where should
one specify the size of the font used: in leftmark, in chaptermark,
or in fancyhead ?
>CS> My book designer wants page headers that seem quite difficult to get:
>CS> leftpage: chaptertitle and sectiontitle
>CS> rightpage: subsectiontitle
>CS> Is this possible at all? The manual of fancyhdr and of latex
>CS> are a bit unclear, but they seem to indicate that this is NOT
>CS> possible (only *two* titles can be in the headers, it seems,
>CS> not three). Is this correct?
You should get section and subsection information from marks, otherwise
they may be out of sync with the pagebreaks. However there is only
\leftmark and \rightmark, so 2 instead of 3. Fortunately the chapter
information can be done without marks in the standard classes as a chapter
always starts at a new page.
>CS> Is there a trick around the limitation? (Without changing the output
>CS> routine ,,,)
Yes. I'll give you the idea, you will have to write the code yopurself. Use
\sectionmark and \subsectionmark to establish these parts, and make
\chaptermark a noop (\renewcommand{\chaptermark}[1]{})
Now you must put the chapter title in a macro at the beginning of each
chapter (after the \chapter command, or define your own chapter command),
and use that macro in the header.
>CS> P.S. In fact, I have a smaller problem with fancyhdr. Where should
>CS> one specify the size of the font used: in leftmark, in chaptermark,
>CS> or in fancyhead ?
I recommend to put only information in the marks, and do the layout things
in fancyhead.
--
Piet van Oostrum <pi...@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: pi...@vanoostrum.org
I am left with a last issue. My fancyheaders
use \small\scshape\rightmark .
How do I get the equivalent of
\MakeLowercase{ \small\scshape\rightmark } ?
This does not work, of course.
One needs the strange \protected@edef
and the \expandafter, but somehow I do not get
it.
Cheers
Christoph
\small\scshape\expandafter\lowercase{\rightmark}
should do the trick.
I think that needs to be
\small\scshape\expandafter\lowercase\expandafter{\rightmark}
so that one isn't just expanding the { after the \lowercase (and thereby
accomplishing nothing useful).
- Brooks
--
The "bmoses-nospam" address is valid; no unmunging needed.
Christoph
\newcommand\nouppercase[1]{{%
\let\uppercase\relax
\let\MakeUppercase\relax
\expandafter\let\csname MakeUppercase \endcsname\relax
#1}}%
then try
{\small\scshape\nouppercase{\rightmark} }
Danie Els (dnjels at sun dot ac dot za)
Is already defined in exactly the same way fancyhdr.sty. So a) it
will bark at the \newcommand and b) no need to redo it ;-) See
also fancyhdr.dvi p.9 for the caveats.
But I still don't get how one could get something like
\fancyhead[LE]{<chaptertitle>}
\fancyhead[RE]{<sectiontitle>}
\fancyhead[RO]{<subsectiontitle>}
which was what the OP wanted IIRC, without redifining \@chapter
\@schapter etc.
c
--
_B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html>
>
> My book designer wants page headers that seem quite difficult to get:
>
> leftpage: chaptertitle and sectiontitle
>
> rightpage: subsectiontitle
>
> Is this possible at all? The manual of fancyhdr and of latex
> are a bit unclear, but they seem to indicate that this is NOT
> possible (only *two* titles can be in the headers, it seems,
> not three). Is this correct?
>
> Is there a trick around the limitation? (Without changing the output
> routine ,,,)
Yes. You can use either the package extramarks or (if you have a new
TeX- installation) you can define a new independant mark (search for
newmarks in google groups). You will have to make sure that chapter and
section clears the marks for subsection (like chapter clears always the
marks of section).
> P.S. In fact, I have a smaller problem with fancyhdr. Where should
> one specify the size of the font used: in leftmark, in chaptermark,
> or in fancyhead ?
I would use fancyhead. chaptermark is also possible (e.g. if you use
different fontsize for the number and the text). \leftmark is not set
by you.
--
Ulrike Fischer
e-mail: zusätzlich meinen Vornamen vor dem @ einfügen.
e-mail: add my first name between the news and the @.
> > leftpage: chaptertitle and sectiontitle
Is there room?
> > rightpage: subsectiontitle
> >
> > Is this possible at all?
Yes, especially since chapters start new pages.
Define something like....
\def\chaptermark#1{%
\gdef\CurrentChapter{#1}%
\sectionmark{}%
}
\def\sectionmark#1{%
\markboth {\CurrentChapter \hfill #1}{}%
}
\def\subsectionmark#1{%
\markright {#1}%
}
Define a page style (\@oddhead etc) that puts the marked text
in the header, and, I presume, the page number in the footer.
--
Donald Arseneau as...@triumf.ca
No barking here. It is only defined inside the fancyhdr commands and
not available outside. If you try to use it in normal text it will bite
;-)
Danie
kewl ;)
Ah, I might start to understand almost half of this mark stuff,
oh boy.
So the following seems to fit the OP's requirements and uses
fancyhdr (certainly the tweaking of \tableofcontents can be done
more elegant):
\documentclass[12pt]{book}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\usepackage{blindtext}
\newcommand*\headerformat[1]{\small\scshape\MakeLowercase{#1}}
\fancyhead{}
\pagestyle{fancy}
\fancyhead[LE]{\headerformat{\leftmark}}
\fancyhead[RO]{\headerformat{\rightmark}}
\newcommand*\CurrentChapter{}
\renewcommand*\chaptermark[1]{%
\gdef\CurrentChapter{#1}%
\sectionmark{}%
}
\renewcommand*\sectionmark[1]{%
\markboth{\CurrentChapter\hfill #1}{}%
}
\renewcommand*\subsectionmark[1]{%
\markright{#1}%
}
\makeatletter
\renewcommand\tableofcontents{%
\chapter*{\contentsname}%
\markboth{\contentsname}{\contentsname}%
\@starttoc{toc}%
}
\makeatother
\begin{document}
\tableofcontents
\Blinddocument
\end{document}
> Ah, I might start to understand almost half of this mark stuff,
> oh boy.
I would suggest giving a try to my titlesec package. With it
you won't need to understand that mark stuff, as it's hidden
to the user and you can write directly \sectiontitle or \thesection in
the running heads, with the right values.
Javier
-----------------------------
http://www.texytipografia.com
But I /want/ to understand, only I am to stupid -- and that can't
be cured by titlesec even.
But seriously, I will look into it if only
> as it's hidden to the user
to try to understand what's hidden ;-)
Regrads
C. Schiller
Did you try my complete example in
Message-ID: <2005-09-0...@krille.blacktrash.org>?
Works fine here.
> Is there any other way to make the running titles lowercase?
errrmh, do you mean by chance lowercase and *not* smallcaps? then
leave out all \scshape.
I found part of the problem: In the index, all the items in file.ind
are converted to something like
\foreignlanguage{UKenglish} indexitem
Something similar might also appear in the the general case, outside
the index.
\Makelowercase has horrible results: it changes the whole expression
into
{ukenglish} which Latex does not understand. There seems to be a
problem with babel.
Thus I am again at the starting point
(1) My \firstrightmark = \rightmark which should be the first word of
an index entry
from file.ind does not appear on the header because of the
\foreignlanguage command,
(2) lowercase in fancyheder (combined WITH smallcaps) does not work
Any ideas?
Regards
Christoph
The aim is the following:
(1) Have something like
A
----
Abbot
in the left margin of the name index (where "A" is teh first letter of
the first
index item on that page)
(2) Have lowercase smallcaps sectionmarks in all running headers
This somehow must interfere with one of the other 50 packages I use,
grrrr.
\item Abbot, George \hyperpage{564}
\item Aristotle \hyperpage{222}
What is the best way to redefine \item so that it also produces a
\markboth{Abbot}{Abbot} % no first name, no comma
\markboth{Aristotle}{Aristotle}
and in particular, no \foreignlanguage{UKenglish}
inside the markboth?
Christoph
Thanky for all the help.
Christoph
>cs> I solved the index problem by setting
>cs> \foreignlanguage to a noop inside the index.
Maybe you can solve the header problem by
\renewcommand{\FOREIGNLANGUAGE}[1]{}
\expandafter\let\csname FOREIGNLANGUAGE \endcsname\FOREIGNLANGUAGE
after the \usepackage{babel}