I have created custom chapter headings:
\documentclass[final]{book}
\usepackage{lipsum}
% Custom macros
\def \mychapter#1{%
\chapter*{\centering{\LARGE #1}\thispagestyle{empty}}%
\addcontentsline{toc}{chapter}{#1}%
}
\def \mychapterwithsubtitle#1#2{%
\chapter*{\baselineskip=20pt\centering{\LARGE #1}\\*\vspace*{0.3cm}\textnormal{\Large #2}\thispagestyle{empty}}%
\addcontentsline{toc}{chapter}{#1: #2}%
}
% Headers
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% Document
\begin{document}
\mychapter{Some chapter}
\lipsum[1-10]
\mychapterwithsubtitle{Chapter Two}{Subtitle of this chapter}
\lipsum[11-30]
\mychapterwithsubtitle{Chapter Three}{Some other subtitle}
\lipsum[31-50]
\end{document}
Now, I would like to be able to put text of mychapter
heading and name along with subtitles of mychapterwithsubtitles
headings in the header (let's say left side of odd pages header).
I know that there are commands that could be used with fancyhdr
package like \leftmark
, \rightmark
and \thechapter
, but those only work for regular chapters and do not produce any result for starred versions of chapters which I tend to use.
Is there any way to put starred chapter name and number in header?
\markboth{#1}{#2}
for\mychapterwithsubtitle
. (this will position the marks as specified for thebook
class; if you want them somewhere else, then more work is required.) i don't know what you mean when you refer to "numbers"; by definition, starred chapters aren't numbered. ???\markright{#1}
. I made a DIY-chapter anyways. Please have a look at it.