把图片放在右边,把名字放在左边

把图片放在右边,把名字放在左边

根据这个回答我们有:

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

在此处输入图片描述

不过,我认为如果我们能这样就更好了

在此处输入图片描述

答案1

wrapfigure是错误的工具。

以下是您提到的两种方法。

\documentclass[a4paper,10pt]{article}
\usepackage[T1]{fontenc}

\usepackage{geometry}
\geometry{left=2cm,right=2cm,top=1.5cm,bottom=1.5cm}

\usepackage{pifont}
\usepackage{sectsty}

\usepackage{graphicx}
\usepackage{amsmath,amsfonts,amsthm}

\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}

\frenchspacing
\sectionfont{%
  \fontfamily{phv}\bfseries
  \sectionrule{0pt}{0pt}{-5pt}{1pt}%
}
\pagestyle{empty}

\begin{document}

%%%%%%%%%%%%%%%%%% Photo et title %%%%%%%%%%%%%%%%%%%%%%%%%

\begin{flushleft}

\hspace*{\fill}%
\begin{tabular}{@{}c@{}}
  \includegraphics[width=0.15\textwidth]{example-image-9x16}
\end{tabular}
\hspace*{\fill}%
\makebox[0pt][r]{%
  \fontfamily{phv}\large
  \begin{tabular}{@{}r@{}}
  \Huge\bfseries Name Name \\[1ex]
  Curriculum Vitae\\ (\today)
  \end{tabular}%
}

\end{flushleft}

\section*{Informations personelles}

\bigskip

\begin{flushleft}

\makebox[0pt][l]{%
  \fontfamily{phv}\large
  \begin{tabular}{@{}l@{}}
  \Huge\bfseries Name Name \\[1ex]
  Curriculum Vitae\\ (\today)
  \end{tabular}%
}
\hspace*{\fill}%
\begin{tabular}{@{}c@{}}
  \includegraphics[width=0.15\textwidth]{example-image-9x16}
\end{tabular}

\end{flushleft}

\section*{Informations personelles}

\end{document}

在此处输入图片描述

另一种变化:

\begin{flushleft}

\hspace*{\fill}%
\fontfamily{phv}\large
\begin{tabular}{@{}l@{}}
\Huge\bfseries Name Name \\[1ex]
Curriculum Vitae\\ (\today)
\end{tabular}%
\hspace*{\fill}%
\makebox[0pt][r]{%
  \begin{tabular}{@{}c@{}}
  \includegraphics[width=0.15\textwidth]{example-image-9x16}
  \end{tabular}
}

\end{flushleft}

在此处输入图片描述

答案2

如果我是你,我绝对会使用tikz

    \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{amsmath,amsfonts,amsthm}     % Math packages
      \usepackage{tikz}
      %%%%%%%%%%%%% 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\mytitle[3]{%
    \noindent\begin{tikzpicture}
        \node [align=left] (name) at (0,0) 
        {\Huge\usefont{OT1}{phv}{b}{n}#1\\
        \large\usefont{OT1}{phv}{m}{n}\textit{#2}\\(#3)};
        \node [anchor=east, xshift=-.15\textwidth] at (\textwidth, 0) {\includegraphics[width=0.15\textwidth]{picture}};
    \end{tikzpicture}%
    }
      %%% ------------------------------------------------------------
      \pagestyle{empty}           % No pagenumbers/headers/footers
     %%%%%%%%%%%%%%%%%%%%% Begin Document %%%%%%%%%%%%%%%%%%%%%%%%%
     \begin{document}
\mytitle{Name Name}{Curriculum Vitae}{\today}
 %%%%%%%%%%%%%% Personal details%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Informations personelles}

\end{document}

在此处输入图片描述

PS 您也可以修改代码来实现上图,而无需使用tikz

答案3

\documentclass[a4paper,10pt,demo]{article} %
%%%%%%%%%%%%% dimension ancien des marges %%%%%%%%%%%%%%%%%%%%
\usepackage[hmargin=2cm, lmargin=1.5cm]{geometry}
%   \geometry{left=2cm,right=2cm,top=1.5cm,bottom=1.5cm}
%-----accent
%\usepackage[latin1]{inputenc} %écrire directement les accents et il peut poser des problème
%\usepackage[T1]{fontenc}
\usepackage{pifont} %bouni
  %-----
\usepackage[demo,
            export]{adjustbox}          % also load graphicx,
                                        % enable insert and positioning images
%\usepackage{wrapfig}
\usepackage{amsmath,amsfonts,amsthm}    % Math packages
\usepackage{makecell}                   % Table package
%%%%%%%%%%%%% 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
            \fontfamily{phv}\Huge\sffamily\textbf{#1}}
\newcommand{\MySlogan}[1]{ % Slogan}{optional)
            \fontfamily{phv}\large\sffamily\slshape #1}
%%% ------------------------------------------------------------
\usepackage[colorlinks=true,
            linkcolor=blue,
            urlcolor=blue]{hyperref}    % had to be the last in preamble

%%%%%%%%%%%%%%%%%%%%% Begin Document %%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{empty}           % No pagenumbers/headers/footers
\begin{document}
%%%%%%%%%%%%%%%%%% Photo et title %%%%%%%%%%%%%%%%%%%%%%%%%
%---------------------------
\noindent\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} l r}
\makecell[r]{
\MyName{Name Name}
\MySlogan{Curriculum Vitae\\ (\today)}
             }
    &   \includegraphics[width=0.15\textwidth, valign=c]{picture}
\end{tabular*}
%---------------------------
\sepspace  % Si on ajoute encore \sepspace on aura plus d'espace
%%%%%%%%%%%%%% Personal details%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Informations personelles}

\end{document}

使用表格来放置您的姓名和图像可让您自由地将它们放置在您想要的位置。只需将其插入到相应的列中:(第一列是文本,最后一列是图像,反之亦然)。我还稍微简化和重新组织了您的序言。

编辑:的定义\MyName\MySlogan表组织已更改(改进)。

在此处输入图片描述

相关内容