2

Need help to align the logo left but keep the title centred. Atm, the two move together or are removed with any edits to the preamble I have tried.

\documentclass[a4paper,11pt]{article}
\usepackage[a4paper, left=15mm, right=15mm, top=20mm, bottom=20mm]{geometry}
\usepackage[parfill]{parskip}
\usepackage{amssymb,amsmath}% http://ctan.org/pkg/{amssymb,amsmath}
\usepackage{braket}% http://ctan.org/pkg/braket
\usepackage{datetime}
\usepackage[normalem]{ulem}
\usepackage[colorlinks = true, linkcolor = blue, urlcolor  = blue, citecolor = blue, anchorcolor = blue]{hyperref}
\newdateformat{mydate}{\twodigit{\THEDAY}{ }\shortmonthname[\THEMONTH] \THEYEAR}
\newcommand{\forceindent}{\leavevmode{\parindent=1em\indent}}
\usepackage{enumitem}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx

\usepackage{titling}


\pretitle{%
\begin{flushleft}
\includegraphics[width=7cm,height=2cm]{image.png}\\[\bigskipamount]
\pretitle{\begin{flushleft}\LARGE}
}
\posttitle{\end{flushleft}}


\date{\today}

\title{Financial Analysis}

\begin{document}

\maketitle
3

Here it is:

\documentclass[a4paper,11pt]{article}
\usepackage[a4paper, left=15mm, right=15mm, top=20mm, bottom=20mm]{geometry}
\usepackage[parfill]{parskip}
\usepackage{amssymb,amsmath}% http://ctan.org/pkg/{amssymb,amsmath}
\usepackage{braket}% http://ctan.org/pkg/braket
\usepackage{datetime}
\usepackage[normalem]{ulem}
\usepackage[colorlinks = true, linkcolor = blue, urlcolor = blue, citecolor = blue, anchorcolor = blue]{hyperref}
\newdateformat{mydate}{\twodigit{\THEDAY}{ }\shortmonthname[\THEMONTH] \THEYEAR}
\newcommand{\forceindent}{\leavevmode{\parindent=1em\indent}}
\usepackage{enumitem}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx

\usepackage{titling}


\pretitle{%
\begin{flushleft}
\includegraphics[width=4cm]{suitcase1}\end{flushleft}\vspace{2\baselineskip}
\begin{center}\LARGE\bfseries}
\posttitle{\end{center}}


\date{\today}

\title{Financial Analysis}

\begin{document}

\maketitle

\end{document}

enter image description here

0

I think the example could be stripped down some, but, if I understand what you are looking for, this is one way to do it:

\documentclass[a4paper,11pt]{article}
\usepackage[showframe, % to help visualize the output
a4paper, left=15mm, right=15mm, top=20mm, bottom=20mm]{geometry}
\usepackage[parfill]{parskip}
\usepackage{graphicx}% 
\usepackage{mwe}% for `example-image-a`
\usepackage{titling}

\newlength\imgwd
\newlength\imght
\newcommand{\setimg}[3]{%
  % #1 = filename | #2 = width | #3 = height
  \def\imgname{#1}
  \setlength{\imgwd}{#2}
  \setlength{\imght}{#3}
}

\renewcommand{\maketitle}{%
  \insertimg
  \vspace*{\dimexpr -\imght -1.2\baselineskip \relax}%
  {\pretitle \thetitle \posttitle}%
  \begin{center}
  {\preauthor \theauthor \postauthor}%
  \par
  {\predate \thedate \postdate}%
  \end{center}
}

\newcommand\insertimg{%
  \par\noindent
  \includegraphics[width=\imgwd,height=\imght]{\imgname}}

\renewcommand{\pretitle}{\par\LARGE\bfseries\centering}
\renewcommand{\posttitle}{\par}
\renewcommand{\preauthor}{\bfseries}
\renewcommand{\postauthor}{}
\renewcommand{\predate}{}
\renewcommand{\postdate}{}

\setimg{example-image-a}{7cm}{2cm}
\title{Financial Analysis}
\author{Karl Polanyi}
\date{\today}

\begin{document}

\maketitle

% For comparison
\bigskip

\begin{center}
{\LARGE\bfseries \thetitle}

\theauthor

\thedate
\end{center}

\end{document}

The main addition is the \setimg command, which allows you to specify the image and dimensions at the same time you provide all the other document 'metadata'. (I also used the titling packages \pre-/\post-commands, but there is no real advantage to do so when the \maketitle command is redefined ... beyond, I suppose, the fact that the those command names are quite sensible ones.)

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.