2

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.

3
  • Welcome to TeX.SE. Where might one obtain the sample document class from? Please advise.
    – Mico
    Feb 25, 2016 at 20:14
  • OOPS ... I have it on my computer and it is really just the tutorial provided by Latex and I have worked through it and now I have begun to experiment by trying to insert figures. Should I make a gist and place it on github? It is not very interesting. Feb 25, 2016 at 20:19
  • Would it be OK to use the article document class?
    – Mico
    Feb 25, 2016 at 20:20

1 Answer 1

1

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}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .