I am in the process of writing my thesis and am using the \include command to separate the files. But when I use the \includeonly command to select on the current chapter which has references to figures, theorems and algorithm2e code blocks in other chapters, I get the correct references in the output PDF file along with this warning:

name{..} has been referenced but does not exist, replaced by a fixed one

Based on all I have read upon on \includeonly, I don't think this is its expected behavior. This is the that preamble I am using.


For some reason the \WarningsOff* and \WarningFilter commands of the silence package aren't working either. What am I doing wrong? How can I avoid these warnings?

  • 5
    \special{papersize=210mm,297mm}? Who told you that? Please trust in geometry. – Martin Scharrer Apr 19 '12 at 15:48
  • The warning refers to hyperlinks generated by hyperref. When the pages to be referred to don't exist in your document, there really is no way to generate a link to them. So the warning is correct. – Stephan Lehmke Apr 19 '12 at 15:50
  • I'm using biblatex and coded this to get rid for the warnings of \cites: \makeatletter \if@partsw \PassOptionsToPackage{hyperref=false}{biblatex} \fi \makeatother \usepackage[style=numeric-comp,sorting=none,doi=false,isbn=false,url=true,eprint=false,maxnames=10]{biblatex} It disables hyperlinks for citations when \includeonly is used. – Martin Scharrer Apr 24 '12 at 21:18
  • @MartinScharrer Do you happen to know anything like this for BibTeX? – Mario S. E. Apr 16 '13 at 12:08
  • @MarioS.E.: No, sorry, I don't. – Martin Scharrer Apr 16 '13 at 16:55

Since you seem to be using \includeonly only when you are working with just one chapter, you might not need any hyperref generated links at that time. So consider the draft package option.

Another clumsier possibility: write \renewcommands (or wrappers) for macros from the hyperref package. Put them in your preamble right next to the \includeonly and you'll remember to comment that stuff out all together when you compile the whole thesis.

| improve this answer | |
  • 1
    Thanks a lot, that worked perfectly.. didn't know that draft mode can suppress hyperlinks.. Out of curiosity though, could you be more descriptive about your second option? – Berserker Apr 20 '12 at 2:58
  • @Berserker the second option is described in http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2011-05/msg00234.html although I couldn't get it to work in your situation – cmhughes Apr 20 '12 at 8:44
  • Which are the macros we whould redefine? – user4929 Jun 3 '17 at 11:07
  • @user4929 I can't answer for cmhughes (comment above). I think you redefine any macros that give you errors when you try to compile. If you have a problem that this answer can't solve you could post another question. Provide an MWE, and link to this post. – Ethan Bolker Jun 3 '17 at 13:32

This is a warning from the hyperref package.

The hyperlinks you create to other chapters don't exist when using \includeonly, but of course the reference itself is still valid.

You'll notice you don't get the warning when you compile the whole document together, because the hyperlinks do exist in this case.

| improve this answer | |
  • 4
    I understand that, but is there any way that I can suppress the warning? I have too many inter-chapter references and those warnings kind of hide the ones I actually need to be concerned about. As I have already mentioned, I am not being able to do so using the silence package. – Berserker Apr 19 '12 at 15:56

I find this way very practical:

\includeonly{mainchapter} \hypersetup{draft}

So you can just comment/uncomment the whole line as you switch from full document to single chapter.

| improve this answer | |

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.