1

I am using a latex template from my university, and it breaks if I try to import any of the subfigures packages like subcaption, minipage, subfigure or subfig, so I have to manage as I can.

For example, if I have the following:

\begin{figure}[tb]
    (a) \hfil (b) \hfil (c)\\
    
    \includegraphics[width=0.14\linewidth]{figs/repressionA.png} \hfil
    \includegraphics[width=0.22\linewidth]{figs/repressionC.png} \hfil 
    \includegraphics[width=0.15\linewidth]{figs/repressionD.png}\\
    
    \caption[Model Abstractions]{Model abstractions permited when sensor proteins are available in abundance. (a) Schematic showing a sensor protein that represses a sensor promoter. (b) A small molecule (input) that represses the sensor protein. (c) Model abstraction where the small molecule can be considered to activate the sensor promoter.}
    \figlabel{Sensor Molecules}
\end{figure}

This will produce the following: enter image description here

As you can see, everything is not aligned correctly, horizontally AND vertically. Any useful commands I can use to make this a little prettier?

5
  • If it is such a picky template breaks even with a minipage, there is no there is no guarantee that another solution will work as it should. Without knowing what template is, the only secure solution is send that template to the trash.
    – Fran
    Feb 7, 2019 at 17:24
  • \centering should help. Right now \\ is adding an extra \hfil to the right. (The definition of \\ changes a lot.) Feb 7, 2019 at 17:55
  • @Fran : I'd love that so much. This template is from 1992 and they are not going to update it until the end of this year, but I am stuck with it. Feb 7, 2019 at 18:01
  • minipage is not a package but a core environment provided by the kernel. Why can't you use it? Feb 7, 2019 at 18:29
  • Ah, that would explain why when I tried to import it, it made a mess. UPS newbie here. THANK YOU! Feb 7, 2019 at 18:38

1 Answer 1

2

Using minipages:

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\begin{figure}[tb]
    \begin{minipage}[b]{.14\linewidth}
        \centering
        (a)

        \includegraphics[width=\linewidth]{example-image}
    \end{minipage}
    \hfill
    \begin{minipage}[b]{.22\linewidth}
    \centering
        (b)

        \includegraphics[width=\linewidth]{example-image}
    \end{minipage}
    \hfill
    \begin{minipage}[b]{.14\linewidth}
    \centering
        (c)

        \includegraphics[width=\linewidth]{example-image}
    \end{minipage}
    \caption[Model Abstractions]{Model abstractions permited when sensor proteins are available in abundance. (a) Schematic showing a sensor protein that represses a sensor promoter. (b) A small molecule (input) that represses the sensor protein. (c) Model abstraction where the small molecule can be considered to activate the sensor promoter.}
    \label{Sensor Molecules}
\end{figure}

\end{document}

enter image description here

3
  • I can't use minipage either Feb 7, 2019 at 18:01
  • Actually, my bad! Newbie here. I thought minipage was a package, and when trying to import it, it made a mess. THANK YOU! Your solution worked wonders Feb 7, 2019 at 18:37
  • @PedroFontanarrosa My pleasure!
    – user180639
    Feb 8, 2019 at 0:07

You must log in to answer this question.

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