5 Figures arranged in 3 rows x 2 columns
It's much simpler:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htp]
\centering
\includegraphics[width=.3\textwidth]{example-image-b}\quad
\includegraphics[width=.3\textwidth]{example-image-b}\quad
\includegraphics[width=.3\textwidth]{example-image-b}
\medskip
\includegraphics[width=.3\textwidth]{example-image-b}\quad
\includegraphics[width=.3\textwidth]{example-image-b}
\caption{Figure caption}
\label{pics:blablabla}
\end{figure}
\end{document}
About your code. First of all, you probably don't have 150mm available, plus the intercolumn space. By using .3\textwidth
we know that we'll occupy 9/10 of the allotted width.
Second. Instead of $\begin{array}...\end{array}$
you could use tabular
: same syntax, but goes in text mode (and can even go in math mode). But two tabulars are not what's needed: just center the two rows and you're done, just remember to leave some space (here a \quad
) between two images. A vertical space between the rows, et voilà. ;-)
If you want to use subcaptions to distinguish between the figures, you can use the following code:
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{float}
\begin{document}
\begin{figure} [H]
\centering
\begin{tabular}{cccc}
\includegraphics[width=0.3\textwidth]{example-image-a} &
\includegraphics[width=0.3\textwidth]{example-image-b} &
\includegraphics[width=0.3\textwidth]{example-image-c} \\
\textbf{(a)} & \textbf{(b)} & \textbf{(c)} \\[6pt]
\end{tabular}
\begin{tabular}{cccc}
\includegraphics[width=0.3\textwidth]{example-image-a} &
\includegraphics[width=0.3\textwidth]{example-image-b} \\
\textbf{(d)} & \textbf{(e)} \\[6pt]
\end{tabular}
\caption{ \textbf{(a)} Some text
\textbf{(b)} Some text
\textbf{(c)} Some text
\textbf{(d)} Some text
\textbf{(e)} Some text}
\label{fig:Name}
\end{figure}
\end{document}
The code you provided does indeed center them as you desire. Its just that the page is not wide enough. If I add \usepackage[paperwidth=25.0cm,showframe]{geometry}
then you get:
Furthermore, you don't need to use the array
environment as you don't have math content, simple tabular
will suffice. Also, you should use \centering
instead of the center
environment as per When should we use \begin{center} instead of \centering?.
Notes:
- The
[showframe]
option was applied to thegeometry
package was just to show the page margins. - The
@{}
at the start and end of thetabular
columns eliminates the column padding that is added at the start and end of the table. - The
tabular
solution is useful if you want the figures horizontally aligned. If you don't need to align the figures (ie., you just want them distributed horizontally), the Werner's or egreg's solution is the way to go.
Code:
\documentclass{article}
\usepackage{graphicx}
\usepackage[paperwidth=25.0cm,showframe]{geometry}
\begin{document}
\begin{figure}[h]
\begin{center}$
\begin{array}{lll}
\includegraphics[width=50mm]{example-image-b}&
\includegraphics[width=50mm]{example-image-b}&
\includegraphics[width=50mm]{example-image-b}
\end{array}$
\end{center}
\begin{center}$
\begin{array}{rr}
\includegraphics[width=50mm]{example-image-b}&
\includegraphics[width=50mm]{example-image-b}
\end{array}$
\end{center}
\caption{Figure caption}
\label{pics:blablabla}
\end{figure}
\end{document}
Code: \centering
\documentclass{article}
\usepackage{graphicx}
\usepackage[paperwidth=25.0cm,showframe]{geometry}
\begin{document}
\begin{figure}[h]
{\centering%
\begin{tabular}{@{}lll@{}}
\includegraphics[width=50mm]{example-image-b}&
\includegraphics[width=50mm]{example-image-b}&
\includegraphics[width=50mm]{example-image-b}
\end{tabular}\par}
{\centering%
\begin{tabular}{@{}rr@{}}
\includegraphics[width=50mm]{example-image-b}&
\includegraphics[width=50mm]{example-image-b}
\end{tabular}
\caption{Figure caption}
\label{pics:blablabla}\par}
\end{figure}
\end{document}