1

I use amcs template. I would like to align 4 figures to same size so the first two will be in same row. However, there is a slight change in the starting position and sizes as well as caption locations. How can I fix it? enter image description here

This is my code:

\usepackage{booktabs,makecell,tabularx}
\renewcommand\theadfont{\small}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{siunitx}
%\documentclass{article}
\usepackage{adjustbox}
\usepackage{array,booktabs}

\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}


\newcommand{\tvar}[2]{%
    \mathrm{#1}_{\mathrm{#2}}%
}

\documentclass{amcs}
\begin{document}
\begin{figure}
    \includegraphics [scale=0.6]{Figure5Graph1.png}
    \caption{DS1: PKsd saklsajlslak lska dfkjlsdkfj fdgdffjdsl lkllk sdfsfdfs dsgsd}
    \label{fig:DS1}
 \end{figure}

 \begin{figure}
    \includegraphics [scale=0.6]{Figure6Graph2.png}
    \caption{DS2: Ksd saklsajlslak lska dfkjlsdkfj fdgdffjdsl lkllk sdfsfdfs dsgsd}
    \label{fig:DS2}
\end{figure}

 \begin{figure}
    \includegraphics [scale=0.6]{Figure7Graph3.png}
    \caption{DS3: Ksd saklsajlslak lska dfkjlsdkfj fdgdffjdsl lkllk sdfsfdfs dsgsd}
    \label{fig:DS3}
\end{figure}

\begin{figure}
    \includegraphics [scale=0.6]{Figure8Graph4.png}
    \caption{DS4: Ksd saklsajlslak lska dfkjlsdkfj fdgdffjdsl lkllk}
    \label{fig:DS4}
\end{figure}
\begin{document}
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – ebosi Nov 7 '16 at 11:28
  • 1
    You could use the subfig package – DRi Nov 7 '16 at 11:33
  • Thanks @DRi, can you please elaborate, what do I have to change in my code? – Avi Nov 7 '16 at 11:35
  • Add \usepackage{subfig}in your preamble and read the package notice to know how tio use it. – DRi Nov 7 '16 at 11:37
  • If you want to be sure, all the images are the same size, it is saver not to use scale=0.6 but to specify the with width e.g. width=.45\textwidth – user36296 Nov 7 '16 at 12:00
3

Add \usepackage{subfig} in your preamble and in your text, use something like:

\begin{figure}[htbp]
\centering
\subfloat[subtitle of subfigure a]{\label{fig:a}\includegraphics[width=0.45\linewidth]{figures/subfig_a}}\qquad
\subfloat[subtitle of subfigure b]{\label{fig:b}\includegraphics[width=0.45\linewidth]{figures/subfig_b}}\\
\subfloat[subtitle of subfigure c]{\label{fig:c}\includegraphics[width=0.45\textwidth]{figures/subfig_c}}\qquad%
\subfloat[subtitle of subfigure d]{\label{fig:d}\includegraphics[width=0.45\textwidth]{figures/subfig_d}}%
\caption{My beautiful multifigure ((a) subfig a; (b) subfig b; (c) subfig c; (d) subfig d)}
\label{fig:myfig}
\end{figure}
  • My figure are in png format when I write the code, I get the following error: Package pdftex.def Error: File `figures/Figure7Graph3.png' not found. ....6\textwidth]{figures/Figure7Graph3.png}} – Avi Nov 7 '16 at 12:36
  • You don't need to explicit the extension of your figures. – DRi Nov 7 '16 at 12:37
  • I omitted the extensions and still get the following error: File `figures/Figure7Graph3' not found. ...th=0.6\textwidth]{figures/Figure7Graph3}} – Avi Nov 7 '16 at 12:38
  • Do you compile with LaTeX or with pdfLaTeX, I suspect the former which uses .ps or .eps file while the later uses .png,.pdf. Did you include \usepackage{graphicx} in your preamble ? – DRi Nov 7 '16 at 12:41
  • Of course when I wrote \includegraphics[width=0.45\linewidth]{figures/subfig_a} this meant that the figures are in a folder named figures. If this is not the case, if they are in the same folder as the .tex file, the you should use \includegraphics[width=0.45\linewidth]{subfig_a} and so on. – DRi Nov 7 '16 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.