I am currently writing my thesis, and some chapters have references to other chapters via \ref{chap-chaptername}. However, as it takes a while to compile the entire thesis, I would like to be able to compile a single chapter, but when I do this, obviously the cross references are lost (shown as ??).

I already use \setcounter{chapter}{n} to make the chapter number correct, but is there something I can include like \chaptercounter{n}{chap-chaptername} to artificially define these references?


1 Answer 1


That is exactly what the standard latex \include command is designed for. If you use \includeonly to just include one chapter, it retains its chapter number and \ref to labels in non-included chapters still work.

You should not need \setcounter{chapter}{...}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .