Using longtable for figures: the figures overlap with horizontal and vertical lines
up vote
0
down vote
favorite
I have a huge number of plots that I want to insert in longtable to make a figure table, possibly ranging several pages.
However I am not able to scale the figures inside each table cell in such a way that they do not overlap with horizontal and vertical lines in the table. If I simply reduce the width of each table cell, the cell and the figure are reduced the same factor and the figure still overlaps with the lines.
Can anybody help me with a code change that avoiding this overlap?
In addition, how do I place the "figure lacking" text in the middle of their cells, horizontally and vertically?
Thanks in advance!
EDIT: I am not able to correctly format my code lines in this window. I am using Ctr-K and four spaces. How to do this correctly?
documentclass[9pt,a4paper,twosided]{article}
usepackage{longtable}
usepackage{graphicx}
begin{document}
begin{longtable}{|c|c|c|}
caption{My caption for figures in longtable}
label{figtab-1B}\%
hline
multicolumn{3}{c}{The table heading of the first page}\%
hline
endfirsthead
multicolumn{3}{c}{tablename thetable -- textit{Continued from last page}}\%
hline
multicolumn{3}{c}{The table heading for the next pages}\%
hline
endhead
hline hline
multicolumn{3}{c}{tablename thetable -- textit{To be continued on the next page}} \%
endfoot
hline
endlastfoot
includegraphics[width=0.33textwidth]{./figures/1B_-_Alkalitet_til_pH_4_comma_5.jpg}&
figure lacking&
includegraphics[width=0.33textwidth]{./figures/1B_-_Ammonium_(NH4-N).jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Arsen_(As)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Bly_(Pb)_comma_oppsluttet_ICP-MS.jpg}&
figure lacking\
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Kadmium_(Cd)_comma_oppsluttet_ICP-MS.jpg}&
figure lacking&
includegraphics[width=0.33textwidth]{./figures/1B_-_Kobber_(Cu)_comma_oppsluttet_ICP-MS.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Krom_(Cr)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Krysen_slash_Trifenylen.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Naftalen.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Nikkel_(Ni)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Pyren.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Sink_(Zn)_comma_oppsluttet_ICP-MS.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Suspendert_stoff.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Total_Fosfor.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Total_Nitrogen.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_- _Total_organisk_karbon_(TOC_slash_NPOC).jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Turbiditet.jpg}\%
end{longtable}
end{document}
longtable
add a comment |
up vote
0
down vote
favorite
I have a huge number of plots that I want to insert in longtable to make a figure table, possibly ranging several pages.
However I am not able to scale the figures inside each table cell in such a way that they do not overlap with horizontal and vertical lines in the table. If I simply reduce the width of each table cell, the cell and the figure are reduced the same factor and the figure still overlaps with the lines.
Can anybody help me with a code change that avoiding this overlap?
In addition, how do I place the "figure lacking" text in the middle of their cells, horizontally and vertically?
Thanks in advance!
EDIT: I am not able to correctly format my code lines in this window. I am using Ctr-K and four spaces. How to do this correctly?
documentclass[9pt,a4paper,twosided]{article}
usepackage{longtable}
usepackage{graphicx}
begin{document}
begin{longtable}{|c|c|c|}
caption{My caption for figures in longtable}
label{figtab-1B}\%
hline
multicolumn{3}{c}{The table heading of the first page}\%
hline
endfirsthead
multicolumn{3}{c}{tablename thetable -- textit{Continued from last page}}\%
hline
multicolumn{3}{c}{The table heading for the next pages}\%
hline
endhead
hline hline
multicolumn{3}{c}{tablename thetable -- textit{To be continued on the next page}} \%
endfoot
hline
endlastfoot
includegraphics[width=0.33textwidth]{./figures/1B_-_Alkalitet_til_pH_4_comma_5.jpg}&
figure lacking&
includegraphics[width=0.33textwidth]{./figures/1B_-_Ammonium_(NH4-N).jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Arsen_(As)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Bly_(Pb)_comma_oppsluttet_ICP-MS.jpg}&
figure lacking\
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Kadmium_(Cd)_comma_oppsluttet_ICP-MS.jpg}&
figure lacking&
includegraphics[width=0.33textwidth]{./figures/1B_-_Kobber_(Cu)_comma_oppsluttet_ICP-MS.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Krom_(Cr)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Krysen_slash_Trifenylen.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Naftalen.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Nikkel_(Ni)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Pyren.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Sink_(Zn)_comma_oppsluttet_ICP-MS.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Suspendert_stoff.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Total_Fosfor.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Total_Nitrogen.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_- _Total_organisk_karbon_(TOC_slash_NPOC).jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Turbiditet.jpg}\%
end{longtable}
end{document}
longtable
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a huge number of plots that I want to insert in longtable to make a figure table, possibly ranging several pages.
However I am not able to scale the figures inside each table cell in such a way that they do not overlap with horizontal and vertical lines in the table. If I simply reduce the width of each table cell, the cell and the figure are reduced the same factor and the figure still overlaps with the lines.
Can anybody help me with a code change that avoiding this overlap?
In addition, how do I place the "figure lacking" text in the middle of their cells, horizontally and vertically?
Thanks in advance!
EDIT: I am not able to correctly format my code lines in this window. I am using Ctr-K and four spaces. How to do this correctly?
documentclass[9pt,a4paper,twosided]{article}
usepackage{longtable}
usepackage{graphicx}
begin{document}
begin{longtable}{|c|c|c|}
caption{My caption for figures in longtable}
label{figtab-1B}\%
hline
multicolumn{3}{c}{The table heading of the first page}\%
hline
endfirsthead
multicolumn{3}{c}{tablename thetable -- textit{Continued from last page}}\%
hline
multicolumn{3}{c}{The table heading for the next pages}\%
hline
endhead
hline hline
multicolumn{3}{c}{tablename thetable -- textit{To be continued on the next page}} \%
endfoot
hline
endlastfoot
includegraphics[width=0.33textwidth]{./figures/1B_-_Alkalitet_til_pH_4_comma_5.jpg}&
figure lacking&
includegraphics[width=0.33textwidth]{./figures/1B_-_Ammonium_(NH4-N).jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Arsen_(As)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Bly_(Pb)_comma_oppsluttet_ICP-MS.jpg}&
figure lacking\
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Kadmium_(Cd)_comma_oppsluttet_ICP-MS.jpg}&
figure lacking&
includegraphics[width=0.33textwidth]{./figures/1B_-_Kobber_(Cu)_comma_oppsluttet_ICP-MS.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Krom_(Cr)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Krysen_slash_Trifenylen.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Naftalen.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Nikkel_(Ni)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Pyren.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Sink_(Zn)_comma_oppsluttet_ICP-MS.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Suspendert_stoff.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Total_Fosfor.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Total_Nitrogen.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_- _Total_organisk_karbon_(TOC_slash_NPOC).jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Turbiditet.jpg}\%
end{longtable}
end{document}
longtable
I have a huge number of plots that I want to insert in longtable to make a figure table, possibly ranging several pages.
However I am not able to scale the figures inside each table cell in such a way that they do not overlap with horizontal and vertical lines in the table. If I simply reduce the width of each table cell, the cell and the figure are reduced the same factor and the figure still overlaps with the lines.
Can anybody help me with a code change that avoiding this overlap?
In addition, how do I place the "figure lacking" text in the middle of their cells, horizontally and vertically?
Thanks in advance!
EDIT: I am not able to correctly format my code lines in this window. I am using Ctr-K and four spaces. How to do this correctly?
documentclass[9pt,a4paper,twosided]{article}
usepackage{longtable}
usepackage{graphicx}
begin{document}
begin{longtable}{|c|c|c|}
caption{My caption for figures in longtable}
label{figtab-1B}\%
hline
multicolumn{3}{c}{The table heading of the first page}\%
hline
endfirsthead
multicolumn{3}{c}{tablename thetable -- textit{Continued from last page}}\%
hline
multicolumn{3}{c}{The table heading for the next pages}\%
hline
endhead
hline hline
multicolumn{3}{c}{tablename thetable -- textit{To be continued on the next page}} \%
endfoot
hline
endlastfoot
includegraphics[width=0.33textwidth]{./figures/1B_-_Alkalitet_til_pH_4_comma_5.jpg}&
figure lacking&
includegraphics[width=0.33textwidth]{./figures/1B_-_Ammonium_(NH4-N).jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Arsen_(As)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Bly_(Pb)_comma_oppsluttet_ICP-MS.jpg}&
figure lacking\
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Kadmium_(Cd)_comma_oppsluttet_ICP-MS.jpg}&
figure lacking&
includegraphics[width=0.33textwidth]{./figures/1B_-_Kobber_(Cu)_comma_oppsluttet_ICP-MS.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Krom_(Cr)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Krysen_slash_Trifenylen.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Naftalen.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Nikkel_(Ni)_comma_oppsluttet_ICP-MS.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Pyren.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Sink_(Zn)_comma_oppsluttet_ICP-MS.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_-_Suspendert_stoff.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Total_Fosfor.jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Total_Nitrogen.jpg}\%
hline
includegraphics[width=0.33textwidth]{./figures/1B_- _Total_organisk_karbon_(TOC_slash_NPOC).jpg}&
includegraphics[width=0.33textwidth]{./figures/1B_-_Turbiditet.jpg}\%
end{longtable}
end{document}
longtable
longtable
edited Dec 5 at 20:33
Zarko
119k865155
119k865155
asked Dec 5 at 20:19
myotis
4631314
4631314
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
documentclass[9pt,a4paper,twosided]{article}
usepackage{longtable}
usepackage[demo,
export]{adjustbox}
usepackage{etoolbox}
%-------------------------------------- only for show page layout
usepackage{showframe}
renewcommandShowFrameLinethickness{0.25pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%
begin{document}
begingroup
expandafterpatchcmdcsname Gin@iiendcsname % needed etoolbox
{setkeys{Gin}{#1}}%
{setkeys{Gin}%
{width=0.3linewidth,% % standard graphicx settings
valign=c, margin=0pt 3pt 0pt 3pt,#1}% % settings from adjustbox
}
{}{}
setlengthtabcolsep{5pt}
setlengthtabcolsep{3pt}
begin{longtable}{|c|c|c|}
caption{My caption for figures in longtable}
label{figtab-1B}\%
hline
multicolumn{3}{c}{The table heading of the first page}\%
hline
endfirsthead
multicolumn{3}{c}{tablename thetable -- textit{Continued from last page}}\%
hline
multicolumn{3}{c}{The table heading for the next pages}\%
hline
endhead
hline hline
multicolumn{3}{c}{tablename thetable -- textit{To be continued on the next page}} \%
endfoot
hline
endlastfoot
includegraphics{./figures/1B_-_Alkalitet_til_pH_4_comma_5.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Ammonium_(NH4-N).jpg} \
hline
includegraphics{./figures/1B_-_Arsen_(As)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Bly_(Pb)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking \
hline
includegraphics{./figures/1B_-_Kadmium_(Cd)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Kobber_(Cu)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Krom_(Cr)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Krysen_slash_Trifenylen.jpg}
& includegraphics{./figures/1B_-_Naftalen.jpg} \
hline
includegraphics{./figures/1B_-_Nikkel_(Ni)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Pyren.jpg}
& includegraphics{./figures/1B_-_Sink_(Zn)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Suspendert_stoff.jpg}
& includegraphics{./figures/1B_-_Total_Fosfor.jpg}
& includegraphics{./figures/1B_-_Total_Nitrogen.jpg} \
hline
includegraphics{./figures/1B_- _Total_organisk_karbon_(TOC_slash_NPOC).jpg}
& includegraphics{./figures/1B_-_Turbiditet.jpg}
& \
end{longtable}
endgroup
end{document}
Thanks. This looks promissing. I tried to put a begin{center}...end{center} environment on the outside of the begingroup...endgroup environment, but the figure table would not center horizontally on the page. How can I make it center horizontally?
– myotis
Dec 5 at 21:25
longtable
is centered (by default) in text area.begingroup
,endgroup˙ in my mwe only limited
Gin˙ tolongtable
, in case of usebegin{center} ... end{center}
can be omitted. to my answer i will add lines which show page layout.
– Zarko
Dec 5 at 21:37
Thanks a lot! You saved my life just now :)
– myotis
Dec 6 at 12:58
add a comment |
up vote
0
down vote
Add this to your preamble:
usepackage{cellspace}
setlength{cellspacetoplimit}{3pt}
setlength{cellspacebottomlimit}{3pt}
and the first line of the longtable code with
begin{longtable}{|Sc|Sc|Sc|}
(if you load siunitx
replace Sc
with Cc
).
Thanks! but my MikTex does not find the cellspace.sty file for some reason
– myotis
Dec 6 at 12:56
Did you install it? It's not installed by default (do that with MiKTeX Package Manager).
– Bernard
Dec 6 at 15:44
Yes I installed it, by using your code.
– myotis
Dec 6 at 15:50
And the code removes the overlapping?
– Bernard
Dec 6 at 16:54
No, I still get this error message about not finding the cellspace.sty.
– myotis
Dec 6 at 17:15
|
show 4 more comments
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
documentclass[9pt,a4paper,twosided]{article}
usepackage{longtable}
usepackage[demo,
export]{adjustbox}
usepackage{etoolbox}
%-------------------------------------- only for show page layout
usepackage{showframe}
renewcommandShowFrameLinethickness{0.25pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%
begin{document}
begingroup
expandafterpatchcmdcsname Gin@iiendcsname % needed etoolbox
{setkeys{Gin}{#1}}%
{setkeys{Gin}%
{width=0.3linewidth,% % standard graphicx settings
valign=c, margin=0pt 3pt 0pt 3pt,#1}% % settings from adjustbox
}
{}{}
setlengthtabcolsep{5pt}
setlengthtabcolsep{3pt}
begin{longtable}{|c|c|c|}
caption{My caption for figures in longtable}
label{figtab-1B}\%
hline
multicolumn{3}{c}{The table heading of the first page}\%
hline
endfirsthead
multicolumn{3}{c}{tablename thetable -- textit{Continued from last page}}\%
hline
multicolumn{3}{c}{The table heading for the next pages}\%
hline
endhead
hline hline
multicolumn{3}{c}{tablename thetable -- textit{To be continued on the next page}} \%
endfoot
hline
endlastfoot
includegraphics{./figures/1B_-_Alkalitet_til_pH_4_comma_5.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Ammonium_(NH4-N).jpg} \
hline
includegraphics{./figures/1B_-_Arsen_(As)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Bly_(Pb)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking \
hline
includegraphics{./figures/1B_-_Kadmium_(Cd)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Kobber_(Cu)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Krom_(Cr)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Krysen_slash_Trifenylen.jpg}
& includegraphics{./figures/1B_-_Naftalen.jpg} \
hline
includegraphics{./figures/1B_-_Nikkel_(Ni)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Pyren.jpg}
& includegraphics{./figures/1B_-_Sink_(Zn)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Suspendert_stoff.jpg}
& includegraphics{./figures/1B_-_Total_Fosfor.jpg}
& includegraphics{./figures/1B_-_Total_Nitrogen.jpg} \
hline
includegraphics{./figures/1B_- _Total_organisk_karbon_(TOC_slash_NPOC).jpg}
& includegraphics{./figures/1B_-_Turbiditet.jpg}
& \
end{longtable}
endgroup
end{document}
Thanks. This looks promissing. I tried to put a begin{center}...end{center} environment on the outside of the begingroup...endgroup environment, but the figure table would not center horizontally on the page. How can I make it center horizontally?
– myotis
Dec 5 at 21:25
longtable
is centered (by default) in text area.begingroup
,endgroup˙ in my mwe only limited
Gin˙ tolongtable
, in case of usebegin{center} ... end{center}
can be omitted. to my answer i will add lines which show page layout.
– Zarko
Dec 5 at 21:37
Thanks a lot! You saved my life just now :)
– myotis
Dec 6 at 12:58
add a comment |
up vote
1
down vote
accepted
documentclass[9pt,a4paper,twosided]{article}
usepackage{longtable}
usepackage[demo,
export]{adjustbox}
usepackage{etoolbox}
%-------------------------------------- only for show page layout
usepackage{showframe}
renewcommandShowFrameLinethickness{0.25pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%
begin{document}
begingroup
expandafterpatchcmdcsname Gin@iiendcsname % needed etoolbox
{setkeys{Gin}{#1}}%
{setkeys{Gin}%
{width=0.3linewidth,% % standard graphicx settings
valign=c, margin=0pt 3pt 0pt 3pt,#1}% % settings from adjustbox
}
{}{}
setlengthtabcolsep{5pt}
setlengthtabcolsep{3pt}
begin{longtable}{|c|c|c|}
caption{My caption for figures in longtable}
label{figtab-1B}\%
hline
multicolumn{3}{c}{The table heading of the first page}\%
hline
endfirsthead
multicolumn{3}{c}{tablename thetable -- textit{Continued from last page}}\%
hline
multicolumn{3}{c}{The table heading for the next pages}\%
hline
endhead
hline hline
multicolumn{3}{c}{tablename thetable -- textit{To be continued on the next page}} \%
endfoot
hline
endlastfoot
includegraphics{./figures/1B_-_Alkalitet_til_pH_4_comma_5.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Ammonium_(NH4-N).jpg} \
hline
includegraphics{./figures/1B_-_Arsen_(As)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Bly_(Pb)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking \
hline
includegraphics{./figures/1B_-_Kadmium_(Cd)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Kobber_(Cu)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Krom_(Cr)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Krysen_slash_Trifenylen.jpg}
& includegraphics{./figures/1B_-_Naftalen.jpg} \
hline
includegraphics{./figures/1B_-_Nikkel_(Ni)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Pyren.jpg}
& includegraphics{./figures/1B_-_Sink_(Zn)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Suspendert_stoff.jpg}
& includegraphics{./figures/1B_-_Total_Fosfor.jpg}
& includegraphics{./figures/1B_-_Total_Nitrogen.jpg} \
hline
includegraphics{./figures/1B_- _Total_organisk_karbon_(TOC_slash_NPOC).jpg}
& includegraphics{./figures/1B_-_Turbiditet.jpg}
& \
end{longtable}
endgroup
end{document}
Thanks. This looks promissing. I tried to put a begin{center}...end{center} environment on the outside of the begingroup...endgroup environment, but the figure table would not center horizontally on the page. How can I make it center horizontally?
– myotis
Dec 5 at 21:25
longtable
is centered (by default) in text area.begingroup
,endgroup˙ in my mwe only limited
Gin˙ tolongtable
, in case of usebegin{center} ... end{center}
can be omitted. to my answer i will add lines which show page layout.
– Zarko
Dec 5 at 21:37
Thanks a lot! You saved my life just now :)
– myotis
Dec 6 at 12:58
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
documentclass[9pt,a4paper,twosided]{article}
usepackage{longtable}
usepackage[demo,
export]{adjustbox}
usepackage{etoolbox}
%-------------------------------------- only for show page layout
usepackage{showframe}
renewcommandShowFrameLinethickness{0.25pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%
begin{document}
begingroup
expandafterpatchcmdcsname Gin@iiendcsname % needed etoolbox
{setkeys{Gin}{#1}}%
{setkeys{Gin}%
{width=0.3linewidth,% % standard graphicx settings
valign=c, margin=0pt 3pt 0pt 3pt,#1}% % settings from adjustbox
}
{}{}
setlengthtabcolsep{5pt}
setlengthtabcolsep{3pt}
begin{longtable}{|c|c|c|}
caption{My caption for figures in longtable}
label{figtab-1B}\%
hline
multicolumn{3}{c}{The table heading of the first page}\%
hline
endfirsthead
multicolumn{3}{c}{tablename thetable -- textit{Continued from last page}}\%
hline
multicolumn{3}{c}{The table heading for the next pages}\%
hline
endhead
hline hline
multicolumn{3}{c}{tablename thetable -- textit{To be continued on the next page}} \%
endfoot
hline
endlastfoot
includegraphics{./figures/1B_-_Alkalitet_til_pH_4_comma_5.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Ammonium_(NH4-N).jpg} \
hline
includegraphics{./figures/1B_-_Arsen_(As)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Bly_(Pb)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking \
hline
includegraphics{./figures/1B_-_Kadmium_(Cd)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Kobber_(Cu)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Krom_(Cr)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Krysen_slash_Trifenylen.jpg}
& includegraphics{./figures/1B_-_Naftalen.jpg} \
hline
includegraphics{./figures/1B_-_Nikkel_(Ni)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Pyren.jpg}
& includegraphics{./figures/1B_-_Sink_(Zn)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Suspendert_stoff.jpg}
& includegraphics{./figures/1B_-_Total_Fosfor.jpg}
& includegraphics{./figures/1B_-_Total_Nitrogen.jpg} \
hline
includegraphics{./figures/1B_- _Total_organisk_karbon_(TOC_slash_NPOC).jpg}
& includegraphics{./figures/1B_-_Turbiditet.jpg}
& \
end{longtable}
endgroup
end{document}
documentclass[9pt,a4paper,twosided]{article}
usepackage{longtable}
usepackage[demo,
export]{adjustbox}
usepackage{etoolbox}
%-------------------------------------- only for show page layout
usepackage{showframe}
renewcommandShowFrameLinethickness{0.25pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%
begin{document}
begingroup
expandafterpatchcmdcsname Gin@iiendcsname % needed etoolbox
{setkeys{Gin}{#1}}%
{setkeys{Gin}%
{width=0.3linewidth,% % standard graphicx settings
valign=c, margin=0pt 3pt 0pt 3pt,#1}% % settings from adjustbox
}
{}{}
setlengthtabcolsep{5pt}
setlengthtabcolsep{3pt}
begin{longtable}{|c|c|c|}
caption{My caption for figures in longtable}
label{figtab-1B}\%
hline
multicolumn{3}{c}{The table heading of the first page}\%
hline
endfirsthead
multicolumn{3}{c}{tablename thetable -- textit{Continued from last page}}\%
hline
multicolumn{3}{c}{The table heading for the next pages}\%
hline
endhead
hline hline
multicolumn{3}{c}{tablename thetable -- textit{To be continued on the next page}} \%
endfoot
hline
endlastfoot
includegraphics{./figures/1B_-_Alkalitet_til_pH_4_comma_5.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Ammonium_(NH4-N).jpg} \
hline
includegraphics{./figures/1B_-_Arsen_(As)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Bly_(Pb)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking \
hline
includegraphics{./figures/1B_-_Kadmium_(Cd)_comma_oppsluttet_ICP-MS.jpg}
& figure lacking
& includegraphics{./figures/1B_-_Kobber_(Cu)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Krom_(Cr)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Krysen_slash_Trifenylen.jpg}
& includegraphics{./figures/1B_-_Naftalen.jpg} \
hline
includegraphics{./figures/1B_-_Nikkel_(Ni)_comma_oppsluttet_ICP-MS.jpg}
& includegraphics{./figures/1B_-_Pyren.jpg}
& includegraphics{./figures/1B_-_Sink_(Zn)_comma_oppsluttet_ICP-MS.jpg} \
hline
includegraphics{./figures/1B_-_Suspendert_stoff.jpg}
& includegraphics{./figures/1B_-_Total_Fosfor.jpg}
& includegraphics{./figures/1B_-_Total_Nitrogen.jpg} \
hline
includegraphics{./figures/1B_- _Total_organisk_karbon_(TOC_slash_NPOC).jpg}
& includegraphics{./figures/1B_-_Turbiditet.jpg}
& \
end{longtable}
endgroup
end{document}
edited Dec 5 at 22:22
answered Dec 5 at 20:48
Zarko
119k865155
119k865155
Thanks. This looks promissing. I tried to put a begin{center}...end{center} environment on the outside of the begingroup...endgroup environment, but the figure table would not center horizontally on the page. How can I make it center horizontally?
– myotis
Dec 5 at 21:25
longtable
is centered (by default) in text area.begingroup
,endgroup˙ in my mwe only limited
Gin˙ tolongtable
, in case of usebegin{center} ... end{center}
can be omitted. to my answer i will add lines which show page layout.
– Zarko
Dec 5 at 21:37
Thanks a lot! You saved my life just now :)
– myotis
Dec 6 at 12:58
add a comment |
Thanks. This looks promissing. I tried to put a begin{center}...end{center} environment on the outside of the begingroup...endgroup environment, but the figure table would not center horizontally on the page. How can I make it center horizontally?
– myotis
Dec 5 at 21:25
longtable
is centered (by default) in text area.begingroup
,endgroup˙ in my mwe only limited
Gin˙ tolongtable
, in case of usebegin{center} ... end{center}
can be omitted. to my answer i will add lines which show page layout.
– Zarko
Dec 5 at 21:37
Thanks a lot! You saved my life just now :)
– myotis
Dec 6 at 12:58
Thanks. This looks promissing. I tried to put a begin{center}...end{center} environment on the outside of the begingroup...endgroup environment, but the figure table would not center horizontally on the page. How can I make it center horizontally?
– myotis
Dec 5 at 21:25
Thanks. This looks promissing. I tried to put a begin{center}...end{center} environment on the outside of the begingroup...endgroup environment, but the figure table would not center horizontally on the page. How can I make it center horizontally?
– myotis
Dec 5 at 21:25
longtable
is centered (by default) in text area.begingroup
, endgroup˙ in my mwe only limited
Gin˙ to longtable
, in case of use begin{center} ... end{center}
can be omitted. to my answer i will add lines which show page layout.– Zarko
Dec 5 at 21:37
longtable
is centered (by default) in text area.begingroup
, endgroup˙ in my mwe only limited
Gin˙ to longtable
, in case of use begin{center} ... end{center}
can be omitted. to my answer i will add lines which show page layout.– Zarko
Dec 5 at 21:37
Thanks a lot! You saved my life just now :)
– myotis
Dec 6 at 12:58
Thanks a lot! You saved my life just now :)
– myotis
Dec 6 at 12:58
add a comment |
up vote
0
down vote
Add this to your preamble:
usepackage{cellspace}
setlength{cellspacetoplimit}{3pt}
setlength{cellspacebottomlimit}{3pt}
and the first line of the longtable code with
begin{longtable}{|Sc|Sc|Sc|}
(if you load siunitx
replace Sc
with Cc
).
Thanks! but my MikTex does not find the cellspace.sty file for some reason
– myotis
Dec 6 at 12:56
Did you install it? It's not installed by default (do that with MiKTeX Package Manager).
– Bernard
Dec 6 at 15:44
Yes I installed it, by using your code.
– myotis
Dec 6 at 15:50
And the code removes the overlapping?
– Bernard
Dec 6 at 16:54
No, I still get this error message about not finding the cellspace.sty.
– myotis
Dec 6 at 17:15
|
show 4 more comments
up vote
0
down vote
Add this to your preamble:
usepackage{cellspace}
setlength{cellspacetoplimit}{3pt}
setlength{cellspacebottomlimit}{3pt}
and the first line of the longtable code with
begin{longtable}{|Sc|Sc|Sc|}
(if you load siunitx
replace Sc
with Cc
).
Thanks! but my MikTex does not find the cellspace.sty file for some reason
– myotis
Dec 6 at 12:56
Did you install it? It's not installed by default (do that with MiKTeX Package Manager).
– Bernard
Dec 6 at 15:44
Yes I installed it, by using your code.
– myotis
Dec 6 at 15:50
And the code removes the overlapping?
– Bernard
Dec 6 at 16:54
No, I still get this error message about not finding the cellspace.sty.
– myotis
Dec 6 at 17:15
|
show 4 more comments
up vote
0
down vote
up vote
0
down vote
Add this to your preamble:
usepackage{cellspace}
setlength{cellspacetoplimit}{3pt}
setlength{cellspacebottomlimit}{3pt}
and the first line of the longtable code with
begin{longtable}{|Sc|Sc|Sc|}
(if you load siunitx
replace Sc
with Cc
).
Add this to your preamble:
usepackage{cellspace}
setlength{cellspacetoplimit}{3pt}
setlength{cellspacebottomlimit}{3pt}
and the first line of the longtable code with
begin{longtable}{|Sc|Sc|Sc|}
(if you load siunitx
replace Sc
with Cc
).
answered Dec 5 at 20:46
Bernard
164k769192
164k769192
Thanks! but my MikTex does not find the cellspace.sty file for some reason
– myotis
Dec 6 at 12:56
Did you install it? It's not installed by default (do that with MiKTeX Package Manager).
– Bernard
Dec 6 at 15:44
Yes I installed it, by using your code.
– myotis
Dec 6 at 15:50
And the code removes the overlapping?
– Bernard
Dec 6 at 16:54
No, I still get this error message about not finding the cellspace.sty.
– myotis
Dec 6 at 17:15
|
show 4 more comments
Thanks! but my MikTex does not find the cellspace.sty file for some reason
– myotis
Dec 6 at 12:56
Did you install it? It's not installed by default (do that with MiKTeX Package Manager).
– Bernard
Dec 6 at 15:44
Yes I installed it, by using your code.
– myotis
Dec 6 at 15:50
And the code removes the overlapping?
– Bernard
Dec 6 at 16:54
No, I still get this error message about not finding the cellspace.sty.
– myotis
Dec 6 at 17:15
Thanks! but my MikTex does not find the cellspace.sty file for some reason
– myotis
Dec 6 at 12:56
Thanks! but my MikTex does not find the cellspace.sty file for some reason
– myotis
Dec 6 at 12:56
Did you install it? It's not installed by default (do that with MiKTeX Package Manager).
– Bernard
Dec 6 at 15:44
Did you install it? It's not installed by default (do that with MiKTeX Package Manager).
– Bernard
Dec 6 at 15:44
Yes I installed it, by using your code.
– myotis
Dec 6 at 15:50
Yes I installed it, by using your code.
– myotis
Dec 6 at 15:50
And the code removes the overlapping?
– Bernard
Dec 6 at 16:54
And the code removes the overlapping?
– Bernard
Dec 6 at 16:54
No, I still get this error message about not finding the cellspace.sty.
– myotis
Dec 6 at 17:15
No, I still get this error message about not finding the cellspace.sty.
– myotis
Dec 6 at 17:15
|
show 4 more comments
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%2f463383%2fusing-longtable-for-figures-the-figures-overlap-with-horizontal-and-vertical-li%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