Datum ändern

Datum ändern
        \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 %%%%%%%%%%%%%%%%%%%%%%%%%
    %---------------------------
   %---------------------------
   \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}

Ich möchte ''th'' wie folgt in das Datum einfügen

Bildbeschreibung hier eingeben

Antwort1

Der Täter ist hier

  1. um das richtige Layout für Ihr Wunschdatum zu finden (Monat, Tag, Jahr) und
  2. um den Abstand zwischen Zahl und Ordnung zu ändern.

Um diese beiden Punkte zu testen, sehen Sie sich bitte das folgende MWE an:

\documentclass{article}

\usepackage[en-GB,en-CA,en-US]{datetime2}

%\usepackage{etoolbox}
%\patchcmd{\DTMenglishordinal}% <cmd>
%  {#1 \DTMenglishfmtordsuffix}% <search>
%  {#1\,\DTMenglishfmtordsuffix}% <replace>
%  {}{}% <success><failure>


\begin{document}

british: 
\DTMsetstyle{en-GB}\today.
\DTMlangsetup[en-GB]{ord=raise} % ,monthyearsep={,\space},abbr
\DTMsetstyle{en-GB}\emph{\today} \today

canadian:
\DTMlangsetup[en-CA]{ord=raise} % ,monthyearsep={,\space},abbr  ,ordsep={\,}
\DTMsetstyle{en-CA}\emph{\today} \today

american:
\DTMlangsetup[en-US]{ord=raise} % ,monthyearsep={,\space},abbr
\DTMsetstyle{en-US}\emph{\today} \today

\end{document}

Das Ergebnis zeigt Ihnen, dass Sie die kanadische oder amerikanische Variante wählen können, um Ihr gewünschtes Datumslayout zu erhalten. Da Sie in Ihrem Dokument Kursivschrift verwendet haben, habe ich im MWE oben Kursivschrift und normalen Text für das Datum angezeigt.

Varianten

Sie können sehen, dass in dieser Variante der Abstand zwischen Zahl und Ordnung etwas größer ist als in Ihrem Ergebnis. Wenn Sie jedoch einen größeren Abstand wünschen, heben Sie bitte die Kommentarzeichen aus den Zeilen auf.

%\usepackage{etoolbox}
%\patchcmd{\DTMenglishordinal}% <cmd>
%  {#1 \DTMenglishfmtordsuffix}% <search>
%  {#1\,\DTMenglishfmtordsuffix}% <replace>
%  {}{}% <success><failure>

im obigen MWE, um einen Patch zu aktivieren. Dieser Patch fügt \,nach der Nummer ( #1im Code mit dargestellt) einen kleinen Sprung ein. Jetzt erhalten Sie das Ergebnis:

Date mit kleinem Skip

Okay, jetzt können wir den gefundenen Code (ich habe die amerikanische Variante gewählt) in Ihren Code einfügen:

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

\usepackage{pifont} %bouni

\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

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

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

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

\MyName{Name Name}
\MySlogan{Curriculum Vitae \\ \null\hfill  (\DTMsetstyle{en-US}\today)} % <=======================

\sepspace  % Si on ajoute encore \sepspace on aura plus d'espace

\section*{Informations personelles}

\end{document}

mit dem Ergebnis:

Ihr Code mit Korrektur

Der rot unterstrichene "Befehl" stammt aus der Zeile, die ich im Code mit markiert habe <====== ?????. Ist das, was du willst? Wenn nicht, lösche die Zeile mit commandim Code.

Antwort2

Verwenden datetimedes Pakets (sehen datetime.stypdf, auf S. 8):

     \documentclass[a4paper,10pt,demo    ]{article} %
      \usepackage{datetime}
      \newdateformat{dashdate}{%
\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
\newdateformat{usvardate}{%
\monthname[\THEMONTH] \ordinal{DAY}, \THEYEAR}

    \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 %%%%%%%%%%%%%%%%%%%%%%%%%
    %---------------------------
   %---------------------------
   \MyName{Name Name}
    \MySlogan{Curriculum Vitae \\ \null\hfill  (\usvardate\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]: 

Bildbeschreibung hier eingeben

Antwort3

Im Folgenden wird eindatetime2Ansatz zur Festlegung des Ordinaldatums, ähnlich dem, was inferahfezas Antwort. Zusätzlich wird eine kleine Anpassung bei der Platzierung der Ordnungszahl vorgenommen:

Bildbeschreibung hier eingeben

\documentclass{article}

\usepackage[T1]{fontenc}

\usepackage{fmtcount}
\usepackage[calc,english]{datetime2}
\DTMnewdatestyle{usvardate}{%
  \renewcommand{\DTMdisplaydate}[4]{%
    \DTMmonthname{##2} \ordinalnum{##3}, \number##1 }%
  \renewcommand{\DTMDisplaydate}{\DTMdisplaydate}%
}

\makeatletter
\AtBeginDocument{
  \renewcommand{\fmtord}[1]{\,\fc@textsuperscript{#1}}% Add \, before ordinal number
}
\makeatother

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

\begin{document}

\MyName{Name Name}
\MySlogan{Curriculum Vitae \\ \null\hfill  (\DTMsetdatestyle{usvardate}\today)}

\end{document}

verwandte Informationen