First instead of 1 when referencing

Building on Ulrike’s answer,

\documentclass{article}
\usepackage{fmtcount}
\usepackage{refcount}
\usepackage[colorlinks=true]{hyperref}

\newcommand{\ordinalref}[1]{%
  \hyperref[#1]{\ordinalstringnum{\getrefnumber{#1}}}%
}

\begin{document}
\begin{enumerate}
\item Item1 \label{itm:1}
\end{enumerate}
Item \ref{itm:1} xyz...\\
The \ordinalref{itm:1} item xyz...\\
The first item xyz...
\end{document}

It doesn't work for nested items, unless you change the reference format.

enter image description here


You can use \hyperref to create a link like \ref would do (the first argument is an optional argument, but I don't know why):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[colorlinks=true]{hyperref}
\begin{document}
\begin{enumerate}
\item Item1 \label{itm:1}
\end{enumerate}
Item \ref{itm:1} xyz...\\
The \ref{itm:1}st item xyz...\\
The \hyperref[itm:1]{first} item xyz...
\end{document}

Tags:

Hyperref