Added improve ordinal position

This partially addresses issue #14.
overleaf-2022-09-12-0646
Bastian Rieck 2020-11-05 15:32:41 +01:00
parent 73106d9447
commit 1cec3db6fe
3 changed files with 16 additions and 5 deletions

View File

@ -135,7 +135,11 @@ These should be added in equal measure to your own conduct. To typeset
units correctly, use the \verb|siunitx| package. For example, you might
want to restrict your daily intake of liberty to \SI{750}{\milli\gram}.
Likewise, as a small pet peeve of mine, I offer specific operators for \emph{ordinals}. Use \verb|\th| to typeset things like July~4\th correctly. Or, if you are referring to the 2\nd edition of a book, please use \verb|\nd|. Likewise, if you came in 3\rd in a marathon, use \verb|\rd|. This is my 1\st rule.
Likewise, as a small pet peeve of mine, I offer specific operators for
\emph{ordinals}. Use \verb|\th| to typeset things like July~4\th
correctly. Or, if you are referring to the 2\nd edition of a book,
please use \verb|\nd|. Likewise, if you came in 3\rd in a marathon, use
\verb|\rd|. This is my 1\st rule.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Changing things}

Binary file not shown.

View File

@ -203,10 +203,17 @@
% Ordinals
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand {\st}{\textsuperscript{\textup{st}}\xspace}
\newcommand {\rd}{\textsuperscript{\textup{rd}}\xspace}
\newcommand {\nd}{\textsuperscript{\textup{nd}}\xspace}
\renewcommand{\th}{\textsuperscript{\textup{th}}\xspace}
\ifxetexorluatex
\newcommand {\st}{{\addfontfeatures{VerticalPosition=Ordinal}\textup{st}}\xspace}
\newcommand {\rd}{{\addfontfeatures{VerticalPosition=Ordinal}\textup{rd}}\xspace}
\newcommand {\nd}{{\addfontfeatures{VerticalPosition=Ordinal}\textup{nd}}\xspace}
\renewcommand{\th}{{\addfontfeatures{VerticalPosition=Ordinal}\textup{th}}\xspace}
\else
\newcommand {\st}{\textsuperscript{\textup{st}}\xspace}
\newcommand {\rd}{\textsuperscript{\textup{rd}}\xspace}
\newcommand {\nd}{\textsuperscript{\textup{nd}}\xspace}
\renewcommand{\th}{\textsuperscript{\textup{th}}\xspace}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Penalties