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!!

3
  • 2
    Welcome to tex.sx! Please expand your minimal working example, in particular it would be good to know the document class.
    – hakaze
    Commented Aug 6, 2012 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. Commented Aug 6, 2012 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. Commented Aug 7, 2012 at 0:19

3 Answers 3

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.

3
  • 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. Commented Aug 6, 2012 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... Commented Aug 6, 2012 at 20:30
  • @MatthewLeingang In some minutes I will add a remark to my answer including the remark in your comment. Thanks! Commented Aug 6, 2012 at 20:39
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. :)

1
  • 1
    One might consider using something like \includegraphics[width=.4\textwidth] instead of \includegraphics[scale=0.5] to be independent of image size. Commented Jul 15, 2018 at 18:47
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .