Understanding Warning 'Destination with the same identifier has been already used' caused by Theorems












1















In the following mwe I get two warnings: LaTeX Warning: Citation 'foo' on page 2 undefined on input line 29. and pdfTeX warning (ext4): destination with the same identifier (name{definition.1}) has been already used, duplicate ignored.



While the first is obvious I don't see where the second would come from. The second warning disappears if, e.g. the newpage is removed or the wrong citation is removed or corrected or cleveref is removed. It also disappears if I use newtheorem instead of thmtools and declaretheorem.



Can somebody explain me why that warning occurs? I started out with a big document which contained all these things, hence my desire to know.



I researched similar questions like this, this, this and this but it seems to be something different. Also I respect the order of loading packages.



The MWE



documentclass{scrbook}

usepackage{amsmath}
usepackage{amsthm}

usepackage{thmtools}
declaretheorem[style=plain,parent=section]{theorem}
declaretheorem[style=definition,qed=$triangle$,sibling=theorem]{definition}

% newtheorem{theorem}{Theorem}[section]
% newtheorem{definition}[theorem]{Definition}

usepackage{hyperref}

usepackage{cleveref}

begin{document}

chapter{chap}

section{Sec1}

begin{definition}
Text
end{definition}

newpage

section{Sec2}

The reference cite{foo} is undefined.
begin{definition}
Text
end{definition}
end{document}









share|improve this question


















  • 1





    The two declaretheorem directives should occur after hyperref and cleveref are loaded. Make this change irrespective of any newpage directives in the body of the document.

    – Mico
    Jan 29 at 1:28








  • 1





    Arg.. thanks! :-) Could you post this as answer, then I can accept.

    – Heinrich Ody
    Jan 29 at 10:01






  • 1





    @Mico Do you know if it is documented that theorems should be declared after loading all packages? Asking cause I could not find anything

    – Heinrich Ody
    Jan 29 at 10:30
















1















In the following mwe I get two warnings: LaTeX Warning: Citation 'foo' on page 2 undefined on input line 29. and pdfTeX warning (ext4): destination with the same identifier (name{definition.1}) has been already used, duplicate ignored.



While the first is obvious I don't see where the second would come from. The second warning disappears if, e.g. the newpage is removed or the wrong citation is removed or corrected or cleveref is removed. It also disappears if I use newtheorem instead of thmtools and declaretheorem.



Can somebody explain me why that warning occurs? I started out with a big document which contained all these things, hence my desire to know.



I researched similar questions like this, this, this and this but it seems to be something different. Also I respect the order of loading packages.



The MWE



documentclass{scrbook}

usepackage{amsmath}
usepackage{amsthm}

usepackage{thmtools}
declaretheorem[style=plain,parent=section]{theorem}
declaretheorem[style=definition,qed=$triangle$,sibling=theorem]{definition}

% newtheorem{theorem}{Theorem}[section]
% newtheorem{definition}[theorem]{Definition}

usepackage{hyperref}

usepackage{cleveref}

begin{document}

chapter{chap}

section{Sec1}

begin{definition}
Text
end{definition}

newpage

section{Sec2}

The reference cite{foo} is undefined.
begin{definition}
Text
end{definition}
end{document}









share|improve this question


















  • 1





    The two declaretheorem directives should occur after hyperref and cleveref are loaded. Make this change irrespective of any newpage directives in the body of the document.

    – Mico
    Jan 29 at 1:28








  • 1





    Arg.. thanks! :-) Could you post this as answer, then I can accept.

    – Heinrich Ody
    Jan 29 at 10:01






  • 1





    @Mico Do you know if it is documented that theorems should be declared after loading all packages? Asking cause I could not find anything

    – Heinrich Ody
    Jan 29 at 10:30














1












1








1








In the following mwe I get two warnings: LaTeX Warning: Citation 'foo' on page 2 undefined on input line 29. and pdfTeX warning (ext4): destination with the same identifier (name{definition.1}) has been already used, duplicate ignored.



While the first is obvious I don't see where the second would come from. The second warning disappears if, e.g. the newpage is removed or the wrong citation is removed or corrected or cleveref is removed. It also disappears if I use newtheorem instead of thmtools and declaretheorem.



Can somebody explain me why that warning occurs? I started out with a big document which contained all these things, hence my desire to know.



I researched similar questions like this, this, this and this but it seems to be something different. Also I respect the order of loading packages.



The MWE



documentclass{scrbook}

usepackage{amsmath}
usepackage{amsthm}

usepackage{thmtools}
declaretheorem[style=plain,parent=section]{theorem}
declaretheorem[style=definition,qed=$triangle$,sibling=theorem]{definition}

% newtheorem{theorem}{Theorem}[section]
% newtheorem{definition}[theorem]{Definition}

usepackage{hyperref}

usepackage{cleveref}

begin{document}

chapter{chap}

section{Sec1}

begin{definition}
Text
end{definition}

newpage

section{Sec2}

The reference cite{foo} is undefined.
begin{definition}
Text
end{definition}
end{document}









share|improve this question














In the following mwe I get two warnings: LaTeX Warning: Citation 'foo' on page 2 undefined on input line 29. and pdfTeX warning (ext4): destination with the same identifier (name{definition.1}) has been already used, duplicate ignored.



While the first is obvious I don't see where the second would come from. The second warning disappears if, e.g. the newpage is removed or the wrong citation is removed or corrected or cleveref is removed. It also disappears if I use newtheorem instead of thmtools and declaretheorem.



Can somebody explain me why that warning occurs? I started out with a big document which contained all these things, hence my desire to know.



I researched similar questions like this, this, this and this but it seems to be something different. Also I respect the order of loading packages.



The MWE



documentclass{scrbook}

usepackage{amsmath}
usepackage{amsthm}

usepackage{thmtools}
declaretheorem[style=plain,parent=section]{theorem}
declaretheorem[style=definition,qed=$triangle$,sibling=theorem]{definition}

% newtheorem{theorem}{Theorem}[section]
% newtheorem{definition}[theorem]{Definition}

usepackage{hyperref}

usepackage{cleveref}

begin{document}

chapter{chap}

section{Sec1}

begin{definition}
Text
end{definition}

newpage

section{Sec2}

The reference cite{foo} is undefined.
begin{definition}
Text
end{definition}
end{document}






hyperref theorems warnings






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 28 at 23:14









Heinrich OdyHeinrich Ody

445213




445213








  • 1





    The two declaretheorem directives should occur after hyperref and cleveref are loaded. Make this change irrespective of any newpage directives in the body of the document.

    – Mico
    Jan 29 at 1:28








  • 1





    Arg.. thanks! :-) Could you post this as answer, then I can accept.

    – Heinrich Ody
    Jan 29 at 10:01






  • 1





    @Mico Do you know if it is documented that theorems should be declared after loading all packages? Asking cause I could not find anything

    – Heinrich Ody
    Jan 29 at 10:30














  • 1





    The two declaretheorem directives should occur after hyperref and cleveref are loaded. Make this change irrespective of any newpage directives in the body of the document.

    – Mico
    Jan 29 at 1:28








  • 1





    Arg.. thanks! :-) Could you post this as answer, then I can accept.

    – Heinrich Ody
    Jan 29 at 10:01






  • 1





    @Mico Do you know if it is documented that theorems should be declared after loading all packages? Asking cause I could not find anything

    – Heinrich Ody
    Jan 29 at 10:30








1




1





The two declaretheorem directives should occur after hyperref and cleveref are loaded. Make this change irrespective of any newpage directives in the body of the document.

– Mico
Jan 29 at 1:28







The two declaretheorem directives should occur after hyperref and cleveref are loaded. Make this change irrespective of any newpage directives in the body of the document.

– Mico
Jan 29 at 1:28






1




1





Arg.. thanks! :-) Could you post this as answer, then I can accept.

– Heinrich Ody
Jan 29 at 10:01





Arg.. thanks! :-) Could you post this as answer, then I can accept.

– Heinrich Ody
Jan 29 at 10:01




1




1





@Mico Do you know if it is documented that theorems should be declared after loading all packages? Asking cause I could not find anything

– Heinrich Ody
Jan 29 at 10:30





@Mico Do you know if it is documented that theorems should be declared after loading all packages? Asking cause I could not find anything

– Heinrich Ody
Jan 29 at 10:30










1 Answer
1






active

oldest

votes


















2














(Re-posting an earlier comment, so that the query can be treated as having received an answer.)



The immediate cause of the problem is the fact that the two declaretheorem directives are currently placed before rather than after the hyperref and cleveref packages are loaded.



Do change the placement of the two directives, irrespective of any newpage directives that may be present in the body of the document.



To answer your follow-up question: The user guide of the cleveref package does mention that while all theorem-related packages -- such as amsthm and thmtools -- should be loaded before cleveref, statements of the newtheorem and declaretheorem variety should occur only after cleveref is loaded. (For more detail, see the final sentence in the second bullet point in section 14.1 on page 25 of the package's user guide.)






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472317%2funderstanding-warning-destination-with-the-same-identifier-has-been-already-use%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    (Re-posting an earlier comment, so that the query can be treated as having received an answer.)



    The immediate cause of the problem is the fact that the two declaretheorem directives are currently placed before rather than after the hyperref and cleveref packages are loaded.



    Do change the placement of the two directives, irrespective of any newpage directives that may be present in the body of the document.



    To answer your follow-up question: The user guide of the cleveref package does mention that while all theorem-related packages -- such as amsthm and thmtools -- should be loaded before cleveref, statements of the newtheorem and declaretheorem variety should occur only after cleveref is loaded. (For more detail, see the final sentence in the second bullet point in section 14.1 on page 25 of the package's user guide.)






    share|improve this answer






























      2














      (Re-posting an earlier comment, so that the query can be treated as having received an answer.)



      The immediate cause of the problem is the fact that the two declaretheorem directives are currently placed before rather than after the hyperref and cleveref packages are loaded.



      Do change the placement of the two directives, irrespective of any newpage directives that may be present in the body of the document.



      To answer your follow-up question: The user guide of the cleveref package does mention that while all theorem-related packages -- such as amsthm and thmtools -- should be loaded before cleveref, statements of the newtheorem and declaretheorem variety should occur only after cleveref is loaded. (For more detail, see the final sentence in the second bullet point in section 14.1 on page 25 of the package's user guide.)






      share|improve this answer




























        2












        2








        2







        (Re-posting an earlier comment, so that the query can be treated as having received an answer.)



        The immediate cause of the problem is the fact that the two declaretheorem directives are currently placed before rather than after the hyperref and cleveref packages are loaded.



        Do change the placement of the two directives, irrespective of any newpage directives that may be present in the body of the document.



        To answer your follow-up question: The user guide of the cleveref package does mention that while all theorem-related packages -- such as amsthm and thmtools -- should be loaded before cleveref, statements of the newtheorem and declaretheorem variety should occur only after cleveref is loaded. (For more detail, see the final sentence in the second bullet point in section 14.1 on page 25 of the package's user guide.)






        share|improve this answer















        (Re-posting an earlier comment, so that the query can be treated as having received an answer.)



        The immediate cause of the problem is the fact that the two declaretheorem directives are currently placed before rather than after the hyperref and cleveref packages are loaded.



        Do change the placement of the two directives, irrespective of any newpage directives that may be present in the body of the document.



        To answer your follow-up question: The user guide of the cleveref package does mention that while all theorem-related packages -- such as amsthm and thmtools -- should be loaded before cleveref, statements of the newtheorem and declaretheorem variety should occur only after cleveref is loaded. (For more detail, see the final sentence in the second bullet point in section 14.1 on page 25 of the package's user guide.)







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 29 at 11:26

























        answered Jan 29 at 11:15









        MicoMico

        277k30380768




        277k30380768






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472317%2funderstanding-warning-destination-with-the-same-identifier-has-been-already-use%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?