user12625850
user12625850

Reputation:

How do I put a frame around multiple figures?

My code gives me two images on top of eachother on one page.

\documentclass{article}
\usepackage{graphicx}
\graphicspath{ {./images/} }

\begin{document}

\begin{figure}[H]
\includegraphics{cow1}
\caption{foo}
\label{fig:cow1}
\end{figure}

\begin{figure}[H]
\includegraphics{cow2}
\caption{bar}
\label{fig:cow2}
\end{figure}

\end{document}

I will get this: enter image description here

I want this: enter image description here How do I get a frame around the figures?

Upvotes: 2

Views: 6295

Answers (1)

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}

\graphicspath{ {./images/} }

\begin{document}

\fbox{
\parbox[c]{\textwidth}{
\centering
\includegraphics{example-image-duck}
\captionof{figure}{foo}
\label{fig:cow1}

\includegraphics{example-image-duck}
\captionof{figure}{bar}
\label{fig:cow2}
}}

\end{document}

Upvotes: 3

Related Questions