2

I would like to add a logo to the header of my titlepage. I am not using \maketitle to create my title page, whereas all suggestions in other posts actually use it. Could someone help me out and provide a fix to this problem? I only want my logo to be in the header on the first page which is titlepage.

\begin{titlepage}
\begin{center}
\centerline{
 \includegraphics[width=1\textwidth]{logo.png}
}
    \vspace*{1cm}

    \Huge
    \textbf{title}


    \vspace{1.5cm}

by
    \textbf{name}\\
\vspace{1.5cm}
\Large
supervised by
\textbf{name}

    \vfill

    A report presented for the degree of...

    \vspace{0.8cm} 

    Department of... \\

    \vspace{1.5cm}

\end{center}

\end{titlepage}
  • I don’t really understand what you want to do. Can you provide a picture of the result at this time and make a sketch of what you want to do? Also, you don’t need \centerline inside the center environment. – Zoxume Mar 16 '16 at 20:19
  • Basically my logo is in the space of the page where all of the text goes. Header is not used, so in fact the logo is below the header. I would like to place the logo inside the header. – aki2014 Mar 16 '16 at 20:23
  • Then you should edit your question. It’s doable with TikZ as you can access several nodes to put your picture in the right place. I am not fluent enough with TikZ to write the answer but you could find the solution by searching for it on TeX.SX. – Zoxume Mar 16 '16 at 20:25
  • I will try look into it. However, maybe someone will suggest a solution that uses for example fancyhdr. It seems to be used a lot when dealing with headers and footers – aki2014 Mar 16 '16 at 20:27
  • I think that creating a whole new header & footer style for only one page is a little bit bloating and less semantically correct. If you already use TikZ in your document, it’s the best solution IMHO. – Zoxume Mar 16 '16 at 20:32
2

This is a very basic way to do it. (It assumes the logo should take up the whole physical page.)

\documentclass{article}
\usepackage{lipsum, mwe,graphicx,eso-pic}
% lipsum provides:   \lipsum
% mwe provides:      example-image
% graphicx provides: \includegraphics
% eso-pic provides:  \AddTo..., \AtStockUpperLeft

\newlength\headpicwd
\newlength\headpicht
\setlength{\headpicwd}{\pdfpagewidth}% image width of physical page?
\setlength{\headpicht}{3cm}
\newcommand\printpic{%
  \AddToShipoutPictureBG*{%
    \AtStockUpperLeft{%
      \raisebox{-\headpicht}{%
        % centred with respect to physical page ..?
        % \hspace*{\dimexpr 0.5\pdfpagewidth - 0.5\headpicwd\relax}%
        \includegraphics[width=\headpicwd, height=\headpicht]{example-image}%
      }%
    }%
  }%
}

\begin{document}
% print logo
\printpic

\lipsum

\end{document}

If you want to change that, set \headpicwd to the appropriate width and uncomment the \hspace line. If you want it centred with respect to the text block some further (minor) changes would be required if you have different margin sizes.

  • Jon it did the trick without changing anything (excluding filename). Accepted as an answer. – aki2014 Mar 16 '16 at 21:29
  • @aki2014 -- Glad it works for you! – jon Mar 16 '16 at 21:32
0

Here is a simple solution with the titling package and a simple \includegraphics:

\documentclass[11pt,a4paper,twoside]{report}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[osf]{garamondx}
\usepackage[showframe, nomarginpar]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}

\usepackage{titling}%
\title{Title}
\author{by\quad Name}
\date{}

\pretitle{\begin{center} \Huge\bfseries}
\posttitle{\end{center}\vskip1.5cm}
\preauthor{\begin{center}\Huge\bfseries}
\postauthor{\vskip1.5cm\par\Large supervised by supername\end{center}\vfill}
\renewcommand{\maketitlehooka}{%
\noindent\centering\raisebox{95pt}[0pt][0cm]{\includegraphics[scale=0.25]{dodo.jpeg}}}%
\renewcommand{\maketitlehookd}{%
\noindent\raggedright A report presented for the degree of...
\vspace{0.8cm}\\
Department of...
\vspace{1.5cm}}%

\begin{document}

\maketitle

\lipsum[1-5]

\end{document} 

enter image description here

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.