날짜 변경

날짜 변경
        \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}

다음과 같이 날짜에 '일'을 추가하고 싶습니다.

여기에 이미지 설명을 입력하세요

답변1

범인은 여기에 있다

  1. 원하는 날짜(월, 일, 연도)에 맞는 레이아웃을 찾으려면
  2. 숫자와 순서 사이의 거리를 변경합니다.

이 두 가지 사항을 테스트하려면 다음 MWE를 참조하세요.

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

그 결과는 원하는 날짜 레이아웃을 얻기 위해 캐나다 또는 미국 변형을 선택할 수 있음을 보여줍니다. 문서에서 기울임꼴 글꼴을 사용했기 때문에 날짜에 대해 기울임꼴 및 일반 텍스트 위에 MWE를 표시했습니다.

변형

이 변형에서는 숫자와 ord 사이의 거리가 결과보다 약간 더 크다는 것을 알 수 있지만 더 많은 거리를 원할 경우 해당 행의 주석 처리를 제거하십시오.

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

위의 MWE에서 패치를 활성화합니다. 이 패치는 \,숫자 뒤에 작은 건너뛰기를 추가합니다 ( #1코드에 표시됨). 이제 결과를 얻습니다.

약간 건너뛰는 데이트

좋습니다. 이제 찾은 코드(저는 미국 변형을 선택했습니다)를 코드에 포함할 수 있습니다.

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

결과는 다음과 같습니다.

수정된 코드

빨간색 밑줄이 그어진 "명령"은 코드에서 <====== ?????. 너가 원하는게 그거야? 그렇지 않은 경우 command코드에서 줄을 삭제하십시오 .

답변2

패키지를 사용하여 datetime(보다 datetime.stypdf, 페이지: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]: 

여기에 이미지 설명을 입력하세요

답변3

다음은datetime2제안된 것과 유사한 서수 날짜를 설정하는 접근 방식페라 페자의 답변. 또한 서수 배치에 약간의 조정이 도입되었습니다.

여기에 이미지 설명을 입력하세요

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

관련 정보