# Over wide figure with caption of the same width that both spill out of the right margin and are aligned flush left

This question is similar to that question, but instead I want to place a figure caption flush left aligned to an overwide figure so that it spills out of the right margin.

MWE

\documentclass{scrartcl} % KOMA-Script article
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{graphicx}\graphicspath{Figures}
\usepackage{float}
\usepackage[format=plain,justification=raggedright,font={small}]{caption}
\captionsetup[figure]{width=1.2\textwidth}

\begin{document}

\lipsum[120]
\begin{figure}[thbp]
\includegraphics[draft,width=1.2\textwidth]{Figures/foo.pdf}%
\caption{Caption that has the same width as the figure, but should be aligned to the left as everything else, but should spill out of the right margin}
\label{fig:key}
\end{figure}

\lipsum[120]

\end{document}


What I want is this:

-

The width= setting of the caption package will always center its caption with respect to the \textwidth, so width=1.2\textwidth will give you infact a left and right margin of -0.1\textwidth.

For manipulating its margins, better use margin= instead, since it offers discrete values for left and right margin. For example:

\documentclass{scrartcl} % KOMA-Script article
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage{graphicx}\graphicspath{Figures}
\usepackage[format=plain,justification=raggedright,font={small}]{caption}

% uncomment this if the setting should affect all figures
%\captionsetup[figure]{margin={0pt,-0.2\textwidth}}

\begin{document}

\lipsum[120]
\begin{figure}[thbp]
\includegraphics[draft,width=1.2\textwidth]{Figures/foo.pdf}%
\captionsetup{margin={0pt,-0.2\textwidth}}% only for this figure
\caption{Caption that has the same width as the figure, but should be aligned to the left as everything else, but should spill out of the right margin}
\label{fig:key}
\end{figure}

\lipsum[120]

\end{document}


As an alternative, one could put the whole figure contents inside a minipage with the desired width, this way both the content and the caption will be adjusted to the new width:

\documentclass{scrartcl} % KOMA-Script article
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage{graphicx}\graphicspath{Figures}
\usepackage[format=plain,justification=raggedright,font={small}]{caption}

\begin{document}

\lipsum[120]
\begin{figure}[thbp]
\begin{minipage}{1.2\textwidth}
\includegraphics[draft,width=\textwidth]{Figures/foo.pdf}%
\caption{Caption that has the same width as the figure, but should be aligned to the left as everything else, but should spill out of the right margin}
\label{fig:key}
\end{minipage}
\end{figure}

\lipsum[120]

\end{document}


Both should give identical results:

-

The boxhandler package gives great flexibility for customizing captions to figures It will allow you to specify caption width independently of image width, center, left or right justify captions, indent caption with respect to the Figure x. label, etc.

However, I do not know how to momentarily extend the margin to the right beyond \textwidth as the previous answer said. Perhaps you could place the text on a minipage with a reduced width, while leaving the \textwidth of the document to that desired for the figure.

Here's an example:

\documentclass{article}
\usepackage{boxhandler}
\parindent 0in
\begin{document}

\begin{minipage}{3in}
Text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
\end{minipage}

\bxfigure[ht]{The caption by default will be indented with respect to
the figure label, as is shown here}{\fbox{\rule{0ex}{6ex}%
\makebox[\textwidth]{Image}}}

\begin{minipage}{3in}
Text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
\end{minipage}

\end{document}


-