1

I am trying to create a simple cover page, which will have 3 logos at the top. The left one flush with left margin, the right one flush with right and the centre one at the centre. It has proven to be very hard. The following figure shows roughly what I want. This is what I want I have tried subcaption/subfigure method, tabular/tabularx method. But none of them works as desired.

'''

\documentclass{article}
\usepackage{tabularx}
\usepackage{geometry} %for customizing page layout
    \newgeometry{tmargin=2.5cm,bmargin=2.5cm,lmargin=3cm,rmargin=3cm}
\usepackage{booktabs}
\usepackage{graphicx}



\begin{document}

\begin{tabularx}{1\linewidth}{|*{3}{X|}}
\centering
\includegraphics[height=1cm]{images/logo1.jpg} &
\includegraphics[height=1.2cm]{images/logo2.png}&
\includegraphics[height=1.2cm]{images/logo3.png}&
\end{tabularx}
\vspace{2cm}

\end{document}  
    

''' After the code one can type some gibberish, to see the margins of the text (as shown in the figure that shows the result of my code). my result

I shall also provide the three logo files for image size and applicability of code. I hope this is in accordance to the community posting guidelines. I am quite new to latex. Thanks in advance.

logo1

logo2

logo3

All three logos should have a similar height (despite having different aspect ratios, their width can be different though). I have used 1.2cm, 1.2cm and 1 cm respectively.

NOTE: UPDATE: I would like top place the centre image with equal whitespace with the other ones. However, it would be great if the method suggested has some flexibility to add a bit of hspace.

1
  • 1
    Would you like to place the second image centered between teh other two images (equal white space on both sides) or do you want to place it horizontally centered with repsect to the textwidth? Please clarify.
    – leandriis
    Jan 8, 2022 at 9:50

2 Answers 2

3

If you're sure that your images don't overlap, you can just do

\noindent
\makebox[\textwidth][s]{%
  % first image flush left
  \makebox[0pt][l]{\includegraphics[height=1cm]{images/logo1.jpg}}%
  \hfil
  % second image centered
  \includegraphics[height=1.2cm]{images/logo2.png}%
  \hfil
  % third image flush right
  \makebox[0pt][r]{\includegraphics[height=1.2cm]{images/logo3.png}}%
}

I add here a full example using geometry to increase the width.

\documentclass{article}
\usepackage[a4paper,margin=2cm,showframe]{geometry}
\usepackage{graphicx}

\begin{document}

\noindent
\makebox[\textwidth][s]{%
  % first image flush left
  \makebox[0pt][l]{\includegraphics[height=1cm]{images/logo1.jpg}}%
  % a possible correction to move the center image a bit to the right
  \hspace{0pt}% here 0pt because there's no overlap
  \hfil
  % second image centered
  \includegraphics[height=1.2cm]{images/logo2.png}%
  \hfil
  % third image flush right
  \makebox[0pt][r]{\includegraphics[height=1.2cm]{images/logo3.png}}%
}

\vspace{2cm}

\begin{center}
\Huge Title
\end{center}

\end{document}

The showframe option is used to show the alignment with respect to the page margin.

enter image description here

You might choose instead to move the external logos a bit outside the page margin.

\documentclass[a4paper]{article}
\usepackage[pass,showframe]{geometry}
\usepackage{graphicx}

\begin{document}

\noindent
\makebox[\textwidth][s]{%
  % first image flush left but moved somewhat outside the margin
  \hspace{-4em}%
  \makebox[0pt][l]{\includegraphics[height=1cm]{images/logo1.jpg}}%
  \hfil
  % second image centered
  \includegraphics[height=1.2cm]{images/logo2.png}%
  \hfil
  % third image flush right but moved somewhat outside the margin
  \makebox[0pt][r]{\includegraphics[height=1.2cm]{images/logo3.png}}%
  \hspace{-4em}%
}

\vspace{2cm}

\begin{center}
\Huge Title
\end{center}

\end{document}

Here geometry does not act on the default page dimensions, it is just loaded for the showframe option.

enter image description here

1

You can use the tabular* environment to distribute the logos across the page, with equal space in between (first) or use a simpler code (second).

Or use three minipages, 1/3 of textwidth wide, to have the second logo centered on the page (third).

e

\documentclass{article}
\usepackage{tabularx}
\usepackage{geometry} %for customizing page layout
\newgeometry{tmargin=2.5cm,bmargin=2.5cm,lmargin=3cm,rmargin=3cm}
\usepackage{booktabs}
\usepackage{graphicx}

\usepackage{showframe}% show margins

\begin{document}
        tabular
    
    \setlength{\tabcolsep}{0pt}
    \noindent\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}|l|c|r|}
        \includegraphics[height=1cm]{images/logo1.jpg} &
        \includegraphics[height=1.2cm]{images/logo2.png}&
        \includegraphics[height=1.2cm]{images/logo3.png}
    \end{tabular*}
    
    \vspace{2cm}
        
    simple
 
    \noindent\includegraphics[height=1cm,keepaspectratio]{images/logo1.jpg}\hfill
    \includegraphics[height=1.2cm,keepaspectratio]{images/logo2.png}\hfill
    \includegraphics[height=1.2cm,keepaspectratio]{images/logo3.png}
    
    \vspace{2cm}

    minipage 
    
    \noindent\begin{minipage}{0.33\textwidth}
        \raggedright \includegraphics[height=1cm,keepaspectratio]{images/logo1.jpg}
    \end{minipage}\hfill
    \begin{minipage}{0.33\textwidth}
        \centering  \includegraphics[height=1.2cm,keepaspectratio]{images/logo2.png}
    \end{minipage}\hfill
    \begin{minipage}{0.33\textwidth}
        \raggedleft \includegraphics[height=1.2cm,keepaspectratio]{images/logo3.png}
    \end{minipage}  
    
\end{document}  

Frames around the minipages to show the alignment.

z

You must log in to answer this question.

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