\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}
Quiero agregar ''th'' en la fecha de la siguiente manera
Respuesta1
El culpable está aquí.
- para encontrar el diseño correcto para la fecha deseada (mes, día, año) y
- para cambiar la distancia entre el número y la orden.
Para probar estos dos puntos, consulte el siguiente 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}
Su resultado le muestra que puede elegir la variante canadiense o americana para obtener el diseño de fecha deseado. Debido a que usó fuente en cursiva en su documento, mostré en el MWE arriba el texto en cursiva y normal para la fecha.
Puedes ver que en esta variante la distancia entre número y orden es un poco mayor que en tu resultado, pero si quieres más distancia, descomenta las líneas.
%\usepackage{etoolbox}
%\patchcmd{\DTMenglishordinal}% <cmd>
% {#1 \DTMenglishfmtordsuffix}% <search>
% {#1\,\DTMenglishfmtordsuffix}% <replace>
% {}{}% <success><failure>
en el MWE de arriba para activar un parche. Este parche agrega un pequeño salto \,
después del número (representado #1
en el código). Ahora obtienes el resultado:
Bien, ahora podemos incluir el código encontrado (elegí la variante americana) en su 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}
con el resultado:
El "comando" subrayado en rojo proviene de la línea que marqué en el código con <====== ?????
. ¿Es eso lo que quieres? Si no, elimine la línea con command
en el código.
Respuesta2
Usando datetime
el paquete, (ver datetime.sty
pdf, en la página 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]:
Respuesta3
Lo siguiente utiliza undatetime2
enfoque para fijar la fecha ordinal, similar a lo propuesto enLa respuesta de ferahfeza. Además, se introduce un pequeño ajuste en la colocación del 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}