Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to put my name in the right-hand side of the header and have a title that is not on its own page. When I put \hfill before \maketitle, I get a page with just the header, followed by the rest of the document. When I put it after, LaTeX prints the header below the title. I tried using \nopagebreak[4] but it didn't make a difference. How can I get the header to print above the title on one page?

This is the start of my code:

\documentclass[12pt]{article}
\usepackage{tikz, amsmath}
\title{My title}
\author{}
\date{}
\setlength{\parindent}{.5in}
\pdfpagewidth 8.5in
\pdfpageheight 11in

\usepackage[left=1in,top=1in,right=1in,bottom=1in,nohead]{geometry}

\begin{document}
\hfill My Name
\maketitle
share|improve this question
    
Welcome to TeX.sx! –  Kurt Feb 22 '13 at 1:21

1 Answer 1

up vote 1 down vote accepted
\documentclass[12pt]{article}
\usepackage{tikz, amsmath}
\usetikzlibrary{calc}
\title{My title}
\author{}
\date{}
\setlength{\parindent}{.5in}
\pdfpagewidth 8.5in
\pdfpageheight 11in

\usepackage[left=1in,top=1in,right=1in,bottom=1in,nohead,showframe]{geometry}  %% Remove showframe in your file

\newcommand{\myname}[1]{%
\begin{tikzpicture}[overlay, remember picture]
\node[anchor=east] at ( $ (current page.north east) + (-1in,-2cm) $) {#1};
\end{tikzpicture}%
}

\begin{document}
\maketitle
\myname{My Name}
\end{document}

enter image description here

share|improve this answer
    
It's perfect. Thanks. –  user26305 Feb 22 '13 at 1:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.