1
\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc} % not needed in new latex versions
\usepackage[T1]{fontenc}
\usepackage{amsfonts,amsmath,amssymb,graphicx,amsthm,mathtools,systeme}
\usepackage[tikz]{bclogo}
\usepackage{tikz,tkz-tab,moreverb} % tableau de signe moreverb not needed
\usetikzlibrary{arrows}
\usepackage[french]{babel}
\usepackage{pifont} %bouni
\usepackage{fancybox} %pour faire l'encadrement
\usepackage[usestackEOL]{stackengine}
\usepackage{verbatim}
\usepackage{color}
\usepackage[final]{pdfpages} %pour inserer une page pdf
\usepackage{awesomebox}
%---- Dimensions des marges ---
\usepackage{geometry}
\geometry{left=1.5cm,right=1.5cm,top=2.0cm,bottom=2.5cm}
%\usepackage{setspace}
%\onehalfspacing
%---- pages numbers with tikz---
\usepackage{fancyhdr}
\usepackage{lastpage}
\usetikzlibrary{shapes}
\fancypagestyle{mypagestyle}{%
    \renewcommand{\headrulewidth}{0pt}
    \fancyhf{}
    \fancyfoot[C]{\tikz{ \node [rectangle, draw = black] (rectangle) at (0,0) {\thepage/\pageref{LastPage}}   }}
}
\pagestyle{mypagestyle}
%----New Structure Exercice -----
\newtheoremstyle{sboxexc}% name of the style to be used
  {\topsep}% measure of space to leave above the theorem. E.g.: 3pt
  {\topsep}% measure of space to leave below the theorem. E.g.: 3pt
  {\itshape}% name of font to use in the body of the theorem
  {0pt}%  of space to indent
  {\bfseries}% name of head font
  {}% punctuation between head and body
  { }% space after theorem head; " " = normal interword space
  {\thmname{#1}}% Manually specify head
\newcounter{counter}
\setcounter{counter}{1}
\theoremstyle{sboxexc}
\newcommand{\optionaltext}{}
\newtheorem*{Exc}{\shadowbox{\ding{228} Exercice \arabic{counter}\optionaltext}}
\newcommand{\exo}[2][]{\renewcommand{\optionaltext}{#2}\begin{Exc}\normalfont\mbox{}\par}
\newcommand{\finexo}{\renewcommand{\optionaltext}{}\end{Exc}\addtocounter{counter}{1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\isEquivTo}[1]{\underset{#1}{\sim}}
\newcommand*{\transp}[2][-3mu]{\ensuremath{\mskip1mu\prescript{\smash{\mathrm t\mkern#1}}{}{\mathstrut#2}}}%
\DeclareMathOperator{\im}{Im}
\DeclareMathOperator{\rg}{rg}
\DeclareMathOperator{\vect}{Vect}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{sfaxlogo}{RGB}{127,176,206}
\colorlet{sfaxblue}{sfaxlogo!70!black!60!blue}
\pagestyle{empty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%------------%%%%%%%%%%%%%%%%%%%%%%%%%%%begin entete pour mes TD%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%------
%----------------------------------------------
\mbox{}\begin{figure*}[t]
     \bfseries
     \leavevmode\rlap{
     \Longstack{
 Republic of xxxxx\\
             Ministry of Higher Education\\
      and scientific Research\\
\textbf{-- -- -- $\star\star\star$ -- -- --}\\
     University of xxxx   \\
     Faculty of Sciences of xxxx
      }}\hfill%
     \includegraphics[width=3.0cm,height=3.0cm]{example-image-9x16}\hfill%
     \llap{
  \Longstack{
   Department of Xxxxxxxxxxx\\
       $\dotfill\dotfill\dotfill \star\star\star \dotfill\dotfill\dotfill$\\
 Laboratory: Physics-Xxxxxxxxxxx\\
  and Xxxxxxxxxxxx (LR/xx/XX--xx)\\
    $\dotfill\dotfill\dotfill \star\star\star \dotfill\dotfill\dotfill$
           \\
Academic Year: 2022 / 2023
           }}

    \stackunder[1pt]{\rule{\linewidth}{1.2pt}}
           {\rule{\linewidth}{1.2pt}}
    \end{figure*}
%----------------------------------------------
%\vspace*{1.1cm}
%--

\vspace{0.5cm}
\begin{center}
\textbf{{\LARGE \textcolor{sfaxblue}{Thesis in xxxxxx}}}
\end{center}
\end{document} 

I want to center this picture

enter image description here

3
  • Off-topic: Why are you employing a figure*[t] environment? Wouldn’t a center environment be simpler?
    – Mico
    Sep 25, 2022 at 20:50
  • @Mico I don't know and just copy it from another answer. I you can improve it, I will be happy. Thanks
    – Student
    Sep 26, 2022 at 8:08
  • Your current setup places the image precisely in the cneter of the text area, regardless of the text to the right or left. Sep 26, 2022 at 15:12

1 Answer 1

1

Just omit the \rlap and \llap wrappers. Of course, this only works if there’s enough space between the two \Longstack objects —- which, happily is the case for the document at hand.

enter image description here

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc} % not needed in new latex versions
\usepackage[T1]{fontenc}
\usepackage{amsfonts,amsmath,amssymb,graphicx,amsthm,mathtools,systeme}
\usepackage[tikz]{bclogo}
\usepackage{tikz,tkz-tab,moreverb} % tableau de signe moreverb not needed
\usetikzlibrary{arrows}
\usepackage[french]{babel}
\usepackage{pifont} %bouni
\usepackage{fancybox} %pour faire l'encadrement
\usepackage[usestackEOL]{stackengine}
\usepackage{verbatim}
\usepackage{color}
\usepackage[final]{pdfpages} %pour inserer une page pdf
\usepackage{awesomebox}
%---- Dimensions des marges ---
\usepackage{geometry}
\geometry{left=1.5cm,right=1.5cm,top=2.0cm,bottom=2.5cm}
%\usepackage{setspace}
%\onehalfspacing
%---- pages numbers with tikz---
\usepackage{fancyhdr}
\usepackage{lastpage}
\usetikzlibrary{shapes}
\fancypagestyle{mypagestyle}{%
    \renewcommand{\headrulewidth}{0pt}
    \fancyhf{}
    \fancyfoot[C]{\tikz{ \node [rectangle, draw = black] (rectangle) at (0,0) {\thepage/\pageref{LastPage}}   }}
}
\pagestyle{mypagestyle}
%----New Structure Exercice -----
\newtheoremstyle{sboxexc}% name of the style to be used
  {\topsep}% measure of space to leave above the theorem. E.g.: 3pt
  {\topsep}% measure of space to leave below the theorem. E.g.: 3pt
  {\itshape}% name of font to use in the body of the theorem
  {0pt}%  of space to indent
  {\bfseries}% name of head font
  {}% punctuation between head and body
  { }% space after theorem head; " " = normal interword space
  {\thmname{#1}}% Manually specify head
\newcounter{counter}
\setcounter{counter}{1}
\theoremstyle{sboxexc}
\newcommand{\optionaltext}{}
\newtheorem*{Exc}{\shadowbox{\ding{228} Exercice \arabic{counter}\optionaltext}}
\newcommand{\exo}[2][]{\renewcommand{\optionaltext}{#2}\begin{Exc}\normalfont\mbox{}\par}
\newcommand{\finexo}{\renewcommand{\optionaltext}{}\end{Exc}\addtocounter{counter}{1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\isEquivTo}[1]{\underset{#1}{\sim}}
\newcommand*{\transp}[2][-3mu]{\ensuremath{\mskip1mu\prescript{\smash{\mathrm t\mkern#1}}{}{\mathstrut#2}}}%
\DeclareMathOperator{\im}{Im}
\DeclareMathOperator{\rg}{rg}
\DeclareMathOperator{\vect}{Vect}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{sfaxlogo}{RGB}{127,176,206}
\colorlet{sfaxblue}{sfaxlogo!70!black!60!blue}
\pagestyle{empty}

\begin{document}

\mbox{}\begin{figure*}[t]
     \bfseries
     \leavevmode%
     \Longstack{%
 Republic of xxxxx\\
             Ministry of Higher Education\\
      and scientific Research\\
\textbf{-- -- -- $\star\star\star$ -- -- --}\\
     University of xxxx   \\
     Faculty of Sciences of xxxx
      }\hfill%
     \includegraphics[width=3.0cm,height=3.0cm]{example-image-9x16}\hfill%
  \Longstack{%
   Department of Xxxxxxxxxxx\\
       $\dotfill\dotfill\dotfill \star\star\star \dotfill\dotfill\dotfill$\\
 Laboratory: Physics-Xxxxxxxxxxx\\
  and Xxxxxxxxxxxx (LR/xx/XX--xx)\\
    $\dotfill\dotfill\dotfill \star\star\star \dotfill\dotfill\dotfill$
           \\
Academic Year: 2022/2023
}

    \stackunder[1pt]{\rule{\linewidth}{1.2pt}}
           {\rule{\linewidth}{1.2pt}}
    \end{figure*}
%----------------------------------------------
%\vspace*{1.1cm}
%--

\vspace{0.5cm}
\begin{center}
\textbf{{\LARGE \textcolor{sfaxblue}{Thesis in xxxxxx}}}
\end{center}
\end{document} 

You must log in to answer this question.

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