I have tried quite many methods of getting two figures to compile side by side. Most of these method end up giving this error
Emergency stop subcaption.sty 66
Which shows this line in the file subcaption.sty
\subcaption@CheckCompatibility
I have tried most of the methods provided in these links:
Putting two figures side by side
I have tried changing \usepackage{subfigure} with \usepackage{subfig} I have tried to change the options provided in front of subfigure.
The code for the two figures as it is now:
\begin{figure}[ht]
\centering
\parabox{4cm}{
\includegraphics[width=4cm]{{ example−image−a}}
\caption{Fyrir}
\qquad
\begin{minipage}{4cm}
\includegraphics[width=4cm]{ example−image−b}
\caption{Eftir}
\end{minipage}
\caption{Mismunur í afhendingagetu milli 2019 og 2023 \label{fig:afhendingageta}}
\end{figure}
All of the packages (current):
\usepackage[utf8]{inputenc}
\usepackage[icelandic]{babel}
\usepackage{t1enc}
\usepackage{graphicx,booktabs}
\usepackage[intoc]{nomencl}
\usepackage{enumerate,color}
\usepackage{url}
\usepackage[pdfborder={0 0 0}]{hyperref}
\BeforeTOCHead[toc]{\cleardoublepage\pdfbookmark{\contentsname}{toc}} % Add Table of Contents to PDF "bookmark" table of contents
\usepackage{appendix}
\usepackage{eso-pic}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{longtable}
\usepackage[sf,normalsize]{subfigure}
\usepackage[format=plain,labelformat=simple,labelsep=colon]{caption}
\usepackage{placeins}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{adjustbox}
\usepackage{subcaption}
\usepackage{subfig}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{external}
% Packages used for title page layout
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning}
My LaTeX document is quite massive, so if you want a minimal working document, I'll paste it into pastebin (or similar) and share the link here. If there is a spelling mistake in my code, I am not seeing it.
I am pretty sure all of me system is up to date (on a rolling release Linux).
mwepackage https://ctan.org/pkg/mwe?lang=en. In short make a self contained minimal example others can copy and test as is. Then it is a lot easier to test your code and offer help. – daleif Mar 23 '23 at 12:39\begin/end{document}– daleif Mar 23 '23 at 12:55renewcommandin the document. I think it would be better to throw it on pastebin and share it like that. – Ólafur Víðir Guðbjargarson Mar 23 '23 at 12:57subfigure,subfig,subcaptionall at the same time. Probably only use the latter. Replace\usepackage{t1enc}with\usepackage[T1]{fontenc}. – daleif Mar 23 '23 at 12:57hyperrefshould be the last package to be loaded (as it has to adjust itself to other packages) – daleif Mar 23 '23 at 12:59subfigure,subfigandsubcaptionand keeptlencandT1? – Ólafur Víðir Guðbjargarson Mar 23 '23 at 13:00bebin{subfigure}and I got an error, can't remember now it was the same or not. – Ólafur Víðir Guðbjargarson Mar 23 '23 at 13:02subfigwithout noticing thesubfigurepackage – Ólafur Víðir Guðbjargarson Mar 23 '23 at 13:05–should be-– daleif Mar 23 '23 at 13:06example-image-anotexample–image–a, the former is using ascii hyphen the latter is using–(or similar) a unicode char for an en-dash. – daleif Mar 23 '23 at 13:10