7

Possible Duplicate:
Insert graphic at precise place on a page

I am trying to insert my name on the top right corner of the page but outside the top margin. How can I do that? Many thanks!

gamahuri
  • 415

3 Answers3

6

You could also use TikZ with the overlay and remember picture options:

\documentclass[parskip]{scrartcl}
\usepackage[margin=40mm]{geometry}
\usepackage{tikz}
\usepackage{lipsum}

\begin{document}

\begin{tikzpicture}[overlay, remember picture]
\path (current page.north east) ++(-1,-1) node[below left] {Peter S. Ilie};
\end{tikzpicture}

\lipsum[1-4]

\end{document}

The lipsum package is just for blind text, the above produces

enter image description here

Tom Bombadil
  • 40,123
  • This is, basically, exactly what the background package does ;-) – Gonzalo Medina Oct 06 '11 at 19:25
  • Now that you mention it, the current page.north east should have cought my eye :) Also, looking in the background manual: "Since the commands used to modify attributes of the background material depend on the \node construct offered by the TikZ package...", so yeah, theres a package for doing what I did manually. You live and learn! – Tom Bombadil Oct 06 '11 at 20:05
4

Using the textpos package:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{textpos}

\begin{document}
\begin{textblock*}{100mm}(.85\textwidth,-2cm)
My Name
\end{textblock*}
\end{document}
Peter Grill
  • 223,288
  • This works for me and requires little code. The showframe option is not necessary. The textblock should be located after \maketitle if you are using that. – mareoraft Aug 23 '17 at 19:38
3

There's a number of packages allowing you to achieve what you desire; in the answer to this question there's a list of such packages: Insert graphic at precise place on a page . Another option, not listed in the linked answer is the background package:

\documentclass{article}
\usepackage{background}
\usepackage{lipsum}

\SetBgContents{The Author}
\SetBgScale{1}
\SetBgColor{black}
\SetBgAngle{0}
\SetBgOpacity{1}
\SetBgPosition{current page.north east}
\SetBgVshift{-2cm}
\SetBgHshift{-2cm}

\begin{document}
\lipsum[1-30]
\end{document}
Gonzalo Medina
  • 505,128