2

I use simple hanging captions for my tableheadings and figures. However, they are not aligned correctly. I know I can manipulate the indent manually, but I want to understand why they are placed wrong. Its not easy to see, but the second line of the caption seems to be aligned to the empty space after :, not to the first letter of the first line.

Here is my MWE:

\documentclass[captions=tableheading,14pt]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}

\usepackage{tabularx}
\usepackage{subfig}
\captionsetup{format=hang} 

\setlength{\parindent}{0pt}  


\begin{document}


\begin{table}[tbh]
\caption{\label{tab:gzf_netzbelastung_ohne} Parameter für die
Bestimmung der der Netzbelastung unter Ausschluss der Gewerbebetriebe.}
\begin{tabularx}{\textwidth}{|l|X|}
\firsthline
Nicht berücksichtigte Haushalte & 10,29 \\\hline
Anzahl Haushalte - $n$ & 30\\\hline
$P_\mathrm{S}$ & \\
\lasthline
\end{tabularx}
\end{table}

Um den Einfluss der Gewerbebetriebe beurteilen zu können, sind die bei
Berücksichtigung dieser Haushalte ebenfalls bestimmt worden. Die zugehörigen
Parameter finden sich in Tabelle \ref{tab:gzf_netzbelastung_ohne}.

\end{document}

MWE

I load subfig because I need it in my original document - this package also loads the caption package. However, the same is problem arises without those packages. I also tried leaving the redefinition of parindent, but this also does not change anything.

  • Remove \label{...} from inside \caption and put it under \caption, then remove the white space you typed before \label. – Pier Paolo Jan 6 '15 at 17:37
  • @PierPaolo thanks, works like a charm and I feel like a real idiot to forget that space. makes me wonder where the best place would be for the label? Right after \begin{table}? – Paul Paulsen Jan 6 '15 at 17:39
  • If someone else reading this might also wonder where the best place for the \label is, I found an answer: tex.stackexchange.com/q/32325/41356 – Paul Paulsen Jan 7 '15 at 12:27
3

You have a space after \label{...} which is so produced in the output.

Either

\caption{Parameter für die Bestimmung der der Netzbelastung unter 
  Ausschluss der Gewerbebetriebe.}\label{tab:gzf_netzbelastung_ohne}

or

\caption{Parameter für die Bestimmung der der Netzbelastung unter 
  Ausschluss der Gewerbebetriebe.\label{tab:gzf_netzbelastung_ohne}}

will solve the problem. I usually place the label outside (and after) \caption.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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