Following code is currently used to show a figure:
\begin{figure}[ht]
\lineskip=-\fboxrule
\fbox{\begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule}
\centering
\includegraphics[width=0.5\textwidth]{example-image}
\end{minipage}}
\fbox{\begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule}
\caption{The caption text}
\end{minipage}}
\label{fig:test}
\end{figure}
Question: How can I adjust the code so that the full box is only 0.5\textwidth of a page, with the image being full width within the box?
Best Answer
addedndum: if you have many such figures, than it might be sensible to define new command as:
and than use it as follows:
result is the same as before.