0
        \documentclass[a4paper,10pt,demo]{article} %

    \usepackage[en-US]{datetime2} % <=======================================
   \DTMlangsetup[en-US]{ord=raise}

  \usepackage{etoolbox} % <===============================================
    \patchcmd{\DTMenglishordinal}% <cmd> <==================================
 {#1 \DTMenglishfmtordsuffix}% <search>
  {#1\,\DTMenglishfmtordsuffix}% <replace>
    {}{}% <success><failure>
%%%%%%%%%%%%% 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\\ (\DTMsavedate{mydate}{2019-04-9}   \DTMusedate{mydate})}
             }
    &   \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}

I want to put the date below the name as follows

enter image description here

  • 1
    You can use \\ after \MyName{Name Name} (and \makecell[l] to align left). Note that your example is not really minimal, you could remove all the date stuff, the etoolbox macros, the sectioning commands, the fonts, the math packages, etc. – Marijn Jun 4 at 9:59
  • @Marijn Please I don't understand how to use \makecell[l] – Schüler Jun 4 at 10:05
0

Within \makecell a line break (\\) can be used, which puts \MySlogan on the next line below the name. The cell is aligned right (\makecell[r]), therefore the date will be below the second part of the name. To change this you can align the cell left with \makecell[l].

MWE, shortened a bit:

\documentclass{article} %
%%%%%%%%%%%%% dimension ancien des marges %%%%%%%%%%%%%%%%%%%%
\usepackage[hmargin=2cm, lmargin=1.5cm]{geometry}
\usepackage[demo]{graphicx}
\usepackage{makecell}                   % Table package
%%%%%%%%%%%%%%%% Macros %%%%%%%%%%%%%%%%%%%%
\newcommand{\MyName}[1]{ % Name
            \fontfamily{phv}\Huge\sffamily\textbf{#1}}
\newcommand{\MySlogan}[1]{ % Slogan}{optional)
            \fontfamily{phv}\large\sffamily\slshape #1}
%%% ------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%% Begin Document %%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%% Photo et title %%%%%%%%%%%%%%%%%%%%%%%%%
%---------------------------
\noindent\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} l r}
\makecell[l]{
\MyName{Name Name}\\
\MySlogan{Curriculum Vitae\\ (April 9th, 2019)}
}
    &   \includegraphics[width=0.15\textwidth]{picture}
\end{tabular*}
%---------------------------
\vspace*{1em}
%%%%%%%%%%%%%% Personal details%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Informations personelles}

\end{document}

Result:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.