LaTeX forum ⇒ Page LayoutPage numbers beside headers (LyX)

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
User avatar
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Re: Page numbers beside headers (LyX)

Postby localghost » Mon Apr 25, 2011 7:00 pm

dschneiderch wrote:Thank you for the example! The code works basically but how do I ensure the page number is no more than 0.5 inches from any edge (so top right it should be 'square' and bottom center 0.5" up from bottom?
Also, what is the appropriate way to center the bottom page number to the text instead of page (one-sided printing, left margin=1.5", right margin=1")?
I used \quad and \qquad to arrange the numbers to "look" good but would like a real solution. […]

Just for notification to our fellow members, this has also been posted elsewhere phrased very similar [1]. If you do a crossposting, please kindly add the corresponding link to the other place(s) where you posted the question as demanded in the forum rules. This prevents others from double efforts and waste of time.

[1] {TeX} SE - chapter heading page numbers
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

User avatar
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Postby meho_r » Tue Apr 26, 2011 12:07 pm

dschneiderch wrote:Yep that does it. I had read that fancyhfoffset wasn't good to use...not sure why but this works except not for the front matter. The front matter is somehow created in the class file I think. Any suggestions for this?

Just use \thispagestyle or \pagestyle commands for front matter too. I noticed that the code for typesetting first couple of pages (including abstract) are placed in the preamble, not in the document body, so, you'll have to use \thispagestyle or \pagestyle there too (but you'll have to move all the code related to fancyhdr and page style before specifying title, abstract etc.). E.g., put \thispagestyle{main} on a line just after the \abstract{ \OnePageChapter. Same goes for title page and other stuff.

But there is another way: if you name the style for normal text myheadings instead of main which I used as an example (since myheadings page style is set in .cls file as the main page style), and change empty page style to plain in vnovathesis_hyperref.cls, line 670, then you'll get numbers displayed correctly in front matter and you don't have to enter \thispagestyle{plain} manually after every chapter. You don't even have to specify page style in an ERT box at the beginning of the body text at all.

Posts: 22
Joined: Thu Mar 31, 2011 10:41 pm

Postby dschneiderch » Wed Apr 27, 2011 12:34 am

The first route didn't work for all of the front matter, only for the abstract so I followed the 2nd suggestion and it worked except that one of the few reqs my school has is that all the front matter page numbers are plain style (bottom center). There is probably a better way to do this but I inserted
  1. \thispagestyle{plain}
after each preamble command in the .cls and got the output I needed. Thanks again for your help.

Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 1 guest