# Varying style for chapter-references

I would like to refer to a chapter (roman numbering) partly with arabic numerals (e.g. as part of equation numbers) and partly with roman numerals (e.g. when refering directly to the chapter) ...

I've tried sth like:

\newcommand{\chapref}[1]{\def\thechapter{\roman{chapter}}\ref{#1}}


(this changed the counter format globally)

or

\newcommand{\chapref}[1]{\uppercase\expandafter{\romannumeral \ref{#1}}}


(in may case: compiled without warning but no effect..)

but this didn't work out ... any ideas?

-

## migrated from stackoverflow.comJun 30 '11 at 16:51

This question came from our site for professional and enthusiast programmers.

Don't redefine \thechapter if what you really want to do is change how \theequation looks: this will lead to other changes you don't want. Since it's \theequation you want to look differently, redefine that. – Seamus Jun 30 '11 at 16:57

\def\thechapter{\roman{chapter}}

\def\theequation{\arabic{chapter}.\arabic{equation}}