Page LayoutHorizontal rule in header: possible with myheadings?

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
jamtat
Posts: 13
Joined: Sat Dec 11, 2010 4:25 am

Horizontal rule in header: possible with myheadings?

Post by jamtat »

I've successfully created a document (article) with a heading using \pagestyle{myheadings}. Since I'm fairly new to this I've been reading over The Not So Short Introduction to LaTeX, which contains a heading I like much better--mainly because it has a horizontal rule that helps better to distinguish the heading from the body text. I know from reading the book and from another experiment I tried, that getting this horizontal rule can be accomplished by using the fancyhdr package. But before switching to that I just want to ask here whether it's possible to get such a horizontal rule in the heading using the myheadings solution, too? Input on this question will be appreciated.

Thanks,
James

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Horizontal rule in header: possible with myheadings?

Post by localghost »

It might be possible with the (very old) underlin package. But packages like fancyhdr or titleps (from the titlesec bundle) are more flexible, thus preferable.


Thorsten
jamtat
Posts: 13
Joined: Sat Dec 11, 2010 4:25 am

Re: Horizontal rule in header: possible with myheadings?

Post by jamtat »

Thank you for that suggestion, Thorsten. The underlin package--when used according to directives you gave to someone else at http://www.latex-community.org/forum/vi ... =47&t=4086 does, in fact, give the sort of horizontal rule I was hoping for. I do get an overfull vbox error when I process the file (with pdflatex), which I assumed was owing to the fact that I'm using a 14 pt. font for this file which, when combined with the horizontal rule, sort of overwhelms the height set for the heading. The pdf output looks fine despite the overfull vbox. I decided to try and confirm, by increasing the height, my suspicion that the vbox error was related to heading height (\setlength{\headheight{{16pt}): the error did go away when I did that. The final output did not look appreciably different with that setting, though.

James
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Horizontal rule in header: possible with myheadings?

Post by Stefan Kottwitz »

Hi James,

to mention another package: I'm preferring scrpage2 for typesetting header and footer with or without horizontal rules. It is flexible, and can be used similar to fancyhdr.

It belongs to the very recommendable KOMA-Script bundle, but it can be used with standard classes as well, such as with the article class.

A package could take care of different page styles, varying header height and different margins. If you make it yourself, you might to be careful.

Stefan
LaTeX.org admin
jamtat
Posts: 13
Joined: Sat Dec 11, 2010 4:25 am

Re: Horizontal rule in header: possible with myheadings?

Post by jamtat »

Thank you for your reply, Stefan. I've taken a preliminary look at the bundle you've mentioned and, for a relative newbie like me, it's a bit much to take in at this point. But I've made a mental note of it and will be trying to understand it better as I continue trying to use LaTeX.

James
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Horizontal rule in header: possible with myheadings?

Post by localghost »

I think you should tell us your ideas about the look of your headers (and footers). I'm sure together we will be able to work out something that will fit your needs.
jamtat
Posts: 13
Joined: Sat Dec 11, 2010 4:25 am

Re: Horizontal rule in header: possible with myheadings?

Post by jamtat »

There's really nothing to tell at the moment, Thorsten. The underlin package you mentioned in a previous post gives the sort of header look I need for my current project. But, as I mentioned, I'm new to LaTeX and am trying to use it in my day-to-day work, so it's nice to know there's a willingness to help on this forum--I'll undoubtedly have other queries along these lines in the future. Thanks for the input on this particular issue.

James
Post Reply