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 want to put the caption of my figure in the center but I can't do that. when I put my figure in the center the caption is also in the center but when the caption is too long and there is a return to a newline it is not in the center

share|improve this question
2  
Do you use the package caption? Do you use a KOMA-class? Do you use memoir? But the important question is: Did you read: How to Ask-page –  Marco Daniel May 5 '12 at 12:12
1  
Can you give us a minimal working example so we can see what's going on? –  qubyte May 5 '12 at 12:12
add comment

1 Answer

up vote 18 down vote accepted

Use the caption package and its justification=centering option.

\documentclass{article}

\usepackage[justification=centering]{caption}

\begin{document}

\begin{figure}
\centering
\rule{1cm}{1cm}
\caption{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. Donec vehicula augue eu neque.}
\end{figure}

\end{document}

enter image description here

share|improve this answer
    
@ lockstep: thank you your answer is so useful I resolved my problem. Really I don't know the package caption so thank you very much for your answer –  boutheina May 5 '12 at 12:20
add comment

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.