# “Reference does not exist” warning with \includeonly

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.

``````\documentclass[pdftex,11pt,a4paper,twoside]{book}
\special{papersize=210mm,297mm}
\usepackage[slide,algochapter,linesnumbered,algoruled,vlined]{algorithm2e}
\usepackage{enumitem,IEEEtrantools,graphics,float,amsmath,amssymb,fullpage}
\usepackage{verbatim,tabularx,graphicx,setspace,sectsty,microtype}
\usepackage[a4paper,margin=1in,left=35mm]{geometry}
\usepackage[all]{hypcap}
\usepackage{amsthm}
``````

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?

-
`\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 `\cite`s: `\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 `\renewcommand`s (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.

-
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.htm‌​l although I couldn't get it to work in your situation –  cmhughes Apr 20 '12 at 8:44

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.

-
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