LyXCentralising Figure Text

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
hardya
Posts: 10
Joined: Mon Aug 23, 2010 2:31 pm

Centralising Figure Text

Post by hardya »

I cannot seem for the life of me to be able to centralise the figure text. That's the words Figure x: and the text box that comes after it where you put the name of the figure.

I am working with a two column document.

I have selected insert->float->figure from menu.

I have placed the image above the figure text just in the float figure box or in a 'box' of its own and in the float figure and I have alwasy been able to centralise it. However I cannot get the figure text to centralise even if it is the only thing in the float figure.

I position the cursor just left of 'Figure x:' and click paragraph settings button and change it from what ever it was before to centraise, but it is of no effect in the pdf.

Any help or advice, greatly appreciated.

Recommended reading 2024:

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

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

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Centralising Figure Text

Post by meho_r »

By default, this should work. Can you attach an example .lyx file containing some dummy text and an image, as well as its PDF output, please? Put them in a ZIP archive and attach it to your next post.
hardya
Posts: 10
Joined: Mon Aug 23, 2010 2:31 pm

Re: Centralising Figure Text

Post by hardya »

Here is the zip you requested. Any problem let me know.

Thanks for you help.
Attachments
FigureExample.zip
(63.84 KiB) Downloaded 339 times
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Centralising Figure Text

Post by meho_r »

In the preamble of the document you attached, there is a commented out line containing caption package, so you can uncomment it and/or add something like the following code to customize it to your liking:

Code: Select all

\usepackage{caption}
\DeclareCaptionLabelSeparator{period}{.\quad}
\captionsetup{font=footnotesize,labelsep=period}
However, do some testing to see if nothing gets messed up, because you're using IEEEtran article class which has its own way to handle captions.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Centralising Figure Text

Post by sommerfee »

meho_r wrote:However, do some testing to see if nothing gets messed up, because you're using IEEEtran article class which has its own way to handle captions.
It would definitely mess up the captions since the caption package is highly incompatible with the IEEEtran document class.
hardya
Posts: 10
Joined: Mon Aug 23, 2010 2:31 pm

Re: Centralising Figure Text

Post by hardya »

So then...

Are we 'perhaps' saying that Ieeetran documment class already (by some means) intentionally enforces many properties of a caption and that 'it appears' that alignment is 'probably' one of them and what I am seeing is prevention from overriding it?

If this is so, then presumably if I have been asked to abide by Ieeetran, then I already am doing.

On the other hand if some one says that according to ieeetran the captions ought not to be like that then there is something wrong with my copy of the electronic file(s) (or what ever) that operate the ieetran document class, right?

Any ideas how I can check if this is the case? Is the ieeetran document class that one downloads seen as the definition itself or is there a document that defines it where I will be able to see that the caption is as per requirements?

Hope this makes sense.

Many thanks again for your responses.

Andrew.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Centralising Figure Text

Post by meho_r »

Yes, handling of captions is internally defined by IEEEtran class provided by your TeX installation (same file provided by IEEE itself: check this and this link). So, basically, by using this class, you should be following requirements set by IEEE.

In IEEEtran class file, it is specified explicitly (lines 1777–1798) "if caption is longer than a line, let it wrap around" and "if caption is shorter than a line, center if conference, left justify otherwise". You could change this by simply editing IEEEtran class file and adding one \hfil, but think if you really want to do that.
hardya
Posts: 10
Joined: Mon Aug 23, 2010 2:31 pm

Re: Centralising Figure Text

Post by hardya »

Thank you all so much for your help I do appreciate it. I am a very limited user of lyx / tex.

What jumped out at me in the last post was "...center if conference...".

My paper is supposed to be for a conference. So, assuming ieeetran dose conference and journal, perhaps I simply have a single setting wrong.

If this is the case, then any ideas where I can see whether I have set to journal by mistake and how I might change it to conference? Simple doctype parameter somewhere?
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Centralising Figure Text

Post by meho_r »

Journal is loaded by default, as "How to Use the IEEEtran LaTeX class" shows (check the links from my previous post). So, to change it, go to Document > Settings > Document Class, and in Custom field enter conference. That should do it.
Post Reply