16

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[unicode,colorlinks,linktocpage=true]{hyperref}
\usepackage[all]{hypcap}
\usepackage{amsthm}
\usepackage[nameinlink,capitalise,noabbrev]{cleveref}

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
5

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
7

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
1

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.
https://tex.stackexchange.com/questions/52595/reference-does-not-exist-warning-with-includeonly
tex.stackexchange.com
crawl=CC-MAIN-2020-29
169704
application/http; msgtype=response
sha1:CWUDWAL4ZM4Y6M7AZG2OJGH3OWBA27E7
<urn:uuid:5f02c828-c9d1-46f5-8fab-8ce4fdec25dd>
2020-07-12T06:44:48Z
151.101.129.69
text/html
sha1:MH7DA5HSHMPV3AFNZ6ZICJLCAH5D2TI4
<urn:uuid:d973eb33-0d69-4b6d-9cd2-73717be23df6>
https://tex.stackexchange.com/questions/52595/reference-does-not-exist-warning-with-includeonly
response
<urn:uuid:cb596d5a-6a3a-4179-9050-3152c095f8f7>
isPartOf: CC-MAIN-2020-29
publisher: Common Crawl
description: Wide crawl of the web for July 2020
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-98.ec2.internal
software: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/