# centering caption of a figure

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

-
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
Can you give us a minimal working example so we can see what's going on? –  qubyte May 5 '12 at 12:12

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}


-
@ 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