\setcounter

Synopsis:

\setcounter{counter}{value}

Globally set the counter counter to have the value of the value argument, which must be an integer. Thus, you can set a counter’s value as \setcounter{section}{5}. Note that the counter name does not start with a backslash.

In this example if the counter theorem has value 12 then the second line will print ‘XII’.

\setcounter{exercise}{\value{theorem}}
Here it is in Roman: \Roman{exercise}.

© 2007–2018 Karl Berry
Public Domain Software
http://latexref.xyz/_005csetcounter.html