Graphics, Figures & Tablescentering the figure and justifying its caption

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

centering the figure and justifying its caption

Post by Amlaser »

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

centering the figure and justifying its caption

Post by Ijon Tichy »

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.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Amlaser
Posts: 5
Joined: Wed Apr 07, 2021 10:08 am

centering the figure and justifying its caption

Post by Amlaser »

Here is an example

Code: Select all

      \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: 640
Joined: Mon Dec 24, 2018 10:12 am

centering the figure and justifying its caption

Post by Ijon Tichy »

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.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

centering the figure and justifying its caption

Post by Stefan Kottwitz »

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

centering the figure and justifying its caption

Post by Amlaser »

Thanks Stefan,

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