References won't resolve even after repeated compilation












16















I have the following lines:



begin{figure}[htbp]
label{fig:sampleconfig}
begin{center}
begin{tikzpicture}[level distance=1.5cm, grow=down,
every node/.style={minimum size=1cm,circle,thin,draw},
edge from parent/.style={-latex, thin, draw}
]
node {$A$}
child {
node {$CO_{1}$}
child {node[rectangle,draw] {$CL_{1}$}}
}
child {
node[circle,dotted,draw] {$cdots$}
child {node[rectangle,dotted,draw] {$cdots$}}
}
child {
node {$CO_{n}$}
child {node[rectangle,draw] {$CL_{n}$}}
}
;
end{tikzpicture}
caption{Sample configuration}
end{center}
end{figure}

In Figure ~ref{fig:sampleconfig}, the node labelled $A$ is the root APPLICATION node.


No matter how many times I recompile the LaTeX file, I still get two question marks in place of "Figure 1," like so: "Figure ??."



Am I doing something incorrectly?



Thanks in advance for your help.



EDIT



In case it would help to solve the problem: I'm using MikTex 2.9 on Windows 7.










share|improve this question




















  • 9





    The label command must go after the caption (or inside its argument). Besides you shouldn't be using the center environment, but rather the simple command centering in place of begin{center}

    – egreg
    Nov 21 '11 at 14:54













  • related question: tex.stackexchange.com/questions/20816/…

    – matth
    Nov 21 '11 at 15:04











  • Thanks for the suggestion about centering. I've updated my LaTeX file accordingly.

    – Shredderroy
    Nov 21 '11 at 16:11











  • If your references still do not resolve after correctly placing the label{} command, see this related question: tex.stackexchange.com/q/377685/61946

    – Steven C. Howell
    Jul 1 '17 at 12:53
















16















I have the following lines:



begin{figure}[htbp]
label{fig:sampleconfig}
begin{center}
begin{tikzpicture}[level distance=1.5cm, grow=down,
every node/.style={minimum size=1cm,circle,thin,draw},
edge from parent/.style={-latex, thin, draw}
]
node {$A$}
child {
node {$CO_{1}$}
child {node[rectangle,draw] {$CL_{1}$}}
}
child {
node[circle,dotted,draw] {$cdots$}
child {node[rectangle,dotted,draw] {$cdots$}}
}
child {
node {$CO_{n}$}
child {node[rectangle,draw] {$CL_{n}$}}
}
;
end{tikzpicture}
caption{Sample configuration}
end{center}
end{figure}

In Figure ~ref{fig:sampleconfig}, the node labelled $A$ is the root APPLICATION node.


No matter how many times I recompile the LaTeX file, I still get two question marks in place of "Figure 1," like so: "Figure ??."



Am I doing something incorrectly?



Thanks in advance for your help.



EDIT



In case it would help to solve the problem: I'm using MikTex 2.9 on Windows 7.










share|improve this question




















  • 9





    The label command must go after the caption (or inside its argument). Besides you shouldn't be using the center environment, but rather the simple command centering in place of begin{center}

    – egreg
    Nov 21 '11 at 14:54













  • related question: tex.stackexchange.com/questions/20816/…

    – matth
    Nov 21 '11 at 15:04











  • Thanks for the suggestion about centering. I've updated my LaTeX file accordingly.

    – Shredderroy
    Nov 21 '11 at 16:11











  • If your references still do not resolve after correctly placing the label{} command, see this related question: tex.stackexchange.com/q/377685/61946

    – Steven C. Howell
    Jul 1 '17 at 12:53














16












16








16


9






I have the following lines:



begin{figure}[htbp]
label{fig:sampleconfig}
begin{center}
begin{tikzpicture}[level distance=1.5cm, grow=down,
every node/.style={minimum size=1cm,circle,thin,draw},
edge from parent/.style={-latex, thin, draw}
]
node {$A$}
child {
node {$CO_{1}$}
child {node[rectangle,draw] {$CL_{1}$}}
}
child {
node[circle,dotted,draw] {$cdots$}
child {node[rectangle,dotted,draw] {$cdots$}}
}
child {
node {$CO_{n}$}
child {node[rectangle,draw] {$CL_{n}$}}
}
;
end{tikzpicture}
caption{Sample configuration}
end{center}
end{figure}

In Figure ~ref{fig:sampleconfig}, the node labelled $A$ is the root APPLICATION node.


No matter how many times I recompile the LaTeX file, I still get two question marks in place of "Figure 1," like so: "Figure ??."



Am I doing something incorrectly?



Thanks in advance for your help.



EDIT



In case it would help to solve the problem: I'm using MikTex 2.9 on Windows 7.










share|improve this question
















I have the following lines:



begin{figure}[htbp]
label{fig:sampleconfig}
begin{center}
begin{tikzpicture}[level distance=1.5cm, grow=down,
every node/.style={minimum size=1cm,circle,thin,draw},
edge from parent/.style={-latex, thin, draw}
]
node {$A$}
child {
node {$CO_{1}$}
child {node[rectangle,draw] {$CL_{1}$}}
}
child {
node[circle,dotted,draw] {$cdots$}
child {node[rectangle,dotted,draw] {$cdots$}}
}
child {
node {$CO_{n}$}
child {node[rectangle,draw] {$CL_{n}$}}
}
;
end{tikzpicture}
caption{Sample configuration}
end{center}
end{figure}

In Figure ~ref{fig:sampleconfig}, the node labelled $A$ is the root APPLICATION node.


No matter how many times I recompile the LaTeX file, I still get two question marks in place of "Figure 1," like so: "Figure ??."



Am I doing something incorrectly?



Thanks in advance for your help.



EDIT



In case it would help to solve the problem: I'm using MikTex 2.9 on Windows 7.







cross-referencing captions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '11 at 17:25









lockstep

191k52590720




191k52590720










asked Nov 21 '11 at 14:18









ShredderroyShredderroy

191126




191126








  • 9





    The label command must go after the caption (or inside its argument). Besides you shouldn't be using the center environment, but rather the simple command centering in place of begin{center}

    – egreg
    Nov 21 '11 at 14:54













  • related question: tex.stackexchange.com/questions/20816/…

    – matth
    Nov 21 '11 at 15:04











  • Thanks for the suggestion about centering. I've updated my LaTeX file accordingly.

    – Shredderroy
    Nov 21 '11 at 16:11











  • If your references still do not resolve after correctly placing the label{} command, see this related question: tex.stackexchange.com/q/377685/61946

    – Steven C. Howell
    Jul 1 '17 at 12:53














  • 9





    The label command must go after the caption (or inside its argument). Besides you shouldn't be using the center environment, but rather the simple command centering in place of begin{center}

    – egreg
    Nov 21 '11 at 14:54













  • related question: tex.stackexchange.com/questions/20816/…

    – matth
    Nov 21 '11 at 15:04











  • Thanks for the suggestion about centering. I've updated my LaTeX file accordingly.

    – Shredderroy
    Nov 21 '11 at 16:11











  • If your references still do not resolve after correctly placing the label{} command, see this related question: tex.stackexchange.com/q/377685/61946

    – Steven C. Howell
    Jul 1 '17 at 12:53








9




9





The label command must go after the caption (or inside its argument). Besides you shouldn't be using the center environment, but rather the simple command centering in place of begin{center}

– egreg
Nov 21 '11 at 14:54







The label command must go after the caption (or inside its argument). Besides you shouldn't be using the center environment, but rather the simple command centering in place of begin{center}

– egreg
Nov 21 '11 at 14:54















related question: tex.stackexchange.com/questions/20816/…

– matth
Nov 21 '11 at 15:04





related question: tex.stackexchange.com/questions/20816/…

– matth
Nov 21 '11 at 15:04













Thanks for the suggestion about centering. I've updated my LaTeX file accordingly.

– Shredderroy
Nov 21 '11 at 16:11





Thanks for the suggestion about centering. I've updated my LaTeX file accordingly.

– Shredderroy
Nov 21 '11 at 16:11













If your references still do not resolve after correctly placing the label{} command, see this related question: tex.stackexchange.com/q/377685/61946

– Steven C. Howell
Jul 1 '17 at 12:53





If your references still do not resolve after correctly placing the label{} command, see this related question: tex.stackexchange.com/q/377685/61946

– Steven C. Howell
Jul 1 '17 at 12:53










1 Answer
1






active

oldest

votes


















30














Put your label in the caption itself. i.e.



caption{Sample configurationlabel{fig:sampleconfig}}


It should work then. You can also place it after the caption as long as it is still in the figure environment. Figure labels do not behave correctly if they are placed before the caption.






share|improve this answer
























  • Unfortunately, the problem persists even after following your suggestion. I have a feeling it might have something to do with MikTex. I think if I transfer the LaTex file to my Fedora workstation, download all the TeX packages and compile there, everything will show up correctly. But someone here must know better than me about this problem.

    – Shredderroy
    Nov 21 '11 at 14:28













  • It is extremely unlikely that this is a MikTeX problem. Are you sure? Delete the aux file and try a couple more times if you didn't delete it before. You also need to upgrade the example above to a MWE that demonstrates your problem. Inserting your code in a shell article with just the TikZ package included shows your problem until I perform the change detailed in the answer.

    – qubyte
    Nov 21 '11 at 14:32











  • I put the label command after the caption command and not inside it. It worked for me!

    – varsh
    Feb 18 at 16:17











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%2f35610%2freferences-wont-resolve-even-after-repeated-compilation%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









30














Put your label in the caption itself. i.e.



caption{Sample configurationlabel{fig:sampleconfig}}


It should work then. You can also place it after the caption as long as it is still in the figure environment. Figure labels do not behave correctly if they are placed before the caption.






share|improve this answer
























  • Unfortunately, the problem persists even after following your suggestion. I have a feeling it might have something to do with MikTex. I think if I transfer the LaTex file to my Fedora workstation, download all the TeX packages and compile there, everything will show up correctly. But someone here must know better than me about this problem.

    – Shredderroy
    Nov 21 '11 at 14:28













  • It is extremely unlikely that this is a MikTeX problem. Are you sure? Delete the aux file and try a couple more times if you didn't delete it before. You also need to upgrade the example above to a MWE that demonstrates your problem. Inserting your code in a shell article with just the TikZ package included shows your problem until I perform the change detailed in the answer.

    – qubyte
    Nov 21 '11 at 14:32











  • I put the label command after the caption command and not inside it. It worked for me!

    – varsh
    Feb 18 at 16:17
















30














Put your label in the caption itself. i.e.



caption{Sample configurationlabel{fig:sampleconfig}}


It should work then. You can also place it after the caption as long as it is still in the figure environment. Figure labels do not behave correctly if they are placed before the caption.






share|improve this answer
























  • Unfortunately, the problem persists even after following your suggestion. I have a feeling it might have something to do with MikTex. I think if I transfer the LaTex file to my Fedora workstation, download all the TeX packages and compile there, everything will show up correctly. But someone here must know better than me about this problem.

    – Shredderroy
    Nov 21 '11 at 14:28













  • It is extremely unlikely that this is a MikTeX problem. Are you sure? Delete the aux file and try a couple more times if you didn't delete it before. You also need to upgrade the example above to a MWE that demonstrates your problem. Inserting your code in a shell article with just the TikZ package included shows your problem until I perform the change detailed in the answer.

    – qubyte
    Nov 21 '11 at 14:32











  • I put the label command after the caption command and not inside it. It worked for me!

    – varsh
    Feb 18 at 16:17














30












30








30







Put your label in the caption itself. i.e.



caption{Sample configurationlabel{fig:sampleconfig}}


It should work then. You can also place it after the caption as long as it is still in the figure environment. Figure labels do not behave correctly if they are placed before the caption.






share|improve this answer













Put your label in the caption itself. i.e.



caption{Sample configurationlabel{fig:sampleconfig}}


It should work then. You can also place it after the caption as long as it is still in the figure environment. Figure labels do not behave correctly if they are placed before the caption.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '11 at 14:23









qubytequbyte

13.5k44288




13.5k44288













  • Unfortunately, the problem persists even after following your suggestion. I have a feeling it might have something to do with MikTex. I think if I transfer the LaTex file to my Fedora workstation, download all the TeX packages and compile there, everything will show up correctly. But someone here must know better than me about this problem.

    – Shredderroy
    Nov 21 '11 at 14:28













  • It is extremely unlikely that this is a MikTeX problem. Are you sure? Delete the aux file and try a couple more times if you didn't delete it before. You also need to upgrade the example above to a MWE that demonstrates your problem. Inserting your code in a shell article with just the TikZ package included shows your problem until I perform the change detailed in the answer.

    – qubyte
    Nov 21 '11 at 14:32











  • I put the label command after the caption command and not inside it. It worked for me!

    – varsh
    Feb 18 at 16:17



















  • Unfortunately, the problem persists even after following your suggestion. I have a feeling it might have something to do with MikTex. I think if I transfer the LaTex file to my Fedora workstation, download all the TeX packages and compile there, everything will show up correctly. But someone here must know better than me about this problem.

    – Shredderroy
    Nov 21 '11 at 14:28













  • It is extremely unlikely that this is a MikTeX problem. Are you sure? Delete the aux file and try a couple more times if you didn't delete it before. You also need to upgrade the example above to a MWE that demonstrates your problem. Inserting your code in a shell article with just the TikZ package included shows your problem until I perform the change detailed in the answer.

    – qubyte
    Nov 21 '11 at 14:32











  • I put the label command after the caption command and not inside it. It worked for me!

    – varsh
    Feb 18 at 16:17

















Unfortunately, the problem persists even after following your suggestion. I have a feeling it might have something to do with MikTex. I think if I transfer the LaTex file to my Fedora workstation, download all the TeX packages and compile there, everything will show up correctly. But someone here must know better than me about this problem.

– Shredderroy
Nov 21 '11 at 14:28







Unfortunately, the problem persists even after following your suggestion. I have a feeling it might have something to do with MikTex. I think if I transfer the LaTex file to my Fedora workstation, download all the TeX packages and compile there, everything will show up correctly. But someone here must know better than me about this problem.

– Shredderroy
Nov 21 '11 at 14:28















It is extremely unlikely that this is a MikTeX problem. Are you sure? Delete the aux file and try a couple more times if you didn't delete it before. You also need to upgrade the example above to a MWE that demonstrates your problem. Inserting your code in a shell article with just the TikZ package included shows your problem until I perform the change detailed in the answer.

– qubyte
Nov 21 '11 at 14:32





It is extremely unlikely that this is a MikTeX problem. Are you sure? Delete the aux file and try a couple more times if you didn't delete it before. You also need to upgrade the example above to a MWE that demonstrates your problem. Inserting your code in a shell article with just the TikZ package included shows your problem until I perform the change detailed in the answer.

– qubyte
Nov 21 '11 at 14:32













I put the label command after the caption command and not inside it. It worked for me!

– varsh
Feb 18 at 16:17





I put the label command after the caption command and not inside it. It worked for me!

– varsh
Feb 18 at 16:17


















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%2f35610%2freferences-wont-resolve-even-after-repeated-compilation%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

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?