把这张图片放在中心

把这张图片放在中心
    \documentclass[a4paper,10pt]{article} %
    \usepackage{pifont} %bouni  
    %-----accent                        
    \usepackage[latin1]{inputenc} %écrire directement les accents et il peut poser des problème
    \usepackage[T1]{fontenc}
      %-----
    \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
     \usepackage{graphicx}                    % Enable pdflatex
      \usepackage{wrapfig}
      \usepackage{amsmath,amsfonts,amsthm}     % Math packages
      %%%%%%%%%%%%% dimension ancien des marges %%%%%%%%%%%%%%%%%%%%
      \usepackage{geometry}
      \geometry{left=2cm,right=2cm,top=1.5cm,bottom=1.5cm}
      %%%%%%%%%%%%% style des sections %%%%%%%%%%%%%%%%%%%%
     \frenchspacing              % Better looking spacings after periods
      \usepackage{sectsty}
      \sectionfont{%                        % Change font of \section command
    \usefont{OT1}{phv}{b}{n}%       % bch-b-n: CharterBT-Bold font
     \sectionrule{0pt}{0pt}{-5pt}{1pt}}
     %%%%%%%%%%%%%%%% Macros %%%%%%%%%%%%%%%%%%%%
      \newcommand{\sepspace}{\vspace*{1em}}     % Vertical space macro
      \newcommand{\MyName}[1]{ % Name
        \Huge \usefont{OT1}{phv}{b}{n} \hfill #1
        \par \normalsize \normalfont}
      \newcommand{\MySlogan}[1]{ % Slogan}{optional)
    \large \usefont{OT1}{phv}{m}{n}\hfill \textit{#1}
    \par \normalsize \normalfont}
      %%% ------------------------------------------------------------
      \pagestyle{empty}           % No pagenumbers/headers/footers
     %%%%%%%%%%%%%%%%%%%%% Begin Document %%%%%%%%%%%%%%%%%%%%%%%%%
     \begin{document}
     %%%%%%%%%%%%%%%%%% Photo et title %%%%%%%%%%%%%%%%%%%%%%%%%
    %---------------------------
   \begin{wrapfigure}{l}{0.5\textwidth}
   \vspace*{-2em}
   \includegraphics[width=0.15\textwidth]{picture}
    \end{wrapfigure}
   %---------------------------
   \MyName{Name Name}
    \MySlogan{Curriculum Vitae (\today)}
    %\MySlogan{Curriculum Vitae (October 2016)}
    %---------------------------
    \sepspace  % Si on ajoute encore \sepspace on aura plus d'espace
    $$$$
     %%%%%%%%%%%%%% Personal details%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \section*{Informations personelles}

    \end{document}

编译后我得到

在此处输入图片描述

然而我的目标是获得

在此处输入图片描述

答案1

通过以下修改,您可以获得所需的输出。

        \documentclass[a4paper,10pt,demo    ]{article} %
    \usepackage{pifont} %bouni  
    %-----accent                        
    \usepackage[latin1]{inputenc} %écrire directement les accents et il peut poser des problème
    \usepackage[T1]{fontenc}
      %-----
    \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
     \usepackage{graphicx}                    % Enable pdflatex
      \usepackage{wrapfig}
      \usepackage{amsmath,amsfonts,amsthm}     % Math packages
      %%%%%%%%%%%%% dimension ancien des marges %%%%%%%%%%%%%%%%%%%%
      \usepackage{geometry}
      \geometry{left=2cm,right=2cm,top=1.5cm,bottom=1.5cm}
      %%%%%%%%%%%%% style des sections %%%%%%%%%%%%%%%%%%%%
     \frenchspacing              % Better looking spacings after periods
      \usepackage{sectsty}
      \sectionfont{%                        % Change font of \section command
    \usefont{OT1}{phv}{b}{n}%       % bch-b-n: CharterBT-Bold font
     \sectionrule{0pt}{0pt}{-5pt}{1pt}}
     %%%%%%%%%%%%%%%% Macros %%%%%%%%%%%%%%%%%%%%
      \newcommand{\sepspace}{\vspace*{1em}}     % Vertical space macro
      \newcommand{\MyName}[1]{ % Name
        \Huge \usefont{OT1}{phv}{b}{n} \hfill #1
        \par \normalsize \normalfont}
      \newcommand{\MySlogan}[1]{ % Slogan}{optional)
    \large \usefont{OT1}{phv}{m}{n}\hfill \textit{#1}
    \par \normalsize \normalfont}
      %%% ------------------------------------------------------------
      \pagestyle{empty}           % No pagenumbers/headers/footers
     %%%%%%%%%%%%%%%%%%%%% Begin Document %%%%%%%%%%%%%%%%%%%%%%%%%
     \begin{document}
     %%%%%%%%%%%%%%%%%% Photo et title %%%%%%%%%%%%%%%%%%%%%%%%%
    %---------------------------
   \begin{wrapfigure}{l}{0.5\textwidth}
   \vspace*{-2em}
   \hfill\makebox[0.075\textwidth][l]{\includegraphics[width=0.15\textwidth]{picture}}
    \end{wrapfigure}
   %---------------------------
   \MyName{Name Name}
    \MySlogan{Curriculum Vitae \\ \null\hfill  (\today)}
    %\MySlogan{Curriculum Vitae (October 2016)}
    %---------------------------
    \sepspace  % Si on ajoute encore \sepspace on aura plus d'espace
    $$$$
     %%%%%%%%%%%%%% Personal details%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \section*{Informations personelles}

    \end{document}

在此处输入图片描述

如果您想应用到您的图片,您应该删除demo选项。

答案2

我找到了一个通过\begin{flushright}命令和一些手动调整的解决方案。

 \documentclass[a4paper,10pt,demo]{article} %
    \usepackage{pifont} %bouni  
    %-----accent                        
    \usepackage[latin1]{inputenc} %écrire directement les accents et il peut poser des problème
    \usepackage[T1]{fontenc}
      %-----
    \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
     \usepackage{graphicx}                    % Enable pdflatex
      \usepackage{wrapfig}
      \usepackage{amsmath,amsfonts,amsthm}     % Math packages
      %%%%%%%%%%%%% dimension ancien des marges %%%%%%%%%%%%%%%%%%%%
      \usepackage{geometry}
      \geometry{left=2cm,right=2cm,top=1.5cm,bottom=1.5cm}
      %%%%%%%%%%%%% style des sections %%%%%%%%%%%%%%%%%%%%
     \frenchspacing              % Better looking spacings after periods
      \usepackage{sectsty}
      \sectionfont{%                        % Change font of \section command
    \usefont{OT1}{phv}{b}{n}%       % bch-b-n: CharterBT-Bold font
     \sectionrule{0pt}{0pt}{-5pt}{1pt}}
     %%%%%%%%%%%%%%%% Macros %%%%%%%%%%%%%%%%%%%%
      \newcommand{\sepspace}{\vspace*{1em}}     % Vertical space macro
      \newcommand{\MyName}[1]{ % Name
        \Huge \usefont{OT1}{phv}{b}{n} \hfill #1
        \par \normalsize \normalfont}
      \newcommand{\MySlogan}[1]{ % Slogan}{optional)
    \large \usefont{OT1}{phv}{m}{n}\hfill \textit{#1}
    \par \normalsize \normalfont}
      %%% ------------------------------------------------------------
      \pagestyle{empty}           % No pagenumbers/headers/footers
     %%%%%%%%%%%%%%%%%%%%% Begin Document %%%%%%%%%%%%%%%%%%%%%%%%%
     \begin{document}
     %%%%%%%%%%%%%%%%%% Photo et title %%%%%%%%%%%%%%%%%%%%%%%%%
    %---------------------------
   \begin{wrapfigure}{l}{16cm}
   \vspace*{-16em}
   \begin{center}
   \includegraphics[width=0.15\textwidth]{picture}
   \end{center}
    \end{wrapfigure}
   %---------------------------
   \begin{flushright}
   \MyName{Name Name}
    \MySlogan{Curriculum Vitae\\ (\today)}
    %\MySlogan{Curriculum Vitae (October 2016)}
    %---------------------------
    \sepspace  % Si on ajoute encore \sepspace on aura plus d'espace
    \end{flushright}
    $$$$
     %%%%%%%%%%%%%% Personal details%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \section*{Informations personelles}

    \end{document}

在此处输入图片描述

相关内容