[Tex/LaTex] Align three figures, Left, Centering, Right with appropriate Captions and Labels

graphicsinclude

I am learning how to use Latex and currently I am trying to get an understanding of how to place 3 figures all in one line across the page.

Here is my efforts which has sent one figure to the next page and seems to repeat the caption.

% Sample file: math.tex
\documentclass{sample}
\usepackage{xcolor}
\usepackage{setspace}
\usepackage[margin=.7in]{geometry}
\usepackage{parskip}
\setlength{\parindent}{15pt}
\leftskip 0.1in
\parindent -0.1in
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{enumerate}
\usepackage{verbatim}
\usepackage{fancyvrb}
\usepackage[bottom]{footmisc}
\VerbatimFootnotes

\begin{document}

\begin{figure}[h!]
\centering\includegraphics[scale=.5]{Rachel&Bob}
\caption{Rachel and Bob's basis vectors}\label{Fi:001}
\end{figure}
\begin{figure}[h!]
\includegraphics{Poincare disk model.pdf}
\end{figure}

\end{document}

I got the centering to work on the first figure and the Caption and Label were just fine.

The second figure was sent to the next page and I removed the Caption and Label in order to understand why I had:

"disk.model.pdf"

to the left of the fig which has been placed about two inches to the left of the left hand margin.

Removing both the Caption and Label has had no impact on the text I refer to in the last paragraph.

Any suggestions or pointers where I can research some more on placement of figures.

Best Answer

To keep the images and associated captions together, it's best to place the \includegraphics-\caption-\label triplets inside separate minipage environments. For three side-by-side images, I suggest you allocate a width of 0.3\textwidth to each minipage. That way, 0.05\textwidth can be set aside as whitespace between each pair of images. (0.3+0.05+0.3+0.05+0.3=?.)

enter image description here

\documentclass{article} % not 'sample'
\usepackage{xcolor}
\usepackage{setspace}
\usepackage[margin=.7in]{geometry}
\usepackage{parskip}
%\setlength{\parindent}{15pt}
%\leftskip 0.1in
%\parindent -0.1in
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\usepackage{mathtools}
\usepackage{enumerate}
%\usepackage{verbatim}
\usepackage{fancyvrb}
\VerbatimFootnotes
\usepackage[bottom]{footmisc}

\begin{document}
\hrule % just to illustrate width of text block

\begin{figure}[h!]

\begin{minipage}[t]{0.3\textwidth}
\includegraphics[width=\linewidth]{Rachel&Bob}
\caption{Rachel's and Bob's basis vectors} \label{Fi:001}
\end{minipage}
\hfill
\begin{minipage}[t]{0.3\textwidth}
\includegraphics[width=\linewidth]{Poincar\'eDiskModel}
\caption{Poincar\'e disk model} \label{poincare_disk}
\end{minipage}
\hfill
\begin{minipage}[t]{0.3\textwidth}
\includegraphics[width=\linewidth]{SomeOtherImage}
\caption{Some other image} \label{other}
\end{minipage}

\end{figure}

\end{document}