How can I fix this mess showed in the picture added below?

enter image description here

I mean, I'd like to place side by side both figures, with the box at the same level and the captions at the same level too.

Here is the code used (all the packages needed are used, no need to put them here). Caption only contains a brief description because the other lines at the bottom are additional explanations and shouldn't be part of the caption as the caption itself appears in the list of "figures" at the beginning of the thesis.

\caption{Importe de las pensiones vs. n\'umero de afiliados y variaci\'on}.
\textit{\small{*Datos de 2017 hasta marzo.}}%\\
\small{(Fuente: Elaboraci\'on propia a partir de datos del Min. de Empleo y S.S.)}
\caption{Evoluci\'on del gasto en pensiones. Datos en millones de euros y \% total del presupuesto del Estado}%\\
\small{(Fuente:} \texttt{\footnotesize{Min. de Empleo y S. S.)}}
[![enter image description here][1]][1]\end{minipage}

I was thinking to scale the pictures width and height scaling but not sure.

Thanks for your support!

  • 1
    \fbox{\includegraphics[scale=0.2]{Cap1/afiliados.png}} is bigger than the space you are putting it in, usually it's better to use width than scale: \fbox{\includegraphics[width=.9\linewidth]{Cap1/afiliados.png}} will make it 90% the width of your minipage – David Carlisle Jul 31 '17 at 10:53
  • Could you post the graphic files or a link to them, so we can test? – Bernard Jul 31 '17 at 11:30

Just specify a height in the \includegraphics commands instead of giving a scale factor. Give the same height for the two pictures, and add a vertical alignment parameter to the minipages. Moreover, I think using several captions within a single figure environment is not a good idea. Give the subfigure or subcaption packages a try. Subfigures can be aligned in pretty much the same way as minipages and stuff: [t] seems to work. Here is an example document:





        \includegraphics[totalheight = \tempheight]{pic1}
        \caption{First picture.}
        \includegraphics[totalheight = \tempheight]{pic2}
        \caption{Second picture with a longer caption that will need more lines than the one from the first picture.}


I used LaTeX figures side by side as a starting point. Of course, you might have to adjust \tempheight's value, since I used random pictures of stuffed animals instead of your charts.

Please also note that the syntax for \small etc. is not \small{…}: these are switches that “turn a font ON” (somewhat) until the end of the scope. So usually it's more like {\small …}. The following example should show you the difference:

{a \small{b} c}\par
{a {\small b} c}

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.