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).
dschneiderch
Posts: 22
Joined: Thu Mar 31, 2011 10:41 pm

Re: Page numbers beside headers (LyX)

Postby dschneiderch » Thu Apr 21, 2011 7:48 pm

I will check out the top/bottom alignment but for horizontal alignment
  1. \fancyhead[R]{\leavevmode\rlap{\hspace{0.5in}\thepage}}
moves the page nmber LEFT and -0.5 is no different.

I guess the reqs are simply no more than 0.5".

ds

Link:
BBcode:
HTML:
Hide post links
Show post links

nvx
Posts: 25
Joined: Mon Dec 17, 2007 7:49 pm

Postby nvx » Thu Apr 21, 2011 8:13 pm

Hmm, try "\hspace*{...}" (notice the asterisk), maybe it will do the trick. If not then I am afraid I will not be able to help you further with this matter. Sorry...

nvx

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby dschneiderch » Thu Apr 21, 2011 8:22 pm

No luck with that either. Thanks for the attempt though. Any other suggestions out there?

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Thu Apr 21, 2011 8:37 pm

Somehow I don't see the problem.
  1. \documentclass[11pt,a4paper,twoside,english]{report}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{babel}
  5. \usepackage[%
  6. headheight=14pt,
  7. includeheadfoot,
  8. inner=3cm,
  9. outer=4cm,
  10. vmargin=3cm
  11. ]{geometry}
  12. \usepackage{fancyhdr}
  13. \usepackage{blindtext}
  14.  
  15. \fancyhf{}
  16. \fancyhead[LE]{\leavevmode\llap{\thepage\hspace{0.5in}}\nouppercase{\leftmark}}
  17. \fancyhead[RO]{\leavevmode\nouppercase{\rightmark}\rlap{\hspace{0.5in}\thepage}}
  18. \pagestyle{fancy}
  19.  
  20. \begin{document}
  21. \blinddocument
  22. \end{document}

Please enlighten me by a complete minimal example which you didn't provide until now.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby dschneiderch » Thu Apr 21, 2011 10:10 pm

I'm trying to define the header (and footer) to ensure the page number is no more than 0.5 inches from any edge (so top right it should be 'square' and the bottom 0.5" from bottom edge). As it was, I was using \qquad\thispage to approx. align the page number so it "looks" right. The code posted with \hspace{0.5} causes the page number to shift 0.5" to the left instead of to the right.

I'm using LyX and am only beginning to the understand the Latex typesetting functions so I'm not sure what else I can provide other than the class file from http://sites.google.com/site/nathanandrewmiller/cuboulderthesisusinglyx
I'd be happy to post anything that could help though. Thanks for trying.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Fri Apr 22, 2011 8:06 am

I must have missed the detail about LyX until the topic has been split. So I'm afraid I can't advise any further.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby meho_r » Sat Apr 23, 2011 2:38 pm

dschneiderch wrote:I'm trying to define the header (and footer) to ensure the page number is no more than 0.5 inches from any edge (so top right it should be 'square' and the bottom 0.5" from bottom edge). As it was, I was using \qquad\thispage to approx. align the page number so it "looks" right. The code posted with \hspace{0.5} causes the page number to shift 0.5" to the left instead of to the right.

I'm using LyX and am only beginning to the understand the Latex typesetting functions so I'm not sure what else I can provide other than the class file from http://sites.google.com/site/nathanandrewmiller/cuboulderthesisusinglyx
I'd be happy to post anything that could help though. Thanks for trying.

Can you, please, create an example .lyx file, put it together with all additional necessary files in a ZIP archive and attach it here?

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby dschneiderch » Sat Apr 23, 2011 8:00 pm

Here is a LyX file and a .tex file with appropriate .cls file. Thanks!
Attachments
LyX-example.zip
An Example.
(50.98 KiB) Downloaded 44 times

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby meho_r » Sun Apr 24, 2011 12:42 pm

This is oneside document, so, for starters, let's try with something like this in the preamble:
  1. \usepackage{fancyhdr}
  2.  
  3. \fancyhf{} % Delete current setting for header and footer
  4.  
  5. \fancypagestyle{main}{% page style for normal pages
  6. \fancyhfoffset[R]{0.5in}
  7. \fancyhead[R]{\thepage}
  8. \renewcommand{\headrulewidth}{0pt}
  9. \renewcommand{\footrulewidth}{0pt}
  10. }
  11.  
  12. \fancypagestyle{plain}{
  13. \fancyhfoffset[R]{-0.5in}
  14. \fancyhead{} % Get rid of headers and footers on plain pages...
  15. \fancyfoot[C]{\hspace*{0.75in}\thepage}
  16. \renewcommand{\headrulewidth}{0pt} % ...and of the lines
  17. \renewcommand{\footrulewidth}{0pt}
  18. }
  19.  
  20. \fancypagestyle{empty}{
  21. \fancyhead{} % Get rid of headers and footers on empty pages...
  22. \fancyfoot{}
  23. \renewcommand{\headrulewidth}{0pt} % ...and of the lines
  24. \renewcommand{\footrulewidth}{0pt}
  25. }

And at the beginning of your document, press Ctrl+L and type the following:
  1. \pagestyle{main}

Is this satisfactory to you or you had something different in mind?

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby dschneiderch » Mon Apr 25, 2011 6:05 pm

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?


Edit by localghost: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.
Attachments
LyX-example.zip
A further example.
(178.73 KiB) Downloaded 53 times

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests