## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ centering the figure and justifying its caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Amlaser
Posts: 5
Joined: Wed Apr 07, 2021 10:08 am

### centering the figure and justifying its caption

How can I center the figure and justify its caption at the same time? Normally, I use \centering to center the figure, but it centers the caption also. I don't need this. I need to center the figure and justify its caption. Can anyone help?

Regards

Ijon Tichy
Posts: 446
Joined: Mon Dec 24, 2018 10:12 am
Usually using \centering inside a figure environment does not center the caption. So a minimal working example would be useful. Maybe you are mixing this up with the default centering of one-line captions? You can switch this of using package caption. See the package manual for more information.

Amlaser
Posts: 5
Joined: Wed Apr 07, 2021 10:08 am
Here is an example
      \begin{figure}[h]
\centering
\includegraphics[scale=0.30]{Figures/Figure}
\caption{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.}
\label{RelativeIntensity}
\end{figure}
Last edited by Stefan Kottwitz on Thu Apr 08, 2021 5:59 pm, edited 1 time in total.

Ijon Tichy
Posts: 446
Joined: Mon Dec 24, 2018 10:12 am
Amlaser wrote:Here is an example

but neither a minimal working example nor correctly marked as code. So, sorry, but I cannot help you further.

Stefan Kottwitz
Posts: 9678
Joined: Mon Mar 10, 2008 9:44 pm
Hi Amlaser,

I marked the code in your post. That can be done with the "Code" button when writing a post. The benefit is that it's much better readable and can be compiled to PDF in a single click. (even this incomplete snippet, with limited guessing auto-completion).

Also I would use the caption package, the settings are explained in the caption manual.

Stefan

Amlaser
Posts: 5
Joined: Wed Apr 07, 2021 10:08 am
Thanks Stefan,

Actually, I'm new here and I couldn't express what I meant well.
Thanks again