# “! TeX capacity exceeded, sorry [input stack size=5000]” when trying to compile file with two tikzpictures

This works fine if I only use the first tikzpicture, not sure what goes wrong.

Here's the M(N)WE:

\documentclass{article}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}

\begin{minipage}{0.6\textwidth}
\lipsum[2-3]
\end{minipage}
\hspace{5mm}
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=south west,inner sep=0pt] at ($(current page.south west)+(2cm,5cm)$) {
\includegraphics[width=4cm]{example-image-a}
};
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=south west,inner sep=0pt] at ($(current page.south west)+(2cm,10cm)$) {
\includegraphics[width=4cm]{example-image-b}
};
\end{tikzpicture}
\end{document}


You simply forgot an \end{tikzpicture} before the second \begin{tikzpicture}. Alternatively you can drop the second \begin{tizpicture}. And you do not need to load graphicx when you load tikz, tikz will do that for you.

\documentclass{article}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}

\begin{minipage}{0.6\textwidth}
\lipsum[2-3]
\end{minipage}
\hspace{5mm}
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=south west,inner sep=0pt] at ($(current page.south west)+(2cm,5cm)$) {
\includegraphics[width=4cm]{example-image-a}
};
\node[anchor=south west,inner sep=0pt] at ($(current page.south west)+(2cm,10cm)$) {
\includegraphics[width=4cm]{example-image-b}
};
\end{tikzpicture}
\end{document}