Table of images with captions
up vote
5
down vote
favorite
I have a table with four images.
begin{table}[ht]
caption{table caption...}
centering
begin{tabular}{cc}
includegraphics[width=45mm]{w.png} &includegraphics[width=45mm]{x.png}\
newline
includegraphics[width=45mm]{y.png}&includegraphics[width=45mm]{z.png}\
end{tabular}
end{table}
I want to caption each of the images. Normally I would do this by placing includegraphics
within a begin{figure}
block using caption{...}
. But when I do this, the images disappear.
What is the proper way to do this, so that I can caption each of the images.
tables floats
add a comment |
up vote
5
down vote
favorite
I have a table with four images.
begin{table}[ht]
caption{table caption...}
centering
begin{tabular}{cc}
includegraphics[width=45mm]{w.png} &includegraphics[width=45mm]{x.png}\
newline
includegraphics[width=45mm]{y.png}&includegraphics[width=45mm]{z.png}\
end{tabular}
end{table}
I want to caption each of the images. Normally I would do this by placing includegraphics
within a begin{figure}
block using caption{...}
. But when I do this, the images disappear.
What is the proper way to do this, so that I can caption each of the images.
tables floats
add a comment |
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I have a table with four images.
begin{table}[ht]
caption{table caption...}
centering
begin{tabular}{cc}
includegraphics[width=45mm]{w.png} &includegraphics[width=45mm]{x.png}\
newline
includegraphics[width=45mm]{y.png}&includegraphics[width=45mm]{z.png}\
end{tabular}
end{table}
I want to caption each of the images. Normally I would do this by placing includegraphics
within a begin{figure}
block using caption{...}
. But when I do this, the images disappear.
What is the proper way to do this, so that I can caption each of the images.
tables floats
I have a table with four images.
begin{table}[ht]
caption{table caption...}
centering
begin{tabular}{cc}
includegraphics[width=45mm]{w.png} &includegraphics[width=45mm]{x.png}\
newline
includegraphics[width=45mm]{y.png}&includegraphics[width=45mm]{z.png}\
end{tabular}
end{table}
I want to caption each of the images. Normally I would do this by placing includegraphics
within a begin{figure}
block using caption{...}
. But when I do this, the images disappear.
What is the proper way to do this, so that I can caption each of the images.
tables floats
tables floats
edited Jul 15 '17 at 15:46
David Carlisle
479k3811121847
479k3811121847
asked Jul 20 '12 at 8:35
yayu
2,00772541
2,00772541
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
up vote
6
down vote
accepted
Or you could use the subfig
package:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
caption{label{ref_label_overall}Overall caption}
end{figure}
What if i want to add 4 images in two rows, how can i mdify this code?
– Misaki
Jul 28 '16 at 15:27
add a comment |
up vote
3
down vote
You can use the subcaption
package for this but I think you don't need table for such use. You can embed everything into a general figure environment and place them as you wish. See the manual for that. Here is the version with Table.
documentclass{article}
usepackage{mwe} % For dummy images
usepackage{subcaption}
begin{document}
{centering
begin{table}[ht]
begin{tabular}{cc}
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A}label{fig:taba}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-b}caption{Figure B}label{fig:tabb}end{subfigure}\
newline
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-c}caption{Figure C}label{fig:tabc}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A again}label{fig:taba2}end{subfigure}\
end{tabular}
caption{A table with figures}
label{tab:mytable}
end{table}
}
We can see that Figure ref{fig:taba} and Figure ref{fig:taba2} is the same. Also the table counter value is used for the reference.
end{document}
How do you control the vertical distance between the rows of figures?
– skan
Nov 16 '17 at 10:33
add a comment |
up vote
2
down vote
You could simply use capt-of
which provides stand-alone captionof
command
documentclass{book}
usepackage[demo]{graphicx}
usepackage{capt-of}
usepackage{tabu}
begin{document}
begin{table}[ht]
caption{Simple but not clever}
centering
begin{tabu}to textwidth {X[c]X[c]}
includegraphics[width=45mm]{w.png}captionof{figure}{fd} &includegraphics[width=45mm]{x.png}captionof{figure}{fd} \
includegraphics[width=45mm]{y.png}captionof{figure}{fd} &includegraphics[width=45mm]{z.png}captionof{figure}{fd} \
end{tabu}
end{table}
end{document}
This has two disadvantages: first it's not elegant and the table caption is much to close to the first picture. In my opinion one of the subfig
or subcaption
solutions is much better. When using a KOMA
class there is no need to load capt-of
.
add a comment |
up vote
0
down vote
Building off of a previous answer, if you want to use the subfig package with multiple rows:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
% leave a blank space for a new row
subfloat[Caption 3]{label{ref_label3}includegraphics[width=0.5textwidth]{path/to/figure3}}
subfloat[Caption 4]{label{ref_label4}includegraphics[width=0.5textwidth]{path/to/figure4}}
caption{label{ref_label_overall}Overall caption}
end{figure}
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
Or you could use the subfig
package:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
caption{label{ref_label_overall}Overall caption}
end{figure}
What if i want to add 4 images in two rows, how can i mdify this code?
– Misaki
Jul 28 '16 at 15:27
add a comment |
up vote
6
down vote
accepted
Or you could use the subfig
package:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
caption{label{ref_label_overall}Overall caption}
end{figure}
What if i want to add 4 images in two rows, how can i mdify this code?
– Misaki
Jul 28 '16 at 15:27
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
Or you could use the subfig
package:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
caption{label{ref_label_overall}Overall caption}
end{figure}
Or you could use the subfig
package:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
caption{label{ref_label_overall}Overall caption}
end{figure}
answered Jul 20 '12 at 11:49
Doches
28529
28529
What if i want to add 4 images in two rows, how can i mdify this code?
– Misaki
Jul 28 '16 at 15:27
add a comment |
What if i want to add 4 images in two rows, how can i mdify this code?
– Misaki
Jul 28 '16 at 15:27
What if i want to add 4 images in two rows, how can i mdify this code?
– Misaki
Jul 28 '16 at 15:27
What if i want to add 4 images in two rows, how can i mdify this code?
– Misaki
Jul 28 '16 at 15:27
add a comment |
up vote
3
down vote
You can use the subcaption
package for this but I think you don't need table for such use. You can embed everything into a general figure environment and place them as you wish. See the manual for that. Here is the version with Table.
documentclass{article}
usepackage{mwe} % For dummy images
usepackage{subcaption}
begin{document}
{centering
begin{table}[ht]
begin{tabular}{cc}
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A}label{fig:taba}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-b}caption{Figure B}label{fig:tabb}end{subfigure}\
newline
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-c}caption{Figure C}label{fig:tabc}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A again}label{fig:taba2}end{subfigure}\
end{tabular}
caption{A table with figures}
label{tab:mytable}
end{table}
}
We can see that Figure ref{fig:taba} and Figure ref{fig:taba2} is the same. Also the table counter value is used for the reference.
end{document}
How do you control the vertical distance between the rows of figures?
– skan
Nov 16 '17 at 10:33
add a comment |
up vote
3
down vote
You can use the subcaption
package for this but I think you don't need table for such use. You can embed everything into a general figure environment and place them as you wish. See the manual for that. Here is the version with Table.
documentclass{article}
usepackage{mwe} % For dummy images
usepackage{subcaption}
begin{document}
{centering
begin{table}[ht]
begin{tabular}{cc}
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A}label{fig:taba}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-b}caption{Figure B}label{fig:tabb}end{subfigure}\
newline
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-c}caption{Figure C}label{fig:tabc}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A again}label{fig:taba2}end{subfigure}\
end{tabular}
caption{A table with figures}
label{tab:mytable}
end{table}
}
We can see that Figure ref{fig:taba} and Figure ref{fig:taba2} is the same. Also the table counter value is used for the reference.
end{document}
How do you control the vertical distance between the rows of figures?
– skan
Nov 16 '17 at 10:33
add a comment |
up vote
3
down vote
up vote
3
down vote
You can use the subcaption
package for this but I think you don't need table for such use. You can embed everything into a general figure environment and place them as you wish. See the manual for that. Here is the version with Table.
documentclass{article}
usepackage{mwe} % For dummy images
usepackage{subcaption}
begin{document}
{centering
begin{table}[ht]
begin{tabular}{cc}
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A}label{fig:taba}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-b}caption{Figure B}label{fig:tabb}end{subfigure}\
newline
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-c}caption{Figure C}label{fig:tabc}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A again}label{fig:taba2}end{subfigure}\
end{tabular}
caption{A table with figures}
label{tab:mytable}
end{table}
}
We can see that Figure ref{fig:taba} and Figure ref{fig:taba2} is the same. Also the table counter value is used for the reference.
end{document}
You can use the subcaption
package for this but I think you don't need table for such use. You can embed everything into a general figure environment and place them as you wish. See the manual for that. Here is the version with Table.
documentclass{article}
usepackage{mwe} % For dummy images
usepackage{subcaption}
begin{document}
{centering
begin{table}[ht]
begin{tabular}{cc}
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A}label{fig:taba}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-b}caption{Figure B}label{fig:tabb}end{subfigure}\
newline
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-c}caption{Figure C}label{fig:tabc}end{subfigure}&
begin{subfigure}{0.4textwidth}centeringincludegraphics[width=0.3columnwidth]{example-image-a}caption{Figure A again}label{fig:taba2}end{subfigure}\
end{tabular}
caption{A table with figures}
label{tab:mytable}
end{table}
}
We can see that Figure ref{fig:taba} and Figure ref{fig:taba2} is the same. Also the table counter value is used for the reference.
end{document}
edited Jun 10 '17 at 10:06
answered Jul 20 '12 at 11:23
percusse
136k12253493
136k12253493
How do you control the vertical distance between the rows of figures?
– skan
Nov 16 '17 at 10:33
add a comment |
How do you control the vertical distance between the rows of figures?
– skan
Nov 16 '17 at 10:33
How do you control the vertical distance between the rows of figures?
– skan
Nov 16 '17 at 10:33
How do you control the vertical distance between the rows of figures?
– skan
Nov 16 '17 at 10:33
add a comment |
up vote
2
down vote
You could simply use capt-of
which provides stand-alone captionof
command
documentclass{book}
usepackage[demo]{graphicx}
usepackage{capt-of}
usepackage{tabu}
begin{document}
begin{table}[ht]
caption{Simple but not clever}
centering
begin{tabu}to textwidth {X[c]X[c]}
includegraphics[width=45mm]{w.png}captionof{figure}{fd} &includegraphics[width=45mm]{x.png}captionof{figure}{fd} \
includegraphics[width=45mm]{y.png}captionof{figure}{fd} &includegraphics[width=45mm]{z.png}captionof{figure}{fd} \
end{tabu}
end{table}
end{document}
This has two disadvantages: first it's not elegant and the table caption is much to close to the first picture. In my opinion one of the subfig
or subcaption
solutions is much better. When using a KOMA
class there is no need to load capt-of
.
add a comment |
up vote
2
down vote
You could simply use capt-of
which provides stand-alone captionof
command
documentclass{book}
usepackage[demo]{graphicx}
usepackage{capt-of}
usepackage{tabu}
begin{document}
begin{table}[ht]
caption{Simple but not clever}
centering
begin{tabu}to textwidth {X[c]X[c]}
includegraphics[width=45mm]{w.png}captionof{figure}{fd} &includegraphics[width=45mm]{x.png}captionof{figure}{fd} \
includegraphics[width=45mm]{y.png}captionof{figure}{fd} &includegraphics[width=45mm]{z.png}captionof{figure}{fd} \
end{tabu}
end{table}
end{document}
This has two disadvantages: first it's not elegant and the table caption is much to close to the first picture. In my opinion one of the subfig
or subcaption
solutions is much better. When using a KOMA
class there is no need to load capt-of
.
add a comment |
up vote
2
down vote
up vote
2
down vote
You could simply use capt-of
which provides stand-alone captionof
command
documentclass{book}
usepackage[demo]{graphicx}
usepackage{capt-of}
usepackage{tabu}
begin{document}
begin{table}[ht]
caption{Simple but not clever}
centering
begin{tabu}to textwidth {X[c]X[c]}
includegraphics[width=45mm]{w.png}captionof{figure}{fd} &includegraphics[width=45mm]{x.png}captionof{figure}{fd} \
includegraphics[width=45mm]{y.png}captionof{figure}{fd} &includegraphics[width=45mm]{z.png}captionof{figure}{fd} \
end{tabu}
end{table}
end{document}
This has two disadvantages: first it's not elegant and the table caption is much to close to the first picture. In my opinion one of the subfig
or subcaption
solutions is much better. When using a KOMA
class there is no need to load capt-of
.
You could simply use capt-of
which provides stand-alone captionof
command
documentclass{book}
usepackage[demo]{graphicx}
usepackage{capt-of}
usepackage{tabu}
begin{document}
begin{table}[ht]
caption{Simple but not clever}
centering
begin{tabu}to textwidth {X[c]X[c]}
includegraphics[width=45mm]{w.png}captionof{figure}{fd} &includegraphics[width=45mm]{x.png}captionof{figure}{fd} \
includegraphics[width=45mm]{y.png}captionof{figure}{fd} &includegraphics[width=45mm]{z.png}captionof{figure}{fd} \
end{tabu}
end{table}
end{document}
This has two disadvantages: first it's not elegant and the table caption is much to close to the first picture. In my opinion one of the subfig
or subcaption
solutions is much better. When using a KOMA
class there is no need to load capt-of
.
edited Jun 15 '17 at 18:20
David Carlisle
479k3811121847
479k3811121847
answered Jul 20 '12 at 14:20
bloodworks
8,1632658
8,1632658
add a comment |
add a comment |
up vote
0
down vote
Building off of a previous answer, if you want to use the subfig package with multiple rows:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
% leave a blank space for a new row
subfloat[Caption 3]{label{ref_label3}includegraphics[width=0.5textwidth]{path/to/figure3}}
subfloat[Caption 4]{label{ref_label4}includegraphics[width=0.5textwidth]{path/to/figure4}}
caption{label{ref_label_overall}Overall caption}
end{figure}
add a comment |
up vote
0
down vote
Building off of a previous answer, if you want to use the subfig package with multiple rows:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
% leave a blank space for a new row
subfloat[Caption 3]{label{ref_label3}includegraphics[width=0.5textwidth]{path/to/figure3}}
subfloat[Caption 4]{label{ref_label4}includegraphics[width=0.5textwidth]{path/to/figure4}}
caption{label{ref_label_overall}Overall caption}
end{figure}
add a comment |
up vote
0
down vote
up vote
0
down vote
Building off of a previous answer, if you want to use the subfig package with multiple rows:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
% leave a blank space for a new row
subfloat[Caption 3]{label{ref_label3}includegraphics[width=0.5textwidth]{path/to/figure3}}
subfloat[Caption 4]{label{ref_label4}includegraphics[width=0.5textwidth]{path/to/figure4}}
caption{label{ref_label_overall}Overall caption}
end{figure}
Building off of a previous answer, if you want to use the subfig package with multiple rows:
usepackage{subfig}
...
begin{figure}
centering
subfloat[Caption 1]{label{ref_label1}includegraphics[width=0.5textwidth]{path/to/figure1}}
subfloat[Caption 2]{label{ref_label2}includegraphics[width=0.5textwidth]{path/to/figure1}}
% leave a blank space for a new row
subfloat[Caption 3]{label{ref_label3}includegraphics[width=0.5textwidth]{path/to/figure3}}
subfloat[Caption 4]{label{ref_label4}includegraphics[width=0.5textwidth]{path/to/figure4}}
caption{label{ref_label_overall}Overall caption}
end{figure}
answered Nov 30 at 14:23
Ryan Burrow
11
11
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%2f64038%2ftable-of-images-with-captions%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