First of all I'd like to thank this community for all the answers that I've already found on this site, however now I've encountered something that I can't find an answer to.
I'm writing my thesis in LaTeX (using MikTex & TeXnicCenter), and I wanted to use the subfigure package to fit 4 pictures into one. However, when I build my file, I had some issues and went looking for answers. Then I found something mentioning other packages called subcaption and subfig. I tried subfig first, but got errors that I couldn't get rid of so I used subcaption, and now I get the result shown in the attached picture. As you can see, the pictures on the right are positioned a bit lower than the ones on the left.
Here's a minimal example code I'm using (hope I didn't forget anything here, never done this before):
Code: Select all
\documentclass[11pt,a4paper,oneside]{article}
\usepackage{a4wide}
\usepackage[dutch]{babel}
\usepackage{amsmath}
\usepackage{url}
\usepackage{graphicx}
\usepackage[latin1]{inputenc}
\usepackage[small,bf,hang]{caption}
\usepackage{xspace}
\usepackage[per-mode=symbol, output-decimal-marker={,}, separate-uncertainty=true, exponent-product=\cdot]{siunitx}
\usepackage{microtype}
\usepackage[fixlanguage]{babelbib}
\selectbiblanguage{dutch}
\usepackage[hidelinks]{hyperref}
\usepackage{booktabs}
\bibliographystyle{babunsrt}
\usepackage{subcaption}
\captionsetup{margin=10pt,font=small,labelfont=bf}
\usepackage[usenames]{xcolor}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{ReactivationA}
\caption{Visuele cortex in P45 muizen herstelt niet volledig 7 weken na ME}
\label{fig:ReactivationA}
\end{subfigure}
\quad
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{ReactivationB}
\caption{AMC-muis met normale visuele cortex}
\label{fig:ReactivationB}
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{ReactivationC}
\caption{Visuele cortex in P120 muizen herstelt wel volledig 7 weken na ME}
\label{fig:ReactivationC}
\end{subfigure}
\quad
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{ReactivationD}
\caption{AMC-muis met normale visuele cortex}
\label{fig:ReactivationD}
\end{subfigure}
\caption{Vergelijking tussen de activiteit van de visuele cortex in P45 en P120-muizen met en zonder ME. Bij age match control (AMC)-muizen wordt geen ME uitgevoerd: ze dienen om het resultaat van ME-muizen te vergelijken met de normale situatie in een even oude muis. AMC-muizen zijn dus ook P45 of P120 + 7 weken. Zoals aangegeven op de schaal aan de rechterkant betekent een donkere, groene kleur dat er weinig activiteit is, terwijl rood en geel voor hoge concentraties activiteitsmerker staan~[\ref{src:DoctoraatJulie}].}\label{fig:Reactivation}
\end{figure}
\end{document}
! Missing number, treated as zero.
<to be read again>
}
l.220 \begin{subfloat}{0.3\textwidth}
! Illegal unit of measure (pt inserted).
<to be read again>
}
l.220 \begin{subfloat}{0.3\textwidth}
That x4, once for each subfloat, + 8 overfull \hbox warnings (which can probably be solved by decreasing image size, I always try to fix errors before moving on to warnings & bad boxes).
Help would be greatly appreciated since I have a deadline monday.
Thanks in advance!
Jef