Subfigures with combined caption?
Is it possible to group figures into a single float and reference them separately, without creating separate caption for each of the figures?
I am aware of subfloat
and subfigure
environments, but they create separate captions for each figure. The feature I am specifically looking for is to have subfigure numbering (such as (a), (b), ...) but also have the captions grouped together into a single block of text, separated by references ((a), (b), ...) to the images.
graphics floats subfloats
add a comment |
Is it possible to group figures into a single float and reference them separately, without creating separate caption for each of the figures?
I am aware of subfloat
and subfigure
environments, but they create separate captions for each figure. The feature I am specifically looking for is to have subfigure numbering (such as (a), (b), ...) but also have the captions grouped together into a single block of text, separated by references ((a), (b), ...) to the images.
graphics floats subfloats
add a comment |
Is it possible to group figures into a single float and reference them separately, without creating separate caption for each of the figures?
I am aware of subfloat
and subfigure
environments, but they create separate captions for each figure. The feature I am specifically looking for is to have subfigure numbering (such as (a), (b), ...) but also have the captions grouped together into a single block of text, separated by references ((a), (b), ...) to the images.
graphics floats subfloats
Is it possible to group figures into a single float and reference them separately, without creating separate caption for each of the figures?
I am aware of subfloat
and subfigure
environments, but they create separate captions for each figure. The feature I am specifically looking for is to have subfigure numbering (such as (a), (b), ...) but also have the captions grouped together into a single block of text, separated by references ((a), (b), ...) to the images.
graphics floats subfloats
graphics floats subfloats
asked Dec 12 '18 at 16:01
kdb
827514
827514
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Here is a solution with subcaption
. I think similar result can be obtained by using subfloat
also.
Just give caption{}
without any arguments so that it will print only the label ((a),(b)...) not the caption text. And then caption can be given for main figure, where subfigures can be 'sub'-reffered. Sample output:
Corresponding MWE made by modifying code from another question.
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-a}
caption{}
label{fig:a}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-b}
caption{}
label{fig:b}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-c}
caption{}
label{fig:c}
end{subfigure}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
EDIT
The caption can be placed on the left side by manually putting it there and using phantomsubcaption
to suppress the automatic caption. Sample output:
The corresponding code:
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
{(a)~includegraphics[width=0.25linewidth]{example-image-a}
phantomsubcaptionlabel{fig:a}}
{(b)~includegraphics[width=0.25linewidth]{example-image-b}
phantomsubcaptionlabel{fig:b}}
{(c)~includegraphics[width=0.25linewidth]{example-image-c}
phantomsubcaptionlabel{fig:c}}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
By any chance, do you know a method to get the label to the left of the images? I generally prefer to have output that looks as if I had written(a)includegraphics{...} (b)includegraphics
.
– kdb
Dec 14 '18 at 12:40
1
@kdb See the edit made to answer.
– nidhin
Dec 15 '18 at 7:10
add a comment |
As alternative to nidhin's answer, one can also use the subfig package:
documentclass{article}
usepackage{subfig}
usepackage{graphicx}
begin{document}
begin{figure}
centering
% Needed for the caption label (a), (b) to be typeset.
subfloat[label{fig:mytopic-blabla}]{
includegraphics[height=5cm]{images/graph-mytopic-blabla.png}
}
subfloat{
% Label can be either in caption or body.
label{fig:mytopic-yadayada}
includegraphics[height=5cm]{images/graph-mytopic-yadayada.png}
}
caption{
% Must protect the subref command inside floats/captions.
protectsubref{fig:mytopic-blabla}
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
protectsubref{fig:mytopic-yadayada}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
}
end{figure}
end{document}
add a comment |
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
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f464547%2fsubfigures-with-combined-caption%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is a solution with subcaption
. I think similar result can be obtained by using subfloat
also.
Just give caption{}
without any arguments so that it will print only the label ((a),(b)...) not the caption text. And then caption can be given for main figure, where subfigures can be 'sub'-reffered. Sample output:
Corresponding MWE made by modifying code from another question.
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-a}
caption{}
label{fig:a}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-b}
caption{}
label{fig:b}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-c}
caption{}
label{fig:c}
end{subfigure}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
EDIT
The caption can be placed on the left side by manually putting it there and using phantomsubcaption
to suppress the automatic caption. Sample output:
The corresponding code:
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
{(a)~includegraphics[width=0.25linewidth]{example-image-a}
phantomsubcaptionlabel{fig:a}}
{(b)~includegraphics[width=0.25linewidth]{example-image-b}
phantomsubcaptionlabel{fig:b}}
{(c)~includegraphics[width=0.25linewidth]{example-image-c}
phantomsubcaptionlabel{fig:c}}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
By any chance, do you know a method to get the label to the left of the images? I generally prefer to have output that looks as if I had written(a)includegraphics{...} (b)includegraphics
.
– kdb
Dec 14 '18 at 12:40
1
@kdb See the edit made to answer.
– nidhin
Dec 15 '18 at 7:10
add a comment |
Here is a solution with subcaption
. I think similar result can be obtained by using subfloat
also.
Just give caption{}
without any arguments so that it will print only the label ((a),(b)...) not the caption text. And then caption can be given for main figure, where subfigures can be 'sub'-reffered. Sample output:
Corresponding MWE made by modifying code from another question.
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-a}
caption{}
label{fig:a}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-b}
caption{}
label{fig:b}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-c}
caption{}
label{fig:c}
end{subfigure}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
EDIT
The caption can be placed on the left side by manually putting it there and using phantomsubcaption
to suppress the automatic caption. Sample output:
The corresponding code:
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
{(a)~includegraphics[width=0.25linewidth]{example-image-a}
phantomsubcaptionlabel{fig:a}}
{(b)~includegraphics[width=0.25linewidth]{example-image-b}
phantomsubcaptionlabel{fig:b}}
{(c)~includegraphics[width=0.25linewidth]{example-image-c}
phantomsubcaptionlabel{fig:c}}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
By any chance, do you know a method to get the label to the left of the images? I generally prefer to have output that looks as if I had written(a)includegraphics{...} (b)includegraphics
.
– kdb
Dec 14 '18 at 12:40
1
@kdb See the edit made to answer.
– nidhin
Dec 15 '18 at 7:10
add a comment |
Here is a solution with subcaption
. I think similar result can be obtained by using subfloat
also.
Just give caption{}
without any arguments so that it will print only the label ((a),(b)...) not the caption text. And then caption can be given for main figure, where subfigures can be 'sub'-reffered. Sample output:
Corresponding MWE made by modifying code from another question.
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-a}
caption{}
label{fig:a}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-b}
caption{}
label{fig:b}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-c}
caption{}
label{fig:c}
end{subfigure}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
EDIT
The caption can be placed on the left side by manually putting it there and using phantomsubcaption
to suppress the automatic caption. Sample output:
The corresponding code:
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
{(a)~includegraphics[width=0.25linewidth]{example-image-a}
phantomsubcaptionlabel{fig:a}}
{(b)~includegraphics[width=0.25linewidth]{example-image-b}
phantomsubcaptionlabel{fig:b}}
{(c)~includegraphics[width=0.25linewidth]{example-image-c}
phantomsubcaptionlabel{fig:c}}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
Here is a solution with subcaption
. I think similar result can be obtained by using subfloat
also.
Just give caption{}
without any arguments so that it will print only the label ((a),(b)...) not the caption text. And then caption can be given for main figure, where subfigures can be 'sub'-reffered. Sample output:
Corresponding MWE made by modifying code from another question.
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-a}
caption{}
label{fig:a}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-b}
caption{}
label{fig:b}
end{subfigure}
begin{subfigure}[b]{0.3linewidth}
includegraphics[width=linewidth]{example-image-c}
caption{}
label{fig:c}
end{subfigure}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
EDIT
The caption can be placed on the left side by manually putting it there and using phantomsubcaption
to suppress the automatic caption. Sample output:
The corresponding code:
documentclass{article}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{subrefformat=parens}
begin{document}
begin{figure}
centering
{(a)~includegraphics[width=0.25linewidth]{example-image-a}
phantomsubcaptionlabel{fig:a}}
{(b)~includegraphics[width=0.25linewidth]{example-image-b}
phantomsubcaptionlabel{fig:b}}
{(c)~includegraphics[width=0.25linewidth]{example-image-c}
phantomsubcaptionlabel{fig:c}}
caption{
subref{fig:a} first figure.
subref{fig:b} second figure.
subref{fig:c} third figure.
}
label{fig:main}
end{figure}
Figure~ref{fig:main} has three Subfigures--- ref{fig:a}, ref{fig:b} and ref{fig:c}.
end{document}
edited Dec 15 '18 at 7:09
answered Dec 12 '18 at 16:09
nidhin
3,342927
3,342927
By any chance, do you know a method to get the label to the left of the images? I generally prefer to have output that looks as if I had written(a)includegraphics{...} (b)includegraphics
.
– kdb
Dec 14 '18 at 12:40
1
@kdb See the edit made to answer.
– nidhin
Dec 15 '18 at 7:10
add a comment |
By any chance, do you know a method to get the label to the left of the images? I generally prefer to have output that looks as if I had written(a)includegraphics{...} (b)includegraphics
.
– kdb
Dec 14 '18 at 12:40
1
@kdb See the edit made to answer.
– nidhin
Dec 15 '18 at 7:10
By any chance, do you know a method to get the label to the left of the images? I generally prefer to have output that looks as if I had written
(a)includegraphics{...} (b)includegraphics
.– kdb
Dec 14 '18 at 12:40
By any chance, do you know a method to get the label to the left of the images? I generally prefer to have output that looks as if I had written
(a)includegraphics{...} (b)includegraphics
.– kdb
Dec 14 '18 at 12:40
1
1
@kdb See the edit made to answer.
– nidhin
Dec 15 '18 at 7:10
@kdb See the edit made to answer.
– nidhin
Dec 15 '18 at 7:10
add a comment |
As alternative to nidhin's answer, one can also use the subfig package:
documentclass{article}
usepackage{subfig}
usepackage{graphicx}
begin{document}
begin{figure}
centering
% Needed for the caption label (a), (b) to be typeset.
subfloat[label{fig:mytopic-blabla}]{
includegraphics[height=5cm]{images/graph-mytopic-blabla.png}
}
subfloat{
% Label can be either in caption or body.
label{fig:mytopic-yadayada}
includegraphics[height=5cm]{images/graph-mytopic-yadayada.png}
}
caption{
% Must protect the subref command inside floats/captions.
protectsubref{fig:mytopic-blabla}
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
protectsubref{fig:mytopic-yadayada}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
}
end{figure}
end{document}
add a comment |
As alternative to nidhin's answer, one can also use the subfig package:
documentclass{article}
usepackage{subfig}
usepackage{graphicx}
begin{document}
begin{figure}
centering
% Needed for the caption label (a), (b) to be typeset.
subfloat[label{fig:mytopic-blabla}]{
includegraphics[height=5cm]{images/graph-mytopic-blabla.png}
}
subfloat{
% Label can be either in caption or body.
label{fig:mytopic-yadayada}
includegraphics[height=5cm]{images/graph-mytopic-yadayada.png}
}
caption{
% Must protect the subref command inside floats/captions.
protectsubref{fig:mytopic-blabla}
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
protectsubref{fig:mytopic-yadayada}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
}
end{figure}
end{document}
add a comment |
As alternative to nidhin's answer, one can also use the subfig package:
documentclass{article}
usepackage{subfig}
usepackage{graphicx}
begin{document}
begin{figure}
centering
% Needed for the caption label (a), (b) to be typeset.
subfloat[label{fig:mytopic-blabla}]{
includegraphics[height=5cm]{images/graph-mytopic-blabla.png}
}
subfloat{
% Label can be either in caption or body.
label{fig:mytopic-yadayada}
includegraphics[height=5cm]{images/graph-mytopic-yadayada.png}
}
caption{
% Must protect the subref command inside floats/captions.
protectsubref{fig:mytopic-blabla}
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
protectsubref{fig:mytopic-yadayada}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
}
end{figure}
end{document}
As alternative to nidhin's answer, one can also use the subfig package:
documentclass{article}
usepackage{subfig}
usepackage{graphicx}
begin{document}
begin{figure}
centering
% Needed for the caption label (a), (b) to be typeset.
subfloat[label{fig:mytopic-blabla}]{
includegraphics[height=5cm]{images/graph-mytopic-blabla.png}
}
subfloat{
% Label can be either in caption or body.
label{fig:mytopic-yadayada}
includegraphics[height=5cm]{images/graph-mytopic-yadayada.png}
}
caption{
% Must protect the subref command inside floats/captions.
protectsubref{fig:mytopic-blabla}
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
protectsubref{fig:mytopic-yadayada}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
}
end{figure}
end{document}
answered Dec 14 '18 at 12:53
kdb
827514
827514
add a comment |
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f464547%2fsubfigures-with-combined-caption%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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