[Tex/LaTex] How to display Arabic numerals with \ref but Roman numerals otherwise

chapterscross-referencingnumberingroman numerals

To show all chapter numbers as Roman numerals, I’m using

\renewcommand\thechapter{\Roman{chapter}}

The fourth chapter, for instance, is therefore “Chapter IV” everywhere.

Is it possible to show the numbers as Arabic numerals only when referencing to chapters using \ref{...}?

Using the example above, \ref{chapter-four} would result in “Chapter 4” instead of “Chapter IV.”

Best Answer

Patching \@makechapterhead to print \Roman{chapter} instead of \thechapter allows you to have chapter headings formatting with Roman numerals yet have references inside your text to still be Arabic:

enter image description here

\documentclass{book}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\patchcmd{\@makechapterhead}% <cmd>
  {\thechapter}% <search>
  {\Roman{chapter}}% <replace>
  {}{}% <success><failure>
\makeatother
\begin{document}
%\tableofcontents
\chapter{A chapter}\label{chap-label}
See Chapter~\ref{chap-label}.
\end{document}

Note that numbering inside your ToC will also be Arabic. To change this, a patch to \@chapter is required (also wrapped inside a \makeatletter-\makeatother-pair):

\patchcmd{\@chapter}% <cmd>
  {\numberline{\thechapter}}% <search>
  {\numberline{\Roman{chapter}}}% <replace>
  {}{}% <success><failure>