## LaTeX forum ⇒ General ⇒ Centered Captions

LaTeX specific issues not fitting into one of the other forums of this category.
douglastoy
Posts: 7
Joined: Mon Apr 06, 2009 11:07 am

### Centered Captions

I would like to centre the caption text underneath my figure but I don't know how. Can anyone help me?

Here is an example. I've loaded an example photo onto my flickr which hopefully will appear here...

If not, please go to here in order to see it. Examining this you can see that the word "Regime" is below the "(f)" and looks pretty rubbish. Is it possible to centre this text in order the Regime be in the middle of the page, rather than under the "(f)".

Thanks in advance for any help.

Tags:

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
douglastoy wrote:I would like to centre the caption text underneath my figure but I don't know how. [...]

Centered captions are the default behaviour. Build a minimal working example (MWE) example that shows another one.

douglastoy wrote:[...] I've loaded an example photo onto my flickr which hopefully will appear here [...]

Pictures can also be uploaded to the forum server as attachment to posts. Use the tab called "Upload Attachment" right below the input window when posting. This is the better method because links to other servers could die after some time.

douglastoy wrote:[...] Examining this you can see that the word "Regime" is below the "(f)" and looks pretty rubbish. Is it possible to centre this text in order the Regime be in the middle of the page, rather than under the (f). [...]

Captions can be customized in many ways by using the caption package. Other classes than the standard ones may have built-in features.

Best regards
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

douglastoy
Posts: 7
Joined: Mon Apr 06, 2009 11:07 am

I've uploaded a picture of the figure as an attachment and here is a brief code like the one I am using. This figure is one of six within a subfloat environment.

\begin{figure}\centering\subfloat[(8x4.5): Zero Torque \& Identical Rotational Regime]{\label{Comp_SD_ZQ_VQ35005000}\includegraphics[width=0.5\linewidth]{Comp_SD_ZQ_VQ35005000}}\subfloat{othersubfloat}\caption{Subfloat Caption}\label{Subfloat label}\end{figure}

Is it possible to centre the caption "(8x4.5): Zero Torque \& Identical Rotational Regime"? From the uploaded figure you can see my previous remark about Regime being to the left of the caption and not in the centre.
Attachments
Bad Caption Example.jpg (92.78 KiB) Viewed 59222 times

douglastoy
Posts: 7
Joined: Mon Apr 06, 2009 11:07 am
Fixed using caption package. Put this in the preamble.
\usepackage[center]{caption}

magical marshmallow
Posts: 30
Joined: Mon Jan 21, 2013 11:37 am
I have a similar question to this. I have a caption for a figure underneath which I would like to have a smaller centered piece of text. When I add the \centering command (to the \caption), the whole caption becomes centered, not just the portion after the \centering command. Can anyone tell me why this is and what I should do to fix this please?

\documentclass{scrreprt}\usepackage{caption}\usepackage{graphicx} \begin{document}   \begin{figure}     \centering     \includegraphics[width=\linewidth]{SOME_IMAGE.png}     \caption[Caption for LOF]{Accurate caption\\ \footnotesize \centering Experimental details}     \label{Some label}   \end{figure}\end{document}

Cheers

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
As I already said in an earlier reply here, captions are centered by default. And that's not different in your example even if the manual line break and the other following stuff is dropped.

Please prepare a proper example where your main caption is not centered. Otherwise this discussion remains academic.

Just a hint. You don't necessarily need to write the additional text into the caption. Just place it before the caption as usual text.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

magical marshmallow
Posts: 30
Joined: Mon Jan 21, 2013 11:37 am
Sorry slightly ambiguous post. I shall try to clear this up

The caption as a whole is indeed centred by default under the image, however the caption text is formated as:
Figure X.X: Caption text.

When the caption is long enough, it drops to a second line and takes the form of
Figure X.X: Caption text which is long and requires a
&nbsp;&nbsp;2nd line of text

I would like thus to add a 3rd line which would take the form of
Figure X.X: Caption text which is long and requires a
&nbsp;&nbsp;2nd line of text
&nbsp;&nbsp;&nbsp;small font details

It is this last part that I am striving to achieve

Johannes_B
Site Moderator
Posts: 4109
Joined: Thu Nov 01, 2012 4:08 pm
I guess I am not the only one who doesn't really knows what you are trying to achieve. A minimal example is supposed to isolate the problem so we can help you faster.

\documentclass{scrreprt}\usepackage[format=plain,indention=1em]{caption}\usepackage[demo]{graphicx}\begin{document}   \begin{figure}     {\centering     \includegraphics[width=\linewidth]{SOME_IMAGE.png}     \caption[Caption for LOF]{Accurate caption, I would like thus to add a 3rd line which would take the form of Figure X.X: Caption text which is long and requires a \\ \footnotesize Experimental details}     \label{Some label}}     \footnotesize Experimental details\end{figure}\end{document}

If this is not what you want, a minimal example is more than required. Please also have a look at the caption manual and the format and indention options.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Another possible approach with a \parbox.
\documentclass{scrreprt}\usepackage[T1]{fontenc}\usepackage{graphicx} \setcapindent{1em}  % only to mark the caption text,                     % set to 0pt in actual document \begin{document}   \begin{figure}[!htb]     \centering     \includegraphics[scale=0.5]{example-image}     \caption[LOF entry]{The quick brown fox jump over the lazy dog. The quick brown fox jump over the lazy dog.}     \label{fig:dummy}      \smallskip     \parbox{\linewidth}{\footnotesize Experimental details}   \end{figure}\end{document}
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

magical marshmallow
Posts: 30
Joined: Mon Jan 21, 2013 11:37 am
What I have is:

\documentclass{scrreprt}\usepackage{caption}\usepackage{graphicx}\begin{document}   \begin{figure}\includegraphics[width=\linewidth]{some-image.png}\caption[Description for LOF]{Description of image\\ \footnotesize\centering Details of protocol used to collect data}\label{some label}\end{figure}\end{document}

What I would like is for the 'rubbish' on the 2nd line of the caption to be aligned under Description, not centered.
Attachments
caption-centered.png (12.36 KiB) Viewed 38733 times

### Who is online

Users browsing this forum: No registered users and 3 guests