# Renew \title command to include an image right before the text

I am writing a series of company internal documents and decided to use latex and a custom .sty file so that I can have only content in the actual .tex document and have a consistent style for all documents.

I would like to add the company logo right before the title of the document. So I'm thinking of putting a \renewcommand in the *.sty document, but I cannot have a \includegraphics there since it's outside the main document flow.

How would I go about this? The examples of possible solutions I've seen involved using \begin{titlepage} etc that will create a whole separate page that I do not want and then I'm unable to define a custom title for each document.

What I have so far in terms of how I would like to have my title structured is:

document1.tex:

\documentclass[]{scrartcl}

\usepackage{company_style}

%opening
\title{01 - The First Document}

\begin{document}
\maketitle
\end{document}


and company_style.sty:

\ProvidesPackage{company_style}

\title{Comany XYZ \\ {\LARGE \@specificTitle} }
\renewcommand*{\title}[1]{\def\@specificTitle{#1}}


## 1 Answer

You can include the company logo as part of the title in your style file. Here's an example:

\documentclass{scrartcl}
\usepackage{filecontents}
\begin{filecontents*}{company_style.sty}
\ProvidesPackage{company_style}
\RequirePackage{graphicx}

\let\oldtitle\title
\renewcommand{\title}[1]{\oldtitle{%
Company XYZ \\[\bigskipamount]
\includegraphics[height=5\baselineskip]{example-image} \\[\bigskipamount]
#1}}

\end{filecontents*}

\usepackage{company_style}

\title{01 - The First Document}
\author{A.N.\ Author}
\date{\today}

\begin{document}
\maketitle

This is some content
\end{document}


For the sake of portability, and this example, I've used filecontents to write company_style.sty as part of the minimal example.

Within company_style.sty, the \title macro is redefined to always include the company name - Company XYZ - and the company logo - example-image (or whatever you decide to use).

• I tried something similar to your solution but my compiler complained that I was trying to insert an image outside of the main document flow. Anyway, your solution worked - Thanks! – getack Dec 15 '14 at 6:07