TeX - LaTeX Asked by SHAONI NANDI on December 14, 2020
I am trying to put two figures side by side using minipage. But the figures are shrinking and not using the full page width. How to get figures that use the full page width?
begin{figure}[h]
begin{minipage}{0.5textwidth}
includegraphics[width=columnwidth]{P1.jpg}
end{minipage}
begin{minipage}{0.5textwidth}
includegraphics[width=columnwidth]{P2.jpg}
end{minipage}
end{figure}
There is no need to use minipage
.
documentclass{article}
usepackage{graphicx}
usepackage{showframe,lipsum} % just for the example
begin{document}
lipsum[1][1-3]
begin{figure}[htp]
includegraphics[width=0.49textwidth]{example-image-a}hfill
includegraphics[width=0.49textwidth]{example-image-b}
caption{Two side by side figures filling the space, with some separation}
end{figure}
lipsum[1][4-5]
begin{figure}[htp]
includegraphics[width=0.5textwidth]{example-image-a}%
includegraphics[width=0.5textwidth]{example-image-b}
caption{Two side by side figures filling the space, with no separation}
end{figure}
lipsum[1][6-7]
end{document}
Answered by egreg on December 14, 2020
Using max textwidth with minor space between the figures
begin{figure}[h]
begin{minipage}{0.5textwidth}
includegraphics[width=textwidth]{image-b}
end{minipage}
begin{minipage}{0.5textwidth}
includegraphics[width=textwidth]{image-a}
end{minipage}%
end{figure}
If no space required between the figures put a %
after the first minipage
begin{figure}[h]
begin{minipage}{0.5textwidth}
includegraphics[width=textwidth]{image-b}
end{minipage}%
begin{minipage}{0.5textwidth}
includegraphics[width=textwidth]{image-a}
end{minipage}%
end{figure}
edit --to prevent protruding image in to margin--with respect to suggestion by @mico
begin{figure}[h]
begin{minipage}{0.4975textwidth}
includegraphics[width=textwidth]{image-b}
end{minipage}hfill
begin{minipage}{0.4975textwidth}
includegraphics[width=textwidth]{image-a}
end{minipage}%
end{figure}
Answered by js bibra on December 14, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP