{"id":67,"date":"2011-11-17T09:19:00","date_gmt":"2011-11-17T09:19:00","guid":{"rendered":"https:\/\/www.root42.de\/blog\/?p=67"},"modified":"2011-11-17T09:19:00","modified_gmt":"2011-11-17T09:19:00","slug":"where-to-put-a-label-on-a-latex-figure","status":"publish","type":"post","link":"https:\/\/www.root42.de\/blog\/?p=67","title":{"rendered":"Where to put a label on a LaTeX figure"},"content":{"rendered":"<p>I just found out that LaTeX is sensitive as to where you put the <span style=\"font-family: 'Courier New', Courier, monospace;\">label<\/span> command in a <span style=\"font-family: 'Courier New', Courier, monospace;\">figure<\/span> environment. For example if you do something like this:<\/p>\n<pre>begin{figure}<br \/>  centering<br \/>  includegraphics[width=0.95columnwidth]{sompic}<br \/>  label{fig:some-pic}<br \/>  caption{Some caption.}<br \/>end{figure}<br \/><\/pre>\n<p>if you now do a <span style=\"font-family: 'Courier New', Courier, monospace;\">ref{fig:some-pic}<\/span>, the reference will point to the parent element of the figure environment. For me, I got a reference to the subsection enclosing the figure. This was very irritating, because the text then said &#8220;see Figure 3.4.2.4 for details.&#8221;<br \/>Instead you need to place the label in or after the <span style=\"font-family: 'Courier New', Courier, monospace;\">caption<\/span> command. For some reason the <span style=\"font-family: 'Courier New', Courier, monospace;\">ref<\/span> will then point to the figure: <\/p>\n<pre>begin{figure}<br \/>  centering<br \/>  includegraphics[width=0.95columnwidth]{sompic}<br \/>  caption{Some caption.}<br \/>  label{fig:some-pic}<br \/>end{figure}<br \/><\/pre>\n<p><b>Update<\/b>: And <a href=\"http:\/\/tex.stackexchange.com\/questions\/35137\/where-to-put-the-label-on-a-figure-environment\">here is also the answer<\/a> to the question why it is necessary to do it this way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just found out that LaTeX is sensitive as to where you put the label command in a figure environment. For example if you do something like this: begin{figure} centering includegraphics[width=0.95columnwidth]{sompic} label{fig:some-pic} caption{Some caption.}end{figure} if you now do a ref{fig:some-pic}, the reference will point to the parent element of the figure environment. For me, I &hellip; <a href=\"https:\/\/www.root42.de\/blog\/?p=67\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Where to put a label on a LaTeX figure&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/67"}],"collection":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":0,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}