I am trying to insert figures in minipages in newcommands to get two images on a a5 paper. MWE:
\documentclass{article}
\usepackage{mwe}
\usepackage[a5paper, margin=5mm]{geometry}
\newcommand{\twoimages}[2]{
\centering
\begin{minipage}
\begin{figure}
\begin{minipage}[c]{\textwidth}
\includegraphics[width=0.97\textwidth]{#1}
\end{minipage}
\noindent
\begin{minipage}[c]{\textwidth}
\includegraphics[width=0.97\textwidth]{#2}
\end{minipage}
\end{figure}
\end{minipage}
}
\begin{document}
\twoimages{example-image-plain}{example-image-plain}
\end{document}
which results in
<to be read again>
\relax
l.21 ...{example-image-plain}{example-image-plain}
I cant spot the error. I got part of the code from How to use figure inside a minipage?
and I already tried \DeclareRobustCommand, but no luck.
Can you help?
figureenvironment. – leandriis Aug 12 '19 at 18:45\begin{minipage}is missing the mandatorywidthargument. However, afigureenvironment inside aminipagewill raise yet another error... – Phelype Oleinik Aug 12 '19 at 18:45