# \includegraphics side-by-side and filling text-width

Instead of the figure environment I am trying to use the \includegraphics command to add pictures to an appendix.

\begin{center}
\includegraphics[scale=\linewidth]{../pics/results_t/props_T_i_a}
\end{center}


Idea from here for adding a picture without the float feature.

Two questions:

1. How do I add two images side-by-side? This is something I would usually do with subfigure inside the figure environment.

2. Instead of setting the scaling to a set number, I would like to set the text line width as is the usual method for figures. the \linewidth and \textwidth commands as shown in the code give errors, so how can I use them properly?

• scale want a numeric value, i.e. i relative number, not an absolute number. And simply put two includegraphics-commands within the center invironment. – Johannes_B Jun 17 '15 at 11:06
• Don't use scale, use Width=0.5\linewidth for each image and make sure there is no space between the two images. You can still use the figure environment, even if you omit the caption and reference. – musarithmia Jun 17 '15 at 11:07

An appendix often consists of many many figures, or only figures. Having them float around will do no good. Hence, put the graphics inside the text directly.

\documentclass{article}
\usepackage{mwe}
\usepackage{showframe}
\begin{document}
\begin{center}
\includegraphics[width=.5\textwidth]{example-image-a}%
\includegraphics[width=.5\textwidth]{example-image-b}%
\end{center}
\end{document}


You can also define a new environment, possibly together with package capt-of.

\documentclass{article}
\usepackage{mwe}
\usepackage{showframe}
\usepackage{capt-of}
}{%
}
\begin{document}
\begin{appendixfig}
\includegraphics[width=.5\textwidth]{example-image-a}%
\includegraphics[width=.5\textwidth]{example-image-b}%
\end{appendixfig}
\begin{appendixfig}
\includegraphics[width=.5\textwidth]{example-image-a}%
\includegraphics[width=.5\textwidth]{example-image-b}%
\captionof{figure}{Two nice figures}
\end{appendixfig}
\end{document}

• Thank you very much for the lower example. Made my result much better. Can a centering be put on the appendixfig environments so small pictures would be centered? – Steeven Jun 17 '15 at 12:31
• @Steeven Yeah, sure \begin{minipage}{\linewidth}\centering – Johannes_B Jun 17 '15 at 12:33