# Leave space for three logos on the title page [closed]

I am working on realizing a thesis template according to the requirements of my University. I would like to have the space for three logos in the title page, a big logo in the middle and two smaller on either side. However, to keep the template flexible enough, I would like to give the user the opportunity to use just one (or two) logos. I've implemented this in the following way

\renewcommand{\maketitle}{\begin{titlepage}
\centering
\hfill
\ifx \@smallLogoLeft \@empty
\else
\includegraphics[width=3cm,height=3cm]{\@smallLogoLeft}
\fi
\hfill
\ifx \@LogoCenter \@empty
\else
\includegraphics[width=8cm,height=3cm]{\@LogoCenter}
\fi
\hfill
\ifx \@smallLogoRight \@empty
\else
\includegraphics[width=3cm,height=3cm]{\@smallLogoRight}
\fi
\hfill

\par
\vspace{1cm}
{\scshape\LARGE \@department \par}
\vspace{2.5cm}
{\huge\bfseries \@title \par}
\vspace{2cm}
{\Large\itshape \@author \par}
\vfill
\@titlepagesentence

\vfill

{\large \@submissiondate \par}
\end{titlepage}}


which I think it's a naive attempt to solve the problem. What would you people suggest in order to implement it more stable way? Thank you!

Over time, I found that the xcoffin package will solve all my problems of positioning things exactly where I wanted them. This is very useful in cover design, thesis in particular, which often have very strict requirements.

The idea is simple: you put your contents in special boxes (coffins) that have handles and then you attach the coffin (\Join... ) using those handles and adding horizontal o vertical shifts if necessary. One coffin, I called Frame, of zero dimensions, serves as a collector for the others.

In this way if you comment a Join the coffin will disappear from the assembly without perturbing the others. The same thing will happen if you fill (Set) it with no content. The \csr and \crl do just that.

I defined a \maketitlex with two optional parameters, the left and right logo, so there are 4 possible results, as the images show.

Please see my more complete answer to a similar question:

I need a rather complex layout for a scholarly edition and don't know where to start

I added a chapter, headings, and some text to simulate a more realistic scenario.

 \documentclass[a4paper]{book}

\usepackage{kantlipsum} %dummy text
\usepackage{xcoffins}
\usepackage{fancyhdr} %
\fancypagestyle{empty}{}
\fancyhf{}
\fancyhead[RE,LO]{\rmfamily \small \nouppercase \leftmark}

\usepackage{graphicx}

\NewCoffin\Frame
\NewCoffin\smallLogoLeft
\NewCoffin\smallLogoRight
\NewCoffin\smallLogoAbove
\NewCoffin\LogoCenter
\NewCoffin\departmentx
\NewCoffin\titlex
\NewCoffin\authorx

\usepackage{xparse}

\NewDocumentCommand{\maketitlex}{ O{} O{}  m }{%
\SetHorizontalCoffin\Frame{} % empty before reuse
\csl{#1}%
\csr{#2}%
\SetHorizontalCoffin\LogoCenter{\includegraphics[width=150pt, height=50pt]{#3}}
\SetHorizontalCoffin\departmentx{\scshape\LARGE Department of lost objects}
\SetVerticalCoffin\titlex{\textwidth}{\Huge \sffamily \centering My most fantastic accomplishment \par so  far}
\SetHorizontalCoffin\authorx{\Large\itshape Just me}
\JoinCoffins\Frame[hc,vc]\LogoCenter[l,vc](100pt,0pt)
\JoinCoffins*\Frame[\LogoCenter-r,\LogoCenter-vc]\smallLogoRight[l,vc](20pt,0pt)
\JoinCoffins*\Frame[\LogoCenter-l,\LogoCenter-vc]\smallLogoLeft[r,vc](-20pt,0pt)
\JoinCoffins*\Frame[\LogoCenter-hc, \LogoCenter-b]\titlex[hc,vc](0pt,-100pt)
\JoinCoffins*\Frame[\titlex-hc,\titlex-b]\authorx[hc,t](0pt, -40pt)
\JoinCoffins*\Frame[\authorx-hc,\authorx-b]\departmentx[hc,t](0pt, -120pt)
\noindent\TypesetCoffin\Frame(0pt, -100pt)
\cleardoublepage
}

%%https://tex.stackexchange.com/questions/127502/difference-between-if-and-ifx

\newcommand{\csr}[1]{%
\if\relax\detokenize{#1}\relax
\SetHorizontalCoffin\smallLogoRight{}
\else
\SetHorizontalCoffin\smallLogoRight{\includegraphics[width=30pt]{#1}}%
\fi
}

\newcommand{\csl}[1]{%
\if\relax\detokenize{#1}\relax
\SetHorizontalCoffin\smallLogoLeft{}
\else
\SetHorizontalCoffin\smallLogoLeft{\includegraphics[width=30pt]{#1}}
\fi
}

\begin{document}

\pagestyle{empty}

\maketitlex{example-image-A}    %only center

\maketitlex[example-image-B][]{example-image-A} %center + left

\maketitlex[][example-image-C]{example-image-A}  %center +right

\maketitlex[example-image-B][example-image-C]{example-image-A}  %all

\pagestyle{fancy}
\chapter{Introduction}

\kant[1-10]

\end{document}