将日期写在名字下面

将日期写在名字下面
        \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}

我想将日期放在名字下面,如下所示

在此处输入图片描述

答案1

可以使用\makecell换行符 ( ),将下一行放在名称下方。单元格右对齐 ( ) ,因此日期将位于名称的第二部分下方。要更改此设置,您可以使用 将单元格左对齐。\\\MySlogan\makecell[r]\makecell[l]

MWE,缩短一点:

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

结果:

在此处输入图片描述

相关内容