\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}
Quero adicionar ''th'' na data da seguinte maneira
Responder1
O culpado está aqui
- para encontrar o layout correto para a data desejada (mês, dia com ordem, ano) e
- para alterar a distância entre número e ordem.
Para testar esses dois pontos, consulte o seguinte 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}
Seu resultado mostra que você pode escolher a variante canadense ou americana para obter o layout de data desejado. Como você usou fonte itálica em seu documento, mostrei no MWE acima o texto em itálico e normal para a data.
Você pode ver que nesta variante a distância entre número e ordem é um pouco maior do que no seu resultado, mas se quiser mais distância, descomente as linhas
%\usepackage{etoolbox}
%\patchcmd{\DTMenglishordinal}% <cmd>
% {#1 \DTMenglishfmtordsuffix}% <search>
% {#1\,\DTMenglishfmtordsuffix}% <replace>
% {}{}% <success><failure>
no MWE acima para ativar um patch. Este patch adiciona um pequeno salto \,
após o número (representado #1
no código. Agora você obtém o resultado:
Ok, agora podemos incluir o código encontrado (escolhi a variante americana) em seu código:
\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}
com o resultado:
O "comando" sublinhado em vermelho vem da linha que marquei no código com <====== ?????
. É isso que você quer? Caso contrário, exclua a linha command
no código.
Responder2
Usando datetime
o pacote, (ver datetime.sty
pdf, na p: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]:
Responder3
O seguinte usa umdatetime2
abordagem para definir a data ordinal, semelhante ao que é proposto emresposta de ferahfeza. Além disso, é introduzido um pequeno ajuste na colocação do ordinal:
\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}