I want to use LaTeX to do a school paper. I need the professor name the class name and class time all to be in the upper right corner of every page. The fancyhdr package, at least in it's default configuration, lines the right header with the right margins (also it puts a line at the top of the page which won't fly with my professor who is picky.) How do I make a header that would fit the standard school format? mla package does it, but that by default forces me into a whole host of other formatting decisions.

  • 2
    The fancyhdr package comes with documentation that explains how to change it from its default output. I'd suggest you look at it. Perhaps if there's a more specific question you'd like answered, we can help.
    – Seamus
    Oct 30, 2011 at 20:39
  • @Bre Is this on every page or only the first one. Can you post a small image of the front page of such a paper?
    – yannisl
    Oct 30, 2011 at 21:07
  • cmhughes and seamus, the headheight change is definitely needed. Your code works perfectly, as long as I leave out the frame (on my system the frame rendering is very bad, with lines going through the text, but that's ok because I don't need the frame). One more thing, I think I may need the header to be the above style on the first page, but just have the last name and page number on all the rest. Is there an easy way to modify this code to do that?
    – Bre
    Nov 2, 2011 at 20:09
  • @Bre: I connected your two accounts (there was an unregistered and a registered one). Now you can edit your question and post comments to the answers. I moved your post to a comment here. You might want to add it to both answers now. Nov 3, 2011 at 7:02

2 Answers 2


The solution below uses fancyhdr and puts the content you described in a minipage.

Following @Seamus' comment, I have increased the headheight using the geometry package.

\usepackage{fancyhdr} % for headers and footers
\usepackage{lipsum}   % for dummy text


% headers
 Math 251: Calc\\
 MW 9am-11.30am

% footers
\fancyfoot[L]{left foot}
\fancyfoot[C]{center foot}
\fancyfoot[R]{right foot}

% need to specify the pagestyle as fancy

% if you want a non-fancy pages from this point use ... 


If you only want the information to appear in the header on the first page it might be appropriate to use


at the beginning of your document.

  • 3
    Might you want to increase the headheight if you have a multiline header?
    – Seamus
    Oct 30, 2011 at 20:51
  • @Seamus Thank you, yes I agree. See my edit.
    – cmhughes
    Oct 30, 2011 at 20:57

The titlesec package also offers a set of commands for one-step headline and footline settings (see Section 5. Page Styles of the package documentation). Here's a little example, placing the required information (on every page) flushed to the right margin, and the page number in the center of the footer:

\usepackage{lipsum} % just to generate text for the example


                                 The Professor\\
                                 The Class\\
                                 The Time





You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .