0

I'm a beginner and I try since yesterday to put a logo on the left corner and text on the right corner, like this : enter image description here but I just can't do it. Could you please help me?

Sorry for my english, I'm a French speaker.

\documentclass[10pt,a4paper]{report} 
\usepackage[latin5]{inputenc} 
\usepackage[francais]{babel} 
\usepackage[T1]{fontenc} 
\usepackage{amsmath} 
\usepackage{amsfonts} 
\usepackage{amssymb} 
\usepackage{graphicx} 
\usepackage{lmodern} 
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} 
\author{BATON SOFIAN} 
\begin{document} 
\begin{figure}[!h] 
\includegraphics[scale=0.5]{../Images/logo.png} 
\end{figure} 
\end{document}
8
  • Hi and welcome. Please give the code of your unsuccessful attempts.
    – AndréC
    Aug 15, 2020 at 8:17
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – TobiBS
    Aug 15, 2020 at 8:26
  • Here is my code I think it would be ok for the logo, but I don't know how to do to put text next to the logo on the right side; Aug 15, 2020 at 8:37
  • \documentclass[10pt,a4paper]{report} \usepackage[latin5]{inputenc} \usepackage[francais]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{lmodern} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \author{BATON SOFIAN} \begin{document} \begin{figure}[!h] \includegraphics[scale=0.5]{../Images/logo.png} \end{figure} \end{document} Aug 15, 2020 at 8:37

2 Answers 2

2

The following MWE results in this output. Spacing, alignment and font sizes can ouf course be altered to suit your needs.

In order to make sure the header is aligned with the left margin, I have added \noindent right before the \includegraphics command. (Here I have replaced your image file with an example image). In order to make sure, the text is right aligned and is placed at the right margin, I have used \hfill between the image and the tabular. In the tabular itself, I have used an r type column (for right alignment) as well as @{} to remove the small horizontal white pace that is added to either side of a text inside of a table cell. In order to bottom align image and text, I have added [b] to the tabular and valign=b to \includegraphics. The latter is only available if you add \usepackage[export]{adjustbox} to your preamble.

To other, unrelated changes: I have replaced francais with french (in the babel option). If you use the frormer, you should recieve a warinign about this option being deprecated. In addition to that, I have removed \usepackage[latin5]{inputenc} in order to use the default utf8 inputenc instead.

enter image description here

\documentclass[10pt,a4paper]{report} 
\usepackage[french]{babel} 
\usepackage[T1]{fontenc} 
\usepackage{amsmath} 
\usepackage{amsfonts} 
\usepackage{amssymb} 
\usepackage{graphicx} 
\usepackage{lmodern} 
\usepackage[export]{adjustbox}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} 
\author{BATON SOFIAN} 
\begin{document} 
\noindent
\includegraphics[scale=0.5, valign=b]{example-image}
\hfill
\begin{tabular}[b]{@{}r@{}}
  Tribunal...\\
  \bfseries COMMUNIQUE ...\\
  Luxembourg\\[20pt]
  Ordonnance... \\
  Luká\v{s}...\\
\end{tabular}
\smallskip

\hrule
\end{document}
1
1

\documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage{amsthm} \usepackage{empheq} \usepackage{multicol} \usepackage[english]{babel} \usepackage{graphicx}%f

\begin{document}

\begin{minipage}{0.25\textwidth}
\includegraphics[width=0.3\textwidth]{example-image}\ Presse et information \end{minipage}% \hspace{2cm} \begin{minipage}{0.7\textwidth} {\small{ Tribunal de i'Unioneurop$\acute{\text{e}}$enne.}}\\hspace*{-1cm}{ {\bf{COMMUNOQUE DE PRESSE $n^o$ 98/20}}\}\hspace*{1cm}{ {\small{Luxembourg,ie 17 juillet 2020 }}}\\ \hspace*{-1cm}{Ordonnance du Tribunal dans I'affaire T-715/19}\ Lukas Wagenknecht/Conseoil europ$\acute{\text{e}}$en\

\end{minipage} \noindent \rule{\linewidth}{0.5mm} \end{document}

2
  • 1
    Using two side by side minipage environments is generally a good idea if you want to place an image side by side with some text. There are, however, some things that could be done in order to improve your answer. First, the width of both your minipages should add up to 1 or less. Currently, it adds up to 1.3, resulting in an overfull box warning and the contents of the second minipage overflowing into the right margin. I'd suggest using 0.25\textwidth for the first minipage, 0.7\textwidth for the second minipage and \hfill instead of \hspace{2cm} inbetween the two. [...]
    – leandriis
    Aug 15, 2020 at 15:11
  • 1
    [...] You might also want to add \noindent right before the first minipage in order to prevent the slight indentation. Please also replace \bf with \bfseries as the former command is considered deprecated. (See also: “Correct” way to bold/italicize text?). Lastly, I also suggest getting rid of all the \hspace commands in the second minipage. If you want to achieve the left aligned result the OP has showed in their question, you can use \raggedleft instead.
    – leandriis
    Aug 15, 2020 at 15:12

You must log in to answer this question.

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