I would like to have a macro which pass the book title both to the title page and to the page headlines. Unfortunately if I pass the title containing new line command (to break line on title page) then the line is broken also in page headline.
For resolving conflict between titling
and titlesec
packages I am using @frabjous solution. Probably I have to combine it with some method of removing new line command, given here. I don't know how to do this.
Code:
\documentclass{article}
\usepackage[paperwidth=12cm,paperheight=11cm,twoside]{geometry}
\usepackage{fancyhdr}
\usepackage{titling}
\usepackage{titlesec}
\fancyhead[LE]{\mythetitle}
\pagestyle{fancy}
\let\oldtitle\title
\renewcommand{\title}[1]{\oldtitle{#1}\newcommand{\mythetitle}{#1}}
\author{Cookiemonster}
\title{Title\\consisting of \\ four \\lines}
\begin{document}
\begin{titlingpage}
\maketitle
\end{titlingpage}
\section{My section}
AAA
\end{document}
BTW: In accordance to the documentation of titling
package (top of the page 5) after title page the page number should be 1, not 2. What I am doing wrong in this code?
\fancyhead[LE]{\renewcommand\\{\space\ignorespaces}\mythetitle}
titling
doesn't set it in a twoside document (well, even/odd detection wouldn't work correctly without an additional\cleardoublepage
). So you have to do it yourself, just put\setcounter{page}{1}
after\end{titlingpage}
.\\
.\ifhmode\unskip\fi\space\ignorespace