13

How to put the logo before the date and after my name in the title? I write it as

 \begin{document}

 \title{}

 \author{}

 \titlepic{ \includegraphics[width=0.5\textwidth]{logo}

 \date{} 

but it appears after the date!!

Gonzalo Medina
  • 505,128
Sara
  • 243
  • 2
    Welcome to tex.sx! Please expand your minimal working example, in particular it would be good to know the document class. – hakaze Aug 06 '12 at 17:17
  • The thing to remember about \title and \author is that they don't produce any output by themselves. They just save their argument in a macro to be expanded later. The \maketitle macro expands these saved macros. – Matthew Leingang Aug 06 '12 at 20:27
  • Aside: Some universities have strict (not to say freaking ridiculous, Bama) guidelines concerning the use of their logos and layout or typographical conventions to be employed when you use it. You might want to have a look around to make sure you won't get in trouble. – dmckee --- ex-moderator kitten Aug 07 '12 at 00:19

3 Answers3

21

We can also use the titling package to add a new element to \maketitle:

\documentclass{article}

\usepackage[demo]{graphicx}
\usepackage{titling}

\usepackage{lipsum}

\newcommand{\logo}[1]{%
  \postauthor{%
  \end{tabular}\par\end{center}
  \begin{center}\includegraphics[scale=0.5]{#1}\end{center}
  \vskip0.5em}%
}

\title{We love ducks}
\author{Daffy Duck}
\logo{quackuniversity}

\begin{document}

\maketitle

\lipsum

\end{document}

The output:

Moar duckz

Hope it helps. :)

Paulo Cereda
  • 44,220
  • 1
    One might consider using something like \includegraphics[width=.4\textwidth] instead of \includegraphics[scale=0.5] to be independent of image size. – Kamil Jarosz Jul 15 '18 at 18:47
9

You can use the \author field; something along these lines:

\documentclass{article}
\usepackage[demo]{graphicx}

\title{The Title}
\author{%
  The Author \\
 \includegraphics[width=0.5\textwidth]{logo}%
}
\date{\today}

\begin{document}

\maketitle

\end{document}

enter image description here

Using the optional argument for \\ (as in \\[1cm], \\[-3pt]) you can control the vertical space between the author name and the logo.

The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document.

As Matthew Leingang mentions in a comment, some packages will do things with the contents of the \author declaration, like put it into the PDF metadata. Declaring the author of the document to be The Author \\ \includegraphics[width=0.5\textwidth]{logo} spoils this extra functionality and will require extra adjustments.

Moriambar
  • 11,466
Gonzalo Medina
  • 505,128
  • 3
    This definitely does the trick but it breaks the semantic markup of the document. Some packages will do things with the contents of the \author declaration, like put it into the PDF metadata. Declaring the author of the document to be The Author \ \includegraphics[width=0.5\textwidth]{logo} spoils this extra functionality. – Matthew Leingang Aug 06 '12 at 20:25
  • @MatthewLeingang I partially agree with your comment; the PDF metadata can be fixed so as to not include whatever results from the image; some document classes offer an optional argument for \author... – Gonzalo Medina Aug 06 '12 at 20:30
  • @MatthewLeingang In some minutes I will add a remark to my answer including the remark in your comment. Thanks! – Gonzalo Medina Aug 06 '12 at 20:39
6

You can redefine the \maketitle as it is done by the titlepic package.

\documentclass[titlepage]{article}
\usepackage[demo]{graphicx}
\usepackage{titlepic}
%
\makeatletter
%% This is a redefinition of the contents of titlepic.sty file
\if@titlepage
\renewcommand\maketitle{
    \begin{titlepage}%
        \let\footnotesize\small
        \let\footnoterule\relax
        \let \footnote \thanks
        \@tptopspace%
        \begin{center}%
            {\LARGE \@title \par}%
            \vskip 3em% %% Change this space if you wish
            {\large
                \lineskip .75em%
                \begin{tabular}[t]{c}%
                \@author
                \end{tabular}\par%
            }%
%         \@tpsepspace% %% uncomment if you need space.
        {\centering\@titlepic\par}
            \vskip 1.5em%   %% Change this space if you wish
            {\large \@date \par}%       % Set date in \large size.
        \end{center}\par
        \vfil
        \@thanks
    \end{titlepage}%
    \setcounter{footnote}{0}%
    \global\let\thanks\relax
    \global\let\maketitle\relax
    \global\let\@thanks\@empty
    \global\let\@author\@empty
    \global\let\@date\@empty
    \global\let\@title\@empty
    \global\let\@titlepic\@empty
    \global\let\title\relax
    \global\let\author\relax
    \global\let\date\relax
    \global\let\and\relax
    \global\let\titlepic\relax
}
\fi
\makeatother
%
\begin{document}
%
\title{My title}
%
\author{My name}
%
\titlepic{\includegraphics[width=0.5\textwidth]{logo}}
%
\date{\today} 
%
\maketitle
%
\end{document}

enter image description here