0

I have three equally sized pdf charts and I want to fit them side by side, in columns on one A4 page. I tried the code below, but the charts were not side by side but under each other.

\documentclass[10pt,a4paper]{extarticle}

\usepackage[pdftex]{graphicx}
\usepackage[export]{adjustbox}
\begin{document}

\begin{figure}
\includegraphics[width=.2\textwidth,scale=0.8,center]{a.pdf}
\includegraphics[width=.2\textwidth,scale=0.8,left]{a.pdf}
\includegraphics[width=.2\textwidth,scale=0.8,right]{a.pdf}
\end{figure}

\end{document}

I would be grateful for your help.

1
  • 1
    You cannot set up both width and scale, the contradict each other. If you remove the scales, you will get it working.
    – yo'
    Commented Nov 3, 2015 at 13:24

2 Answers 2

1

The keys width and scale are contradictory, and the latter is chosen. Specifying width only, it behaves as desired. Note the added % to get rid of the interword space between the graphics. Also note that specifying the engine to graphicx is not necessary.

\documentclass[10pt,a4paper]{extarticle}

\usepackage{graphicx}

\begin{document}

\begin{figure}
  \includegraphics[width=.2\textwidth]{a.pdf}%
  \includegraphics[width=.2\textwidth]{a.pdf}%
  \includegraphics[width=.2\textwidth]{a.pdf}
\end{figure}

\end{document}
0

You can use \resizebox{width}{height}{object} as it follows:

\documentclass[10pt,a4paper]{extarticle}

\usepackage{graphicx}

\begin{document}

\begin{figure}
 \resizebox{\textwidth}{!}{%
 \includegraphics{a.pdf}%
 \includegraphics{a.pdf}%
 \includegraphics{a.pdf}}
 \end{figure}

\end{document}

The ! is used to keep the aspect ratio.

Put \quad or \qquad or \hspace{} at the end of the first and the second \includegraphics if you need more space between your charts.

If you want that your figure fills the line, but dimensions of pictures are too large, add scale or width as option in \includegraphics.

You must log in to answer this question.

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