My goal is to have two commutative diagrams beside each other (but together centered) and with two captions.
I tried the following code:
\documentclass[twoside,12pt]{scrartcl}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{enumerate}
\usepackage[utf8]{inputenc}
\usepackage[thmmarks,amsmath,noconfig,amsthm]{ntheorem}
\usepackage{geometry}
\usepackage{tikz}
\usetikzlibrary{cd}
\geometry{tmargin=30mm,bmargin=40mm,lmargin=30mm,rmargin=30mm}
\setlength{\headsep}{15mm}
\begin{document}
\begin{minipage}[t]{0.5\textwidth}
\begin{figure}
\begin{tikzcd}
A \rar["B"] \dar["C"'] \& A \otimes B \\
A \rar["\mathrm{id}"'] \& B \arrow[u, "\phi"']
\end{tikzcd}
\caption{} \label{fig: MonFun2}
\end{figure}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\begin{figure}
\begin{tikzcd}
A \rar["B"] \dar["C"'] \& A \otimes B \\
A \rar["\mathrm{id}"'] \& B \arrow[u, "\phi"']
\end{tikzcd}
\caption{} \label{fig: MonFun3}
\end{figure}
\end{minipage}
\end{document}
(where I already change "&" to "\&" as it said somewhere). This gives me several errors:
- ! LaTeX Error: Not in outer par mode.
- ! Undefined control sequence. @xfloat ...@fltovf \fi \global \setbox @currbox
- ! Missing number, treated as zero.
- ! Package pgf Error: No shape named tikz@f@1-1-2 is known.
The last error occurs several times. Can someone maybe help me?
Thanks in advance!
P.S. My minimal example is not the shortest possible, but I wanted to include packages as geometry as I was not sure if that has any influence.

figureinsideminipage. What should it be for? – egreg Mar 05 '19 at 11:20subfigure. – Mar 05 '19 at 11:20