0

I want to place my university logo at a certain distance from the top-left margins of the page. How am I supposed to do that?

Terry
  • 1

1 Answers1

1

enter image description here

Consider the red rectangle as being the needed logo. The solution below is based on TikZ. Some comments concerning the code:

  1. The command for the logo is \inclkudelogo. To appear on the first page it is invoked after the title. To appear on the others it is invoked in the fancy headings.

  2. "The logo" is a node with empty content in my file. If your logo is the file logo.jpg let's say, you can use it through an \includegraphics[height=...,width=...]{logo} command in the node's content.

  3. \usepackage{showframe} is there to make the page layout explicit.

  4. The important options in the TikZ environment are remember picture and overlay.

\documentclass[11pt, a4paper]{article}
\usepackage{geometry}
\geometry{total={160mm, 240mm}, left=25mm, top=30mm}

\usepackage{tikz} \usepackage{fancyhdr} \pagestyle{fancy} \lhead{\insertlogo} \rhead{some header}

\usepackage{showframe} \usepackage{lipsum}

\newcommand{\insertlogo}{% \begin{tikzpicture}[remember picture, overlay] \path (current page.north west) node[draw, fill, red, inner sep=3ex, text width=6ex, below right=2ex] {}; \end{tikzpicture} }

\title{Document with logo using TikZ} \begin{document}

\maketitle \insertlogo

\lipsum[1]

\lipsum[2-8]

\end{document}

See also @Peter Grill answer How do I add an image in the upper, left-hand corner using TikZ and graphicx which uses background library.

Daniel N
  • 5,687