TransWikia.com

Figure caption not centered, but only for this figure

TeX - LaTeX Asked by Lars Nielsen on July 22, 2021

I have a figure where I am placing three subfigure‘s side by side.
Where I want the outer figure caption to be centered.
However, the captions keep being left-aligned and I cannot figure out why.
I use the subcaption package

What is weird to me is that I have other figures in the document which works just fine.
Following option a below.
What I have tried to fix the issue is the four options shown below.
Any ideas on how to fix this?

Option a:

begin{figure}
  centering
  begin{subfigure}{0.3textwidth}
    missingfigure{}
    caption{label{fig:outline-skysat}Pansharpened Satellite images}
  end{subfigure}
  hfill
  begin{subfigure}{0.3textwidth}
    missingfigure{}
    caption{label{fig:outline-xray-images}Grey scale X-Ray Images}
  end{subfigure}
  hfill
  begin{subfigure}{0.3textwidth}
    missingfigure{}
    caption{label{fig:outline-raw-images}Object Images (RAW)}
  end{subfigure}
  caption{CAPTION}
end{figure}

Option b:

begin{figure}
  centering
  begin{subfigure}{0.3textwidth}
    centering
    missingfigure{}
    caption{label{fig:outline-skysat}Pansharpened Satellite images}
  end{subfigure}
  hfill
  begin{subfigure}{0.3textwidth}
    centering
    missingfigure{}
    caption{label{fig:outline-xray-images}Grey scale X-Ray Images}
  end{subfigure}
  hfill
  begin{subfigure}{0.3textwidth}
    centering
    missingfigure{}
    caption{label{fig:outline-raw-images}Object Images (RAW)}
  end{subfigure}
  caption{CAPTION}
end{figure}

Option c:

begin{figure*}
  centering
  begin{subfigure}{0.3textwidth}
    missingfigure{}
    caption{label{fig:outline-skysat}Pansharpened Satellite images}
  end{subfigure}
  hfill
  begin{subfigure}{0.3textwidth}
    missingfigure{}
    caption{label{fig:outline-xray-images}Grey scale X-Ray Images}
  end{subfigure}
  hfill
  begin{subfigure}{0.3textwidth}
    missingfigure{}
    caption{label{fig:outline-raw-images}Object Images (RAW)}
  end{subfigure}
  caption{CAPTION}
end{figure*}

Option d:

begin{figure*}
  centering
  begin{subfigure}{0.3textwidth}
    centering
    missingfigure{}
    caption{label{fig:outline-skysat}Pansharpened Satellite images}
  end{subfigure}
  hfill
  begin{subfigure}{0.3textwidth}
    centering
    missingfigure{}
    caption{label{fig:outline-xray-images}Grey scale X-Ray Images}
  end{subfigure}
  hfill
  begin{subfigure}{0.3textwidth}
    centering
    missingfigure{}
    caption{label{fig:outline-raw-images}Object Images (RAW)}
  end{subfigure}
  caption{CAPTION}
end{figure*}

One Answer

The default caption formatting is centred if it fits in one line and a justified paragraph if not, so perhaps you are just seeing the effect of a longer text in some cases.

Correct answer by David Carlisle on July 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP