I would like to put two figures side by side such that they are centered on the page and have an arbitrary (given) space between them. Although there are a lot of similar questions here, none has given me the desired result.
I have found that using the following code allows the placement of two figures side by side with the possibility of having an arbitrary space between them. However, as it can be noticed from the picture, because the widths of the pictures are higher than the line length, the right picture goes past the text, while the whole ensemble remains aligned with the text:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{lipsum}
\begin{document}
\lipsum[1-1]
\begin{figure}[h!]
\captionbox{This is a duck\label{fig2:a}}{\includegraphics[width=.6\textwidth]{duck.png}}%
\captionbox{This is a sparrow\label{fig2:b}}{\includegraphics[width=.6\textwidth]{sparrow.png}}
\end{figure}
\lipsum[1-1]
\end{document}
The result is depicted below: (note that the code above will work but it will show black boxes instead of images because of the 'demo' option before the graphicx \usepackage parameter)

The problem is that I would like the image group to be centered on the page and overtake an equal amount the paragraph text on both sides.
Is it possible to achieve that from this code, or at least by maintaining the possibility of an arbitrary separation between the images?
\textwidth. The solution is the same, even though you're including two figures side-by-side. – Werner Apr 09 '15 at 00:04