This question already has an answer here:

Since I'm using the chemstyle package by Joseph Wright a reference to a figure, or scheme (a float environment defined by the package) is always printed as:

Figure XY


Scheme YZ

Normally one would write someting like

Cooking bacon (see figure \ref{fig:Foo bar}) and eggs.

And get an output like

Cooking bacon (see figure XY) and eggs.

Now, with the chemstyle package, this renders to:

Cooking bacon (see figure Figure XY) and eggs.

How can I get back to the normal behaviour of \ref?

If you see this Joseph, think about implementing an option to switch the behaviour of this as some people may like the automatic output, but others, as me, don't.





    \caption{Foo figure}

Figure \ref{fig:foo} shows a Foo.


marked as duplicate by campa, Stefan Pinnow, marmot, Phelype Oleinik, Troy Aug 22 '18 at 13:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 4
    Can't test now but you could try with \usepackage[varioref=false]{chemstyle}. – campa Aug 22 '18 at 10:09
  • @campa It worked for me in the MWE, so you might want to write up an answer. – moewe Aug 22 '18 at 10:38
  • 1
    BTW: You probably want to write Figure~\ref{fig:foo} with a tie ~ before \ref to avoid a line break between "Figure" and the number. Of course varioref or cleveref make this easier for you because you just type \ref and the prefix pops up automatically. That is why I really like this feature, maybe you should give it a try one day. – moewe Aug 22 '18 at 10:39
  • Yes, this works just fine! I didn't see this in the documentation, maybe it should be updated. Thanks @campa :) – Sam Aug 22 '18 at 10:40
  • @Sam It is on page 3 of the chemstyle documentation. – user36296 Aug 22 '18 at 10:51

The package chemstyle has (lines 425-434)


By default it loads varioref (which isn't the problem) and then changes \labelformat, which is a macro provided by varioref whose purpose is precisely to control the output of \ref. At this point I think you have three options:

1) You stop chemstyle from loadingvarioref` with the corresponding option


2) You "undo" what chemstyle did


3) You enjoy having varioref at your disposal and use \ref{fig:foo} (or \Ref{fig:foo} at the beginning of a sentence) instead of writing Figure~\ref{fig:foo} explicitly.

Not the answer you're looking for? Browse other questions tagged or ask your own question.