Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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[a4paper,left=2.5cm,top=2.5cm,bottom=2.5cm,includeheadfoot,width=16cm]{geometry}
\usepackage{nonfloat}

\renewcommand{\captionformat}{~---~}
\setcapindent{0mm}
\addtokomafont{caption}{\small}
\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:

enter image description here

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

share|improve this question
    
    
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

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.