# How to change the position of the caption in a “narrow” and “minipage” environment?

I have some huge figures to include in Latex. Therefore I use the "minipage" and "narrow" environment to place it right at the desired position and to move it to the left until it looks centered. Then, however, the caption moves to the left, too. The result: The figure is centered and the caption is not. The longer the caption, the worse it looks because it moves more and more to the left. Now I want to move the caption to the right until its "centered" again.

Here an example:

\documentclass[a4paper,11pt,ngerman]{scrreprt}

\usepackage[komastyle,automark]{scrpage2}
\usepackage[latin1]{inputenc}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{nonfloat}

\renewcommand{\captionformat}{~---~}
\setcapindent{0mm}
\setkomafont{captionlabel}{\sffamily \bfseries}

\begin{document}

\begin{narrow}{-1.0in}{0in}
\begin{minipage}{\linewidth}
\centering%
\includegraphics[width=600pt, height=273pt]{figureName}%
\figcaption{Here is a long caption, the longer it is, the worse it looks}%
\label{fig:label}%
\end{minipage}
\end{narrow}

\end{document}


Heres an example:

Above picture illustrates the situation: The caption needs to move to the right until its centered again. Any ideas? Thanks in advance!

-
–  Gonzalo Medina Aug 23 '12 at 3:11
The nonfloat package is incompatible to the KOMA-Script document classes. Both try to control the spacing before and after the captions, and if you use both, you will have anything but the desired behaviour. The KOMA-Script classes offer the command \captionof for typesetting captions outside floating environments so there should be no need for the nonfloat package anyway. –  Axel Sommerfeldt Aug 23 '12 at 18:24
@GonzaloMedina: That question has been closed as a duplicate of this. –  Martin Schröder Sep 9 '12 at 21:46

Can't run your example without the image but it seems that you don't really want the narrow/minipage which is just moving the caption. If you want the caption to go in the normal place but move the image; just move the image:

\vspace*{-2cm}%
\includegraphics[width=600pt, height=273pt]{figureName}%
\vspace*{-3cm}%


for whatever lengths look right.

-

Place the \caption and \label outside the minipage environment:

\begin{narrow}{-1.0in}{0in}
\begin{minipage}{\linewidth}
\centering%
\includegraphics[width=600pt, height=273pt]{figureName}%
\end{minipage}
\figcaption{Here is a long caption, the longer it is, the worse it looks.
Here is a long caption, the longer it is, the worse it looks.
Here is a long caption, the longer it is, the worse it looks.}%
\label{fig:label}%
\end{narrow}


Of course, there are other ways of doing this as well. For example,

\begin{figure}
\makebox[\linewidth][c]{%
\includegraphics[width=600pt, height=273pt]{figureName}%
\figcaption{Here is a long caption, the longer it is, the worse it looks.
Here is a long caption, the longer it is, the worse it looks.
Here is a long caption, the longer it is, the worse it looks.}%
\label{fig:label}%
\end{narrow}


would provide a centred* image in the traditional (floating) figure environment and allow it to stretch across the text block evenly (same length on both sides). This should work well if you don't have too big a difference in your margins.

* By default, \makebox centres its content, so the second optional parameter [c] is not needed.

-