Our university has instructions to write the thesis in a one-sided format.
I am trying to place the chapter title and section title in the odd-even pages.
I have succeeded (with manual inputs) in placing these along with the page number using the code from this link.
I manually put the following code in every section (of every chapter) to get this.
\pagestyle{fancy}
\newcommand\cotitle{Chapter 1 Title}
\newcommand\secco{Chapter 1, Section 1 Title}
\fancyhf{}
\renewcommand\headrulewidth{0pt}
\fancyhead[C]{%
\ifodd\value{page}
\small\scshape\cotitle
\else
\small\scshape\secco
\fi }
\fancyhead[R]{\thepage\ifodd\value{page}\else\hfill\fi}
Is it possible to use \rightmark
and \leftmark
to get automatic chapter title (say, in the odd pages) and section title (say, in the even pages) in a one-sided thesis format?
Note that, I have 5 chapters and each containing 4-6 sections.
Any help will be highly appreciated. Thanks in advance.
Best Answer
As Peter Wilson said you could use a
twoside
document but with the same left and right margins, which can be done with thegeometry
package. Something likeThe other way is to use a
oneside
document and use the\ifodd\value{page}
as you have done in your code, but using\leftmark
and\rightmark
. This is the solution that I am offering you.