\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}
Я хочу добавить «th» в дату следующим образом
решение1
Виновник здесь.
- чтобы найти правильный макет для нужной вам даты (месяц, день, год) и
- для изменения расстояния между числом и порядковым номером.
Чтобы проверить эти два пункта, пожалуйста, ознакомьтесь со следующим 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 выше курсивный и обычный текст для даты.
Вы можете видеть, что в этом варианте расстояние между числом и порядковым номером немного больше, чем в вашем результате, но если вам нужно большее расстояние, пожалуйста, раскомментируйте строки
%\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.sty
pdf, на стр. 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}