How to identify floats that are not referenced in text [duplicate]












7
















This question already has an answer here:




  • How can I get LaTeX to warn about unreferenced figures and unused labels in general?

    1 answer




I would like to ensure that all figures in my document are referenced somewhere in the text. With all the editing I've been doing, some of the figures are no longer being referenced and I would like to find out which (so I can either delete the figures or add appropriate references).



Is there a way (using a package, or custom function) to highlight or list any floats that do not have a corresponding ref{fig:foobar} in the text body?



Example:



documentclass{article}
usepackage{graphicx}
usepackage{flafter}
begin{document}

There's a lady who's sure all that glitters is gold (See Figure ref{fig:gold}).
And she's buying a stairway to heaven.

begin{figure}
includegraphics{gold.png}
caption{Picture of gold}
label{fig:gold}
end{figure}

begin{figure}
includegraphics{silver.png}
caption{Picture of silver}
label{fig:silver}
end{figure}

end{document}


I'd like to run a function that tells me fig:silver was never referenced in the text



Note that I'm already using flafter to ensure floats only appear after they have been referenced. Is there an argument I can pass to flafter or listoffigures which has the functionality I'm looking for?










share|improve this question















marked as duplicate by Torbjørn T., samcarter, Werner floats
Users with the  floats badge can single-handedly close floats questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 14 at 21:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    7
















    This question already has an answer here:




    • How can I get LaTeX to warn about unreferenced figures and unused labels in general?

      1 answer




    I would like to ensure that all figures in my document are referenced somewhere in the text. With all the editing I've been doing, some of the figures are no longer being referenced and I would like to find out which (so I can either delete the figures or add appropriate references).



    Is there a way (using a package, or custom function) to highlight or list any floats that do not have a corresponding ref{fig:foobar} in the text body?



    Example:



    documentclass{article}
    usepackage{graphicx}
    usepackage{flafter}
    begin{document}

    There's a lady who's sure all that glitters is gold (See Figure ref{fig:gold}).
    And she's buying a stairway to heaven.

    begin{figure}
    includegraphics{gold.png}
    caption{Picture of gold}
    label{fig:gold}
    end{figure}

    begin{figure}
    includegraphics{silver.png}
    caption{Picture of silver}
    label{fig:silver}
    end{figure}

    end{document}


    I'd like to run a function that tells me fig:silver was never referenced in the text



    Note that I'm already using flafter to ensure floats only appear after they have been referenced. Is there an argument I can pass to flafter or listoffigures which has the functionality I'm looking for?










    share|improve this question















    marked as duplicate by Torbjørn T., samcarter, Werner floats
    Users with the  floats badge can single-handedly close floats questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    Jan 14 at 21:41


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      7












      7








      7


      1







      This question already has an answer here:




      • How can I get LaTeX to warn about unreferenced figures and unused labels in general?

        1 answer




      I would like to ensure that all figures in my document are referenced somewhere in the text. With all the editing I've been doing, some of the figures are no longer being referenced and I would like to find out which (so I can either delete the figures or add appropriate references).



      Is there a way (using a package, or custom function) to highlight or list any floats that do not have a corresponding ref{fig:foobar} in the text body?



      Example:



      documentclass{article}
      usepackage{graphicx}
      usepackage{flafter}
      begin{document}

      There's a lady who's sure all that glitters is gold (See Figure ref{fig:gold}).
      And she's buying a stairway to heaven.

      begin{figure}
      includegraphics{gold.png}
      caption{Picture of gold}
      label{fig:gold}
      end{figure}

      begin{figure}
      includegraphics{silver.png}
      caption{Picture of silver}
      label{fig:silver}
      end{figure}

      end{document}


      I'd like to run a function that tells me fig:silver was never referenced in the text



      Note that I'm already using flafter to ensure floats only appear after they have been referenced. Is there an argument I can pass to flafter or listoffigures which has the functionality I'm looking for?










      share|improve this question

















      This question already has an answer here:




      • How can I get LaTeX to warn about unreferenced figures and unused labels in general?

        1 answer




      I would like to ensure that all figures in my document are referenced somewhere in the text. With all the editing I've been doing, some of the figures are no longer being referenced and I would like to find out which (so I can either delete the figures or add appropriate references).



      Is there a way (using a package, or custom function) to highlight or list any floats that do not have a corresponding ref{fig:foobar} in the text body?



      Example:



      documentclass{article}
      usepackage{graphicx}
      usepackage{flafter}
      begin{document}

      There's a lady who's sure all that glitters is gold (See Figure ref{fig:gold}).
      And she's buying a stairway to heaven.

      begin{figure}
      includegraphics{gold.png}
      caption{Picture of gold}
      label{fig:gold}
      end{figure}

      begin{figure}
      includegraphics{silver.png}
      caption{Picture of silver}
      label{fig:silver}
      end{figure}

      end{document}


      I'd like to run a function that tells me fig:silver was never referenced in the text



      Note that I'm already using flafter to ensure floats only appear after they have been referenced. Is there an argument I can pass to flafter or listoffigures which has the functionality I'm looking for?





      This question already has an answer here:




      • How can I get LaTeX to warn about unreferenced figures and unused labels in general?

        1 answer








      floats cross-referencing






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 14 at 21:38









      Torbjørn T.

      156k13251439




      156k13251439










      asked Jan 14 at 20:30









      jayologistjayologist

      384




      384




      marked as duplicate by Torbjørn T., samcarter, Werner floats
      Users with the  floats badge can single-handedly close floats questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Jan 14 at 21:41


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by Torbjørn T., samcarter, Werner floats
      Users with the  floats badge can single-handedly close floats questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Jan 14 at 21:41


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          1 Answer
          1






          active

          oldest

          votes


















          7














          The refcheck package does this. It prints the label next to the caption, and if unreferenced places it between question marks.



          documentclass{article}
          usepackage[demo]{graphicx}
          usepackage{flafter}
          usepackage{refcheck}

          begin{document}

          There's a lady who's sure all that glitters is gold (See Figure ref{fig:gold}).
          And she's buying a stairway to heaven.
          begin{figure}[hb]
          caption{Picture of gold}
          label{fig:gold}
          end{figure}
          begin{figure}[hb]
          caption{Picture of silver}
          label{fig:silver}
          end{figure}

          end{document}


          enter image description here






          share|improve this answer






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            7














            The refcheck package does this. It prints the label next to the caption, and if unreferenced places it between question marks.



            documentclass{article}
            usepackage[demo]{graphicx}
            usepackage{flafter}
            usepackage{refcheck}

            begin{document}

            There's a lady who's sure all that glitters is gold (See Figure ref{fig:gold}).
            And she's buying a stairway to heaven.
            begin{figure}[hb]
            caption{Picture of gold}
            label{fig:gold}
            end{figure}
            begin{figure}[hb]
            caption{Picture of silver}
            label{fig:silver}
            end{figure}

            end{document}


            enter image description here






            share|improve this answer




























              7














              The refcheck package does this. It prints the label next to the caption, and if unreferenced places it between question marks.



              documentclass{article}
              usepackage[demo]{graphicx}
              usepackage{flafter}
              usepackage{refcheck}

              begin{document}

              There's a lady who's sure all that glitters is gold (See Figure ref{fig:gold}).
              And she's buying a stairway to heaven.
              begin{figure}[hb]
              caption{Picture of gold}
              label{fig:gold}
              end{figure}
              begin{figure}[hb]
              caption{Picture of silver}
              label{fig:silver}
              end{figure}

              end{document}


              enter image description here






              share|improve this answer


























                7












                7








                7







                The refcheck package does this. It prints the label next to the caption, and if unreferenced places it between question marks.



                documentclass{article}
                usepackage[demo]{graphicx}
                usepackage{flafter}
                usepackage{refcheck}

                begin{document}

                There's a lady who's sure all that glitters is gold (See Figure ref{fig:gold}).
                And she's buying a stairway to heaven.
                begin{figure}[hb]
                caption{Picture of gold}
                label{fig:gold}
                end{figure}
                begin{figure}[hb]
                caption{Picture of silver}
                label{fig:silver}
                end{figure}

                end{document}


                enter image description here






                share|improve this answer













                The refcheck package does this. It prints the label next to the caption, and if unreferenced places it between question marks.



                documentclass{article}
                usepackage[demo]{graphicx}
                usepackage{flafter}
                usepackage{refcheck}

                begin{document}

                There's a lady who's sure all that glitters is gold (See Figure ref{fig:gold}).
                And she's buying a stairway to heaven.
                begin{figure}[hb]
                caption{Picture of gold}
                label{fig:gold}
                end{figure}
                begin{figure}[hb]
                caption{Picture of silver}
                label{fig:silver}
                end{figure}

                end{document}


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 14 at 20:37









                Torbjørn T.Torbjørn T.

                156k13251439




                156k13251439















                    Popular posts from this blog

                    Mario Kart Wii

                    The Binding of Isaac: Rebirth/Afterbirth

                    What does “Dominus providebit” mean?