Page LayoutPage number in the right top - myheadings

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
jear1701
Posts: 1
Joined: Sun Jan 24, 2016 8:11 am

Page number in the right top - myheadings

Post by jear1701 »

Hello all, I have a problem with the \pagestyle{myheadings} because when i compile the text file to generate the PDF file, the pdf generated has a problem because i need that the number of the first page is in the right top and it generated the page number in the center bottom. I need the same effect of the page two, right top in the first page.

Code: Select all

\documentclass[a4paper,12pt]{report}
    \begin{document}
    \pagestyle{myheadings}\makeatletter
    \pagenumbering{arabic}  
    \renewcommand{\sectionmark}[1]{\markboth{}{\bf\thesection : #1}}
    \chapter{}
    \section{Section 1}
    Some text here
    \clearpage
    \newpage
    \section{Section 2}
    Some more text here
    \end{document}
I attached the pdf file generated.
example.pdf
pdf file
(19.83 KiB) Downloaded 248 times
Please help me with this problem...

Regards,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Page number in the right top - myheadings

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

We discussed this issue already here: no page number in table of contents.

In your case you could simply use this hack to have the same style for chapter starting pages - just add to your document preamble:

Code: Select all

\makeatletter
\let\ps@plain\ps@myheadings
\makeatother
However, take a look into some books of your field of science: it's very common that pages, where a chapter starts with a very big headings, don't have a page style with header. That's why the page number is at the bottom then.

Stefan
LaTeX.org admin
Post Reply