I am wondering why this command works:


and I got references working correctly, and instead with this code I get the document compiled, but references do not work (question marks appear):


In there any way to modify the above code in order to have references working?

I add a minimal code that allow compilation:

In picture reference \ref{figure1} works, instead in picture \ref{figure2} does not 
  • 1
    Could you pease make your example code compilable by adding the documentclass as well as the relevant packages? How/where is \adjustimage defined? – leandriis Oct 17 at 13:53
  • \adjustimage is part of the adjustbox package; I have added a minimal code that allow compilation, maybe all packages are not really needed (I am using pdflatex with .eps images) – hardhu Oct 17 at 14:25
  • Thanks a lot, since I am pretty new in the use of adjustbox package I was misleaded in the search for a solution – hardhu Oct 17 at 14:46

As explained in Why does an environment's label have to appear after the caption?, the \label must, well, appear after the \caption. In this case the caption package even issues a warning

Package caption Warning: \label without proper reference on input line 11.
See the caption package documentation for explanation.

Unrelated: in a TeX distribution which is not completely outdated it is not necessary to load the epstopdf package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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