如何使该图片居中?

如何使该图片居中?
\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} 

我想让这张图片居中

在此处输入图片描述

答案1

只需省略\rlap\llap包装器。当然,这只有在两个\Longstack对象之间有足够的空间时才有效——幸运的是,手头的文档就是这种情况。

在此处输入图片描述

\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} 

相关内容