LaTeX forum ⇒ Graphics, Figures & Tablescentering 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

Postby Amlaser » Wed Apr 07, 2021 10:25 am

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

User avatar
Ijon Tichy
Posts: 446
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Wed Apr 07, 2021 11:28 am

Usually using \centering inside a figure environment does not center the caption. So a Infominimal 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

Postby Amlaser » Wed Apr 07, 2021 1:58 pm

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.

User avatar
Ijon Tichy
Posts: 446
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Wed Apr 07, 2021 2:21 pm

Amlaser wrote:Here is an example

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 9679
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Apr 08, 2021 6:03 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
LaTeX.org admin

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

Postby Amlaser » Thu Apr 08, 2021 11:23 pm

Thanks Stefan,

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


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 2 guests