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}

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
add a comment |
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}

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
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 sayrule{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 redefinenocaptionas the following:newcommandnocaption{% renewcommandthefigure{} renewcommandthesubfigure{arabic{figure}alph{subfigure}} }
– Sergei Golovan
yesterday
The new nocaption command worked perfectly, thanks :)
– olacv15
yesterday
add a comment |
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}

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
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}

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
subfloats ref
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 sayrule{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 redefinenocaptionas the following:newcommandnocaption{% renewcommandthefigure{} renewcommandthesubfigure{arabic{figure}alph{subfigure}} }
– Sergei Golovan
yesterday
The new nocaption command worked perfectly, thanks :)
– olacv15
yesterday
add a comment |
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 sayrule{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 redefinenocaptionas 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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
nocaptionas the following:newcommandnocaption{% renewcommandthefigure{} renewcommandthesubfigure{arabic{figure}alph{subfigure}} }– Sergei Golovan
yesterday
The new nocaption command worked perfectly, thanks :)
– olacv15
yesterday