numbering subfigures











up vote
0
down vote

favorite












I've got three figures that I place vertically on a half page.



begin{figure}
includegraphics[width=0.4textwidth]{images/fig1a.png}
includegraphics[width=0.4textwidth]{images/fig1b.png}
includegraphics[width=0.4textwidth]{images/fig1c.png}
end{figure}


I want to subnumber them and put the (a), (b) and (c) at the corners of the images. All three figures are of different resolutions and sizes. It's hard do that and get them vertically aligned in the resulted pdf. So, my question is if there is a proper tool or package to do this automatically?



Regards
Ilya










share|improve this question














bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 3




    Welcome to TeX SX! Try the subfigure environment, from the subcaption package.
    – Bernard
    Nov 9 at 22:54










  • Which corner? Lower left is easiest.
    – John Kormylo
    Nov 10 at 4:34










  • Ideally upper right or left.
    – Ilya Bryukhanov
    Nov 10 at 6:44















up vote
0
down vote

favorite












I've got three figures that I place vertically on a half page.



begin{figure}
includegraphics[width=0.4textwidth]{images/fig1a.png}
includegraphics[width=0.4textwidth]{images/fig1b.png}
includegraphics[width=0.4textwidth]{images/fig1c.png}
end{figure}


I want to subnumber them and put the (a), (b) and (c) at the corners of the images. All three figures are of different resolutions and sizes. It's hard do that and get them vertically aligned in the resulted pdf. So, my question is if there is a proper tool or package to do this automatically?



Regards
Ilya










share|improve this question














bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 3




    Welcome to TeX SX! Try the subfigure environment, from the subcaption package.
    – Bernard
    Nov 9 at 22:54










  • Which corner? Lower left is easiest.
    – John Kormylo
    Nov 10 at 4:34










  • Ideally upper right or left.
    – Ilya Bryukhanov
    Nov 10 at 6:44













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I've got three figures that I place vertically on a half page.



begin{figure}
includegraphics[width=0.4textwidth]{images/fig1a.png}
includegraphics[width=0.4textwidth]{images/fig1b.png}
includegraphics[width=0.4textwidth]{images/fig1c.png}
end{figure}


I want to subnumber them and put the (a), (b) and (c) at the corners of the images. All three figures are of different resolutions and sizes. It's hard do that and get them vertically aligned in the resulted pdf. So, my question is if there is a proper tool or package to do this automatically?



Regards
Ilya










share|improve this question













I've got three figures that I place vertically on a half page.



begin{figure}
includegraphics[width=0.4textwidth]{images/fig1a.png}
includegraphics[width=0.4textwidth]{images/fig1b.png}
includegraphics[width=0.4textwidth]{images/fig1c.png}
end{figure}


I want to subnumber them and put the (a), (b) and (c) at the corners of the images. All three figures are of different resolutions and sizes. It's hard do that and get them vertically aligned in the resulted pdf. So, my question is if there is a proper tool or package to do this automatically?



Regards
Ilya







floats numbering






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 at 22:45









Ilya Bryukhanov

1




1





bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 3




    Welcome to TeX SX! Try the subfigure environment, from the subcaption package.
    – Bernard
    Nov 9 at 22:54










  • Which corner? Lower left is easiest.
    – John Kormylo
    Nov 10 at 4:34










  • Ideally upper right or left.
    – Ilya Bryukhanov
    Nov 10 at 6:44














  • 3




    Welcome to TeX SX! Try the subfigure environment, from the subcaption package.
    – Bernard
    Nov 9 at 22:54










  • Which corner? Lower left is easiest.
    – John Kormylo
    Nov 10 at 4:34










  • Ideally upper right or left.
    – Ilya Bryukhanov
    Nov 10 at 6:44








3




3




Welcome to TeX SX! Try the subfigure environment, from the subcaption package.
– Bernard
Nov 9 at 22:54




Welcome to TeX SX! Try the subfigure environment, from the subcaption package.
– Bernard
Nov 9 at 22:54












Which corner? Lower left is easiest.
– John Kormylo
Nov 10 at 4:34




Which corner? Lower left is easiest.
– John Kormylo
Nov 10 at 4:34












Ideally upper right or left.
– Ilya Bryukhanov
Nov 10 at 6:44




Ideally upper right or left.
– Ilya Bryukhanov
Nov 10 at 6:44










2 Answers
2






active

oldest

votes

















up vote
0
down vote













There are a few details which can be painful to discover, since some are from the caption manual. The blank lines (par) are needed to keep them from winding up side by side.



You said different sizes. Although the MWE uses known sizes, this will work for images with unknown sizes. subcaptionbox does this automatically (thank you Alex Sommerfelt for pointing this out), but it is no big deal. All subfigures are basically minipages with captions.



documentclass{article}
usepackage[singlelinecheck=off]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
usebox0
caption{}
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}
leavevmodellap{(c)~}% left
usebox0
(c)
end{minipage}
caption{There is usually one of these too.}
end{figure}
end{document}


demo





These solutions puts the subcaption at the upper right corner.



documentclass{article}
usepackage[singlelinecheck=off,justification=raggedleft,position=top]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
caption{}
usebox0
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}% in case you want to align side by side
strutmakebox[wd0][r]{(c)}par% above
usebox0%
rlap{raisebox{dimexpr ht0-topskip}{(c)}}% right
end{minipage}

caption{There is usually one of these too.}
end{figure}
end{document}


demo 2






share|improve this answer























  • You write "The subfig package does this automatically". This is true, but the subcaption package does this automatically, too, when subcaptionbox is used instead of the subfigure environment.
    – Axel Sommerfeldt
    Nov 10 at 21:11










  • @AxelSommerfeldt - Ah yes. An even better reason to stop using subfig.
    – John Kormylo
    Nov 11 at 14:43


















up vote
0
down vote













I think the simplest of all methods is to use the subfigure package, that adjusts to the desired dimensions of your images, althought it has problems with tikz, so I avoid it, but it works wonderfully with imported graphics



documentclass{article}
usepackage{graphicx,subfigure}
begin{document}
begin{figure}
centering
subfigure[Subcaption a.]{includegraphics[width=.6textwidth]{example-image-a}}
subfigure[Subcaption b.]{includegraphics[width=.6textwidth]{example-image-b}}
subfigure[Subcaption c.]{includegraphics[width=.6textwidth]{example-image-c}}
caption{Caption}
end{figure}
end{document}


enter image description here






share|improve this answer





















  • subfigure is obsolete package. instead of it is suggested to use the subfig package.
    – Zarko
    3 hours ago











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%2f459226%2fnumbering-subfigures%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








up vote
0
down vote













There are a few details which can be painful to discover, since some are from the caption manual. The blank lines (par) are needed to keep them from winding up side by side.



You said different sizes. Although the MWE uses known sizes, this will work for images with unknown sizes. subcaptionbox does this automatically (thank you Alex Sommerfelt for pointing this out), but it is no big deal. All subfigures are basically minipages with captions.



documentclass{article}
usepackage[singlelinecheck=off]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
usebox0
caption{}
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}
leavevmodellap{(c)~}% left
usebox0
(c)
end{minipage}
caption{There is usually one of these too.}
end{figure}
end{document}


demo





These solutions puts the subcaption at the upper right corner.



documentclass{article}
usepackage[singlelinecheck=off,justification=raggedleft,position=top]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
caption{}
usebox0
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}% in case you want to align side by side
strutmakebox[wd0][r]{(c)}par% above
usebox0%
rlap{raisebox{dimexpr ht0-topskip}{(c)}}% right
end{minipage}

caption{There is usually one of these too.}
end{figure}
end{document}


demo 2






share|improve this answer























  • You write "The subfig package does this automatically". This is true, but the subcaption package does this automatically, too, when subcaptionbox is used instead of the subfigure environment.
    – Axel Sommerfeldt
    Nov 10 at 21:11










  • @AxelSommerfeldt - Ah yes. An even better reason to stop using subfig.
    – John Kormylo
    Nov 11 at 14:43















up vote
0
down vote













There are a few details which can be painful to discover, since some are from the caption manual. The blank lines (par) are needed to keep them from winding up side by side.



You said different sizes. Although the MWE uses known sizes, this will work for images with unknown sizes. subcaptionbox does this automatically (thank you Alex Sommerfelt for pointing this out), but it is no big deal. All subfigures are basically minipages with captions.



documentclass{article}
usepackage[singlelinecheck=off]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
usebox0
caption{}
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}
leavevmodellap{(c)~}% left
usebox0
(c)
end{minipage}
caption{There is usually one of these too.}
end{figure}
end{document}


demo





These solutions puts the subcaption at the upper right corner.



documentclass{article}
usepackage[singlelinecheck=off,justification=raggedleft,position=top]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
caption{}
usebox0
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}% in case you want to align side by side
strutmakebox[wd0][r]{(c)}par% above
usebox0%
rlap{raisebox{dimexpr ht0-topskip}{(c)}}% right
end{minipage}

caption{There is usually one of these too.}
end{figure}
end{document}


demo 2






share|improve this answer























  • You write "The subfig package does this automatically". This is true, but the subcaption package does this automatically, too, when subcaptionbox is used instead of the subfigure environment.
    – Axel Sommerfeldt
    Nov 10 at 21:11










  • @AxelSommerfeldt - Ah yes. An even better reason to stop using subfig.
    – John Kormylo
    Nov 11 at 14:43













up vote
0
down vote










up vote
0
down vote









There are a few details which can be painful to discover, since some are from the caption manual. The blank lines (par) are needed to keep them from winding up side by side.



You said different sizes. Although the MWE uses known sizes, this will work for images with unknown sizes. subcaptionbox does this automatically (thank you Alex Sommerfelt for pointing this out), but it is no big deal. All subfigures are basically minipages with captions.



documentclass{article}
usepackage[singlelinecheck=off]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
usebox0
caption{}
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}
leavevmodellap{(c)~}% left
usebox0
(c)
end{minipage}
caption{There is usually one of these too.}
end{figure}
end{document}


demo





These solutions puts the subcaption at the upper right corner.



documentclass{article}
usepackage[singlelinecheck=off,justification=raggedleft,position=top]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
caption{}
usebox0
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}% in case you want to align side by side
strutmakebox[wd0][r]{(c)}par% above
usebox0%
rlap{raisebox{dimexpr ht0-topskip}{(c)}}% right
end{minipage}

caption{There is usually one of these too.}
end{figure}
end{document}


demo 2






share|improve this answer














There are a few details which can be painful to discover, since some are from the caption manual. The blank lines (par) are needed to keep them from winding up side by side.



You said different sizes. Although the MWE uses known sizes, this will work for images with unknown sizes. subcaptionbox does this automatically (thank you Alex Sommerfelt for pointing this out), but it is no big deal. All subfigures are basically minipages with captions.



documentclass{article}
usepackage[singlelinecheck=off]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
usebox0
caption{}
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}
leavevmodellap{(c)~}% left
usebox0
(c)
end{minipage}
caption{There is usually one of these too.}
end{figure}
end{document}


demo





These solutions puts the subcaption at the upper right corner.



documentclass{article}
usepackage[singlelinecheck=off,justification=raggedleft,position=top]{subcaption}
usepackage{graphicx}
begin{document}
begin{figure}
centering
subcaptionbox{}{includegraphics[width=0.4textwidth]{example-image-a}}

sbox0{includegraphics[width=0.4textwidth]{example-image-b}}% measure width
begin{subfigure}{wd0}
caption{}
usebox0
end{subfigure}

sbox0{includegraphics[width=0.4textwidth]{example-image-c}}% DIY caption
begin{minipage}{wd0}% in case you want to align side by side
strutmakebox[wd0][r]{(c)}par% above
usebox0%
rlap{raisebox{dimexpr ht0-topskip}{(c)}}% right
end{minipage}

caption{There is usually one of these too.}
end{figure}
end{document}


demo 2







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 11 at 15:19

























answered Nov 10 at 4:53









John Kormylo

43.5k12466




43.5k12466












  • You write "The subfig package does this automatically". This is true, but the subcaption package does this automatically, too, when subcaptionbox is used instead of the subfigure environment.
    – Axel Sommerfeldt
    Nov 10 at 21:11










  • @AxelSommerfeldt - Ah yes. An even better reason to stop using subfig.
    – John Kormylo
    Nov 11 at 14:43


















  • You write "The subfig package does this automatically". This is true, but the subcaption package does this automatically, too, when subcaptionbox is used instead of the subfigure environment.
    – Axel Sommerfeldt
    Nov 10 at 21:11










  • @AxelSommerfeldt - Ah yes. An even better reason to stop using subfig.
    – John Kormylo
    Nov 11 at 14:43
















You write "The subfig package does this automatically". This is true, but the subcaption package does this automatically, too, when subcaptionbox is used instead of the subfigure environment.
– Axel Sommerfeldt
Nov 10 at 21:11




You write "The subfig package does this automatically". This is true, but the subcaption package does this automatically, too, when subcaptionbox is used instead of the subfigure environment.
– Axel Sommerfeldt
Nov 10 at 21:11












@AxelSommerfeldt - Ah yes. An even better reason to stop using subfig.
– John Kormylo
Nov 11 at 14:43




@AxelSommerfeldt - Ah yes. An even better reason to stop using subfig.
– John Kormylo
Nov 11 at 14:43










up vote
0
down vote













I think the simplest of all methods is to use the subfigure package, that adjusts to the desired dimensions of your images, althought it has problems with tikz, so I avoid it, but it works wonderfully with imported graphics



documentclass{article}
usepackage{graphicx,subfigure}
begin{document}
begin{figure}
centering
subfigure[Subcaption a.]{includegraphics[width=.6textwidth]{example-image-a}}
subfigure[Subcaption b.]{includegraphics[width=.6textwidth]{example-image-b}}
subfigure[Subcaption c.]{includegraphics[width=.6textwidth]{example-image-c}}
caption{Caption}
end{figure}
end{document}


enter image description here






share|improve this answer





















  • subfigure is obsolete package. instead of it is suggested to use the subfig package.
    – Zarko
    3 hours ago















up vote
0
down vote













I think the simplest of all methods is to use the subfigure package, that adjusts to the desired dimensions of your images, althought it has problems with tikz, so I avoid it, but it works wonderfully with imported graphics



documentclass{article}
usepackage{graphicx,subfigure}
begin{document}
begin{figure}
centering
subfigure[Subcaption a.]{includegraphics[width=.6textwidth]{example-image-a}}
subfigure[Subcaption b.]{includegraphics[width=.6textwidth]{example-image-b}}
subfigure[Subcaption c.]{includegraphics[width=.6textwidth]{example-image-c}}
caption{Caption}
end{figure}
end{document}


enter image description here






share|improve this answer





















  • subfigure is obsolete package. instead of it is suggested to use the subfig package.
    – Zarko
    3 hours ago













up vote
0
down vote










up vote
0
down vote









I think the simplest of all methods is to use the subfigure package, that adjusts to the desired dimensions of your images, althought it has problems with tikz, so I avoid it, but it works wonderfully with imported graphics



documentclass{article}
usepackage{graphicx,subfigure}
begin{document}
begin{figure}
centering
subfigure[Subcaption a.]{includegraphics[width=.6textwidth]{example-image-a}}
subfigure[Subcaption b.]{includegraphics[width=.6textwidth]{example-image-b}}
subfigure[Subcaption c.]{includegraphics[width=.6textwidth]{example-image-c}}
caption{Caption}
end{figure}
end{document}


enter image description here






share|improve this answer












I think the simplest of all methods is to use the subfigure package, that adjusts to the desired dimensions of your images, althought it has problems with tikz, so I avoid it, but it works wonderfully with imported graphics



documentclass{article}
usepackage{graphicx,subfigure}
begin{document}
begin{figure}
centering
subfigure[Subcaption a.]{includegraphics[width=.6textwidth]{example-image-a}}
subfigure[Subcaption b.]{includegraphics[width=.6textwidth]{example-image-b}}
subfigure[Subcaption c.]{includegraphics[width=.6textwidth]{example-image-c}}
caption{Caption}
end{figure}
end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 11 at 21:08









José Ignacio Cuevas Barrientos

211




211












  • subfigure is obsolete package. instead of it is suggested to use the subfig package.
    – Zarko
    3 hours ago


















  • subfigure is obsolete package. instead of it is suggested to use the subfig package.
    – Zarko
    3 hours ago
















subfigure is obsolete package. instead of it is suggested to use the subfig package.
– Zarko
3 hours ago




subfigure is obsolete package. instead of it is suggested to use the subfig package.
– Zarko
3 hours ago


















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.





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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459226%2fnumbering-subfigures%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

Futebolista

F# list compare

Jornalista