Wrong figure numbering when using ref on subfigure











up vote
0
down vote

favorite












I have a problem where the figure number is multiplied with 11 when using ref i the text. The code and picture follows below.



The step response with current disturbance can be seen in figure ref{p5p3c}. Additionally the rudder angle behavior with and without current disturbance is shown in figure ref{p5p3b2}

begin{figure}[h!]
centering
nocaption
begin{subfigure}{.48linewidth}
includegraphics[width = 0.95textwidth]{Figures/p5p3c.pdf}
caption{Step response with current disturbance}
label{p5p3c}
end{subfigure}
begin{subfigure}{.48linewidth}
includegraphics[width=0.95textwidth]{Figures/p5p3b2.pdf}
caption{Comparison of rudder angle in problem 3b and 3c}
label{p5p3b2}
end{subfigure}
end{figure}


enter image description here



As you can see, i try refering to figure 8, while getting figure 88 in the text.
I think this has to do with the nocaption command i use to get figure number in the subcaption. The command is found somewhere else on this forum and implemented in the following way:



newcommandnocaption{%
renewcommandthesubfigure{thefigurealph{subfigure}}
}


both caption and subcaption package is included



If i remove the "thefigure" from the renewcommand, the reference in the text is correct, but i no longer have the figure number in the subcaption.



Would be grateful for any help:)










share|improve this question




















  • 1




    (1) welcome, (2) you are much more likely to get help if you include a full minimal example, not just a sniplet where we cannot see the preamble, we do not have access to the images etc. Replace the images by say rule{4cm}{4cm} and post a self contained document that shows the problem you have
    – daleif
    yesterday






  • 1




    In your case it's likely sufficient to redefine nocaption as the following: newcommandnocaption{% renewcommandthefigure{} renewcommandthesubfigure{arabic{figure}alph{subfigure}} }
    – Sergei Golovan
    yesterday












  • The new nocaption command worked perfectly, thanks :)
    – olacv15
    yesterday















up vote
0
down vote

favorite












I have a problem where the figure number is multiplied with 11 when using ref i the text. The code and picture follows below.



The step response with current disturbance can be seen in figure ref{p5p3c}. Additionally the rudder angle behavior with and without current disturbance is shown in figure ref{p5p3b2}

begin{figure}[h!]
centering
nocaption
begin{subfigure}{.48linewidth}
includegraphics[width = 0.95textwidth]{Figures/p5p3c.pdf}
caption{Step response with current disturbance}
label{p5p3c}
end{subfigure}
begin{subfigure}{.48linewidth}
includegraphics[width=0.95textwidth]{Figures/p5p3b2.pdf}
caption{Comparison of rudder angle in problem 3b and 3c}
label{p5p3b2}
end{subfigure}
end{figure}


enter image description here



As you can see, i try refering to figure 8, while getting figure 88 in the text.
I think this has to do with the nocaption command i use to get figure number in the subcaption. The command is found somewhere else on this forum and implemented in the following way:



newcommandnocaption{%
renewcommandthesubfigure{thefigurealph{subfigure}}
}


both caption and subcaption package is included



If i remove the "thefigure" from the renewcommand, the reference in the text is correct, but i no longer have the figure number in the subcaption.



Would be grateful for any help:)










share|improve this question




















  • 1




    (1) welcome, (2) you are much more likely to get help if you include a full minimal example, not just a sniplet where we cannot see the preamble, we do not have access to the images etc. Replace the images by say rule{4cm}{4cm} and post a self contained document that shows the problem you have
    – daleif
    yesterday






  • 1




    In your case it's likely sufficient to redefine nocaption as the following: newcommandnocaption{% renewcommandthefigure{} renewcommandthesubfigure{arabic{figure}alph{subfigure}} }
    – Sergei Golovan
    yesterday












  • The new nocaption command worked perfectly, thanks :)
    – olacv15
    yesterday













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a problem where the figure number is multiplied with 11 when using ref i the text. The code and picture follows below.



The step response with current disturbance can be seen in figure ref{p5p3c}. Additionally the rudder angle behavior with and without current disturbance is shown in figure ref{p5p3b2}

begin{figure}[h!]
centering
nocaption
begin{subfigure}{.48linewidth}
includegraphics[width = 0.95textwidth]{Figures/p5p3c.pdf}
caption{Step response with current disturbance}
label{p5p3c}
end{subfigure}
begin{subfigure}{.48linewidth}
includegraphics[width=0.95textwidth]{Figures/p5p3b2.pdf}
caption{Comparison of rudder angle in problem 3b and 3c}
label{p5p3b2}
end{subfigure}
end{figure}


enter image description here



As you can see, i try refering to figure 8, while getting figure 88 in the text.
I think this has to do with the nocaption command i use to get figure number in the subcaption. The command is found somewhere else on this forum and implemented in the following way:



newcommandnocaption{%
renewcommandthesubfigure{thefigurealph{subfigure}}
}


both caption and subcaption package is included



If i remove the "thefigure" from the renewcommand, the reference in the text is correct, but i no longer have the figure number in the subcaption.



Would be grateful for any help:)










share|improve this question















I have a problem where the figure number is multiplied with 11 when using ref i the text. The code and picture follows below.



The step response with current disturbance can be seen in figure ref{p5p3c}. Additionally the rudder angle behavior with and without current disturbance is shown in figure ref{p5p3b2}

begin{figure}[h!]
centering
nocaption
begin{subfigure}{.48linewidth}
includegraphics[width = 0.95textwidth]{Figures/p5p3c.pdf}
caption{Step response with current disturbance}
label{p5p3c}
end{subfigure}
begin{subfigure}{.48linewidth}
includegraphics[width=0.95textwidth]{Figures/p5p3b2.pdf}
caption{Comparison of rudder angle in problem 3b and 3c}
label{p5p3b2}
end{subfigure}
end{figure}


enter image description here



As you can see, i try refering to figure 8, while getting figure 88 in the text.
I think this has to do with the nocaption command i use to get figure number in the subcaption. The command is found somewhere else on this forum and implemented in the following way:



newcommandnocaption{%
renewcommandthesubfigure{thefigurealph{subfigure}}
}


both caption and subcaption package is included



If i remove the "thefigure" from the renewcommand, the reference in the text is correct, but i no longer have the figure number in the subcaption.



Would be grateful for any help:)







subfloats ref






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday

























asked yesterday









olacv15

11




11








  • 1




    (1) welcome, (2) you are much more likely to get help if you include a full minimal example, not just a sniplet where we cannot see the preamble, we do not have access to the images etc. Replace the images by say rule{4cm}{4cm} and post a self contained document that shows the problem you have
    – daleif
    yesterday






  • 1




    In your case it's likely sufficient to redefine nocaption as the following: newcommandnocaption{% renewcommandthefigure{} renewcommandthesubfigure{arabic{figure}alph{subfigure}} }
    – Sergei Golovan
    yesterday












  • The new nocaption command worked perfectly, thanks :)
    – olacv15
    yesterday














  • 1




    (1) welcome, (2) you are much more likely to get help if you include a full minimal example, not just a sniplet where we cannot see the preamble, we do not have access to the images etc. Replace the images by say rule{4cm}{4cm} and post a self contained document that shows the problem you have
    – daleif
    yesterday






  • 1




    In your case it's likely sufficient to redefine nocaption as the following: newcommandnocaption{% renewcommandthefigure{} renewcommandthesubfigure{arabic{figure}alph{subfigure}} }
    – Sergei Golovan
    yesterday












  • The new nocaption command worked perfectly, thanks :)
    – olacv15
    yesterday








1




1




(1) welcome, (2) you are much more likely to get help if you include a full minimal example, not just a sniplet where we cannot see the preamble, we do not have access to the images etc. Replace the images by say rule{4cm}{4cm} and post a self contained document that shows the problem you have
– daleif
yesterday




(1) welcome, (2) you are much more likely to get help if you include a full minimal example, not just a sniplet where we cannot see the preamble, we do not have access to the images etc. Replace the images by say rule{4cm}{4cm} and post a self contained document that shows the problem you have
– daleif
yesterday




1




1




In your case it's likely sufficient to redefine nocaption as the following: newcommandnocaption{% renewcommandthefigure{} renewcommandthesubfigure{arabic{figure}alph{subfigure}} }
– Sergei Golovan
yesterday






In your case it's likely sufficient to redefine nocaption as the following: newcommandnocaption{% renewcommandthefigure{} renewcommandthesubfigure{arabic{figure}alph{subfigure}} }
– Sergei Golovan
yesterday














The new nocaption command worked perfectly, thanks :)
– olacv15
yesterday




The new nocaption command worked perfectly, thanks :)
– olacv15
yesterday















active

oldest

votes











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',
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%2f459604%2fwrong-figure-numbering-when-using-ref-on-subfigure%23new-answer', 'question_page');
}
);

Post as a guest





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459604%2fwrong-figure-numbering-when-using-ref-on-subfigure%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?