2

I want the number 510000000 to be on every page on the top right corner what command do I use? Thank you in advance.

    \documentclass[10pt,a4paper]{report}
\usepackage[utf8]{inputenc}
%% Graphics
\usepackage{graphicx}
\usepackage{everypage}
\usepackage{lipsum}

\usepackage{pdfpages}
\usepackage{eso-pic}
\usepackage{lipsum}

\AddToShipoutPictureBG*{%
  \AddEverypageHook
  \AtPageUpperLeft{%
    \hspace{\paperwidth}%
    \raisebox{-\baselineskip}{%
      \makebox[0pt][r]{510000000}
     }}}%

% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
 \AddEverypageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{#3}}}}
% VERIFIED THAT SETTING \hoffset AND \voffset DO NOT BREAK SOLUTION.
%\hoffset=0.4in
%\voffset=0.2in
\atxy{0.1in}{0.1in}{\raisebox{-\height}{\includegraphics[height=0.53in]{logo.jpg}
}}
\begin{document}
%% Titlepage
\vspace*{.2in}
\lipsum[1]
\includepdf{Plagiarism.pdf}

\title{Lab Report}

\end{document}
  • top right corner is not pretty well-defined. Using fancyhdr this can be very easy – user31729 Aug 5 '16 at 18:29
  • Could you possible tell me the code I would really appreciate it. Thank you. – user2693902 Aug 5 '16 at 18:32
3

Use fancyhdr.

\documentclass{article}
\usepackage{fancyhdr}
\renewcommand\headrulewidth{0pt}
\rhead{510000000}
\pagestyle{fancy}
\begin{document}
foo
\end{document}

enter image description here

| improve this answer | |
2

I changed your document in 2 ways. I replaced the \includegraphics in the \atxy argument #3 with text, and I increased the value of the 1st argument to \atxy (to a value of \dimexpr\paperwidth-.7in) to shift the block to the right.

\documentclass[10pt,a4paper]{report}
\usepackage[utf8]{inputenc}
%% Graphics
\usepackage{graphicx}
\usepackage{everypage}
\usepackage{lipsum}

\usepackage{pdfpages}
\usepackage{eso-pic}
\usepackage{lipsum}

% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
 \AddEverypageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{#3}}}}
% VERIFIED THAT SETTING \hoffset AND \voffset DO NOT BREAK SOLUTION.
%\hoffset=0.4in
%\voffset=0.2in
\atxy{\dimexpr\paperwidth-1.5in}{0.1in}{\raisebox{-\height}{\Huge510000000}}
\begin{document}
\lipsum[1]
\end{document}

enter image description here

| improve this answer | |
  • Thank you this exactly what I wanted. I wish I could thank you in person but have a smiley face instead :) – user2693902 Aug 5 '16 at 19:33
  • 1
    @user2693902 You can always click the check mark to the left of my answer to indicate that of the answers, this one is accepted as best. Also, on any answer given, you can click the up-arrow to the left of the answer if you feel the answer adds value to your understanding. – Steven B. Segletes Aug 5 '16 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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