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

Code, edit and compile here:
\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}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I attached the pdf file generated.
example.pdf
pdf file
(19.83 KiB) Downloaded 256 times
Please help me with this problem...

Regards,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
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

Code, edit and compile here:
\makeatletter
\let\ps@plain\ps@myheadings
\makeatother
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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