Have the MWE:
\documentclass{article}
\usepackage[backref=page,hypertexnames]{hyperref}
\newcommand{\RNum}[1]{\uppercase\expandafter{\romannumeral #1\relax}}
\begin{document}
\section{Sec. \RNum{1}}
\section{Sec. \RNum{2}}
\end{document}
The bookmark in the PDF shows that the numbers are indeed small case (while it should be upper case). How to get it fixed?
\uppercase
, but\uupercase
is not expandable, see tex.stackexchange.com/q/387816/35864. See also tex.stackexchange.com/q/10805/35864 – moewe Jul 31 '18 at 12:05\documentclass{article} \usepackage{xparse} \usepackage{hyperref} \ExplSyntaxOn \DeclareExpandableDocumentCommand{\RNum}{m}{\int_to_Roman:n{#1}} \ExplSyntaxOff \begin{document} \section{Sec.\ \RNum{1}} \section{Sec.\ \RNum{2}} \end{document}
seems to work. – moewe Jul 31 '18 at 12:10\documentclass{article} \usepackage{hyperref} \makeatletter \newcommand*{\RNum}[1]{\expandafter\@slowromancap\romannumeral #1@} \makeatother \begin{document} \section{Sec.\ \RNum{1}} \section{Sec.\ \RNum{2}} \end{document}
– moewe Jul 31 '18 at 12:15