[Tex/LaTex] How to get a heading in the upper right hand corner of the first page only

formattingheader-footer

I'm looking to do homework in LaTeX. I'd like the format to be as follows: A simple enumerated list of the answers (with simple numbers on the same line, not section markers) with a heading on the top right corner of the first page only. I'd also like smaller margins and 12pt font. The list, the margins, and the font I've taken care of with

\documentclass[a4paper, 12pt]{article}
\usepackage{enumitem}
\usepackage{fullpage}
\begin{document}
\begin{enumerate}

 \item[1.] Here is some text. $$f(x+h) = f(x) + f'(x)h + o(h).$$

\end{enumerate}
\end{document}

I'm now trying to figure out how to get a heading in the upper right hand corner of the first page. I searched through old answers on the site with no success.

Best Answer

There is technically no need to place what you're after in the page header. I would just set it as part of the text block - the first thing on the first page, flush right:

enter image description here

\documentclass[12pt]{article}
\usepackage[paper=a4paper,margin=1in]{geometry}
\begin{document}
\null\hfill\begin{tabular}[t]{l@{}}
  \textbf{My name} \\
  \textit{My University}
\end{tabular}

\begin{enumerate}
  \item
  Here is some text. $f(x+h) = f(x) + f'(x)h + \mathcal{O}(h)$.
\end{enumerate}
\end{document}

I've used geometry to set the page boundary/size. Adjust to your liking. The idea behind a tabular is only to emphasize that you can make a construction of what you want to place as your "header" that contain multiple lines. However, if you just want a single entry, there may be no need for using tabular.