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 ran across this problem and fail to find an answer even after thorough searching:

I use

\usepackage[bf]{caption}  

in my LaTeX document, as I want the "Figure 1"-Part of the caption to appear bold. Unfortunately, the following caption is indented starting on the second line, so that the "Figure 1" part is alone:

Figure 1: blabla, bla-  
          blablabla
          blabal
          blablabla

I'd prefer sth like this (the other variant looks really stupid for narrow floats and wastes space):

Figure 1: blabla, bla-
blablabla blabla blabla

Has anyone found a solution for this?

share|improve this question

migrated from stackoverflow.com Jan 5 '12 at 18:07

This question came from our site for professional and enthusiast programmers.

    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Jan 5 '12 at 18:10
4  
The caption documentation (available e.g. with texdoc caption) has a section on formatting. You should really read it. –  Martin Schröder Jan 5 '12 at 18:38
    
Thanks for the tip, I looked this up in a far older version of the documentation which didn't list the below-mentioned way to solve the problem. –  SugarAddict Jan 5 '12 at 20:34

2 Answers 2

up vote 4 down vote accepted

The package caption provides different styles via option. To set one of the predefined styles use format=.

Here an example

\documentclass{scrartcl}
\usepackage[bf]{caption} 
\def\exampletext{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a,
magna.
}
\begin{document}
\begin{figure}[!ht]
\centering
\rule{7cm}{1cm}
\caption{\exampletext}
\end{figure}

\begin{figure}[!ht]
\captionsetup{format=plain}
\centering
\rule{7cm}{1cm}
\caption{\exampletext}
\end{figure}

\begin{figure}[!ht]
\captionsetup{format=hang}
\centering
\rule{7cm}{1cm}
\caption{\exampletext}
\end{figure}
\end{document}

enter image description here

share|improve this answer
    
Thank you, solves it for my images. Unfortunately, on first glance, this doesn't seem to work with ctable. Let's see if I find a solution for that. –  SugarAddict Jan 5 '12 at 20:56

If including the line \usepackage[bf]{caption} is causing the captions to be formatted "hanging" while they do not without this line, then this is clearly a bug in my caption package. Please give me a Minimal Working Example (MWE) so I can fix this.

Unless this is fixed by me I would avoid usage of my caption package since there is a compatibility problem here which influence can't be estimated - it could cause serious other problems.

share|improve this answer
2  
Shouldn't this rather be a comment to the OP's question? –  lockstep Jan 5 '12 at 19:24
1  
It fails with KOMA classes, probably redefined internally somewhere, but you right a MWE is always a must. –  Yiannis Lazarides Jan 5 '12 at 19:35
1  
I just added a solution to my answer (avoiding my caption package) - and IMHO this is the right solution, I would clearly not recommended "fixing" this by other caption package settings like format=plain. At least unless we know what the real problem is. –  Axel Sommerfeldt Jan 5 '12 at 19:38
2  
Seems I was completely misleaded by your phrase "bold numbering indents caption text". It seems the real answer is simply: No, this is not true, the bold numbering does not indents caption text. (As already stated it would be a bug otherwise.) –  Axel Sommerfeldt Jan 5 '12 at 21:16
1  
Sorry for that, I had the impression that this issue arose after adding the caption package - my bad. Thank you for providing the package, I really appreciate the help and work that ppl invest into latex and guys like me :) –  SugarAddict Jan 5 '12 at 21:41

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.