[Tex/LaTex] Image within \maketitle – not separate page

graphicstitles

I would like to put a logo above my title, but I would also like to keep the title/author/date on the first page of text.

All of the solutions I've found so far relate to the title page package, which instigates a separate page.

Inserting a figure turns the first page into a 'regular' page, with header and footer, followed by the title on the next page.

I'm using article class.

Any suggestions?

Code below is slightly modified from XeLaTeX template to provide MWE.

\documentclass[12pt]{article}
\usepackage{geometry} 
\geometry{a4paper}              

\usepackage{graphicx}
\usepackage{amssymb}


\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Hoefler Text}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}

\title{Brief Article}
\author{The Author}
\date{}     

\begin{document}
\maketitle

Content of document, starting straight away, same page...
I would like the image to have appeared at the top, above Brief Article.
    But where to put the command?


\end{document}  

Best Answer

The titling package is what you're looking for:

\documentclass[12pt]{article}
\usepackage{geometry} 
\geometry{a4paper}              

\usepackage[demo]{graphicx} % the demo option is just for the example
\usepackage{amssymb}
\usepackage{titling}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Hoefler Text}
\setsansfont[Scale=MatchLowercase,Ligatures=TeX]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}

\pretitle{%
  \begin{center}
  \LARGE
  \includegraphics[width=6cm,height=2cm]{logo}\\[\bigskipamount]
}
\posttitle{\end{center}}

\begin{document}

\title{Brief Article}
\author{The Author}
\date{}     

\maketitle

Content of document, starting straight away, same page...
I would like the image to have appeared at the top, above Brief Article.
    But where to put the command?


\end{document}  

enter image description here

Note that you're using a quite old syntax for loading fonts.

Related Question