Right now my title looks like this enter image description here

As you can see, the centering is a bit off. What I really would like it to look like is not have element 1 & element 3 and have "CS 2800" & "Homework 1" centered.

If anyone could tell me how to do that it would be very much appreciated! The latex code that I'm using is this:

% Use this template to write your solutions

\usepackage[intlimits, sumlimits]{amsmath}

% Set the margins

% Macros

{${#1} : {#2} \rightarrow {#3}$ }


% Formating Macros

{#1} \hfill {#2} \hfill {#3}

{#4} \hfill {#5} \hfill {#6}


}  % end \myheader 

{ {}}
{ {\Large CS 2800}}
{ {}}
{ {Monica}}
{ {Homework 1}}
{ {February 8, 2015}}

%%%%%% Begin document with header and title %%%%%%%%%%%%%%%%%%%%%%%%%




% \myhwtitle{x}{y}{clem, Lee, Clement}
% Example : \myhwtitle{1}{4}{Your name here}


% begin Solution 
Your problem solution.
% end Solution 


2 Answers 2


I would load the fancyhdr package and place the following code in the preamble:

       \Large CS2800 \\ Homework 1
\rhead{February 8, 2015}

The body of the document would then start off like this:


enter image description here

  • The instructions \pagestyle{plain}\thispagestyle{fancy} make sure that the "fancy" page style is used only on the first page of the document.
    – Mico
    Feb 4, 2016 at 19:12

A little bit different from @Mico solution and a little bit later.

Element 1\\Monica
Element 3\\\today
{\large CS 2800}\\Homework 1


enter image description here

  • +1. I can't tell if the header is supposed to show up on every page of the document or just on the first one.
    – Mico
    Feb 4, 2016 at 19:11
  • @Mico, me too. Specially because of those lot of new commands with arguments.
    – Sigur
    Feb 4, 2016 at 19:12

You must log in to answer this question.

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