LaTeX forum ⇒ Graphics, Figures & TablesCannot align caption to the center

Information and discussion about graphics, figures & tables in LaTeX documents.
pratikvimal.iitk
Posts: 3
Joined: Tue Jul 13, 2010 8:11 pm

Cannot align caption to the center

Postby pratikvimal.iitk » Tue Jul 13, 2010 8:18 pm

I am using the code below for centering the image and it's caption. But there seems to be some problem with it. The image is centered but the caption isn't. The caption is left centered. Please note that the Table Caption is Centered.

  1. \begin{figure}[h]
  2. \begin{center}
  3. \includegraphics[height=50 mm,width=90mm]{levelmmfustiny.eps}
  4. \caption{\it Levels of multi modal information fusion}
  5. \label{mmfus}
  6. \end{center}
  7. \end{figure}

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Tue Jul 13, 2010 8:29 pm

This code snippet is far too little information, not to say useless [1]. The code below doesn't cause any problems. So its your turn to show the opposite by means of a counterexample (MWE).
  1. \documentclass[11pt,a4paper,english]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{babel}
  5.  
  6. \begin{document}
  7. \begin{figure}[!ht]
  8. \centering
  9. \rule{6.4cm}{3.6cm}
  10. \caption{Dummy figure}\label{fig:dummy}
  11. \end{figure}
  12. \end{document}

As you can see, the default behaviour is a centered caption, even if the figure itself would not be centered.

[1] View topic: Avoidable mistakes


Best regards and welcome to the board
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

pratikvimal.iitk
Posts: 3
Joined: Tue Jul 13, 2010 8:11 pm

Postby pratikvimal.iitk » Tue Jul 13, 2010 8:36 pm

  1. \documentclass[12pt,twocolumn,twoside,final]{IEEEtran}
  2. \usepackage[dvips]{graphicx}
  3. \usepackage[final]{graphicx}
  4. \usepackage{amsmath,amsbsy}
  5. \usepackage{subfigure}
  6. \usepackage{paralist}
  7. \usepackage{times}
  8. \usepackage[english]{babel}
  9. \usepackage{graphicx}
  10.  
  11. \bibliographystyle{unsrt}
  12.  
  13. \pagestyle{plain}
  14. \renewcommand\floatpagefraction{.9}
  15. \renewcommand\topfraction{.9}
  16. \renewcommand\bottomfraction{.9}
  17. %\renewcommand\textfraction{.1}
  18. \renewcommand{\dbltopfraction}{0.9} % fit big float above 2-col. text
  19. \renewcommand{\textfraction}{0.07} % allow minimal text w. figs
  20. \setcounter{totalnumber}{50}
  21. \setcounter{topnumber}{50}
  22. \setcounter{bottomnumber}{50}


My document class is IEEEtran as you can see in the code above.

...................................................
  1. \begin{figure}[h]
  2. \begin{center}
  3. \includegraphics[height=50 mm,width=90mm]{levelmmfustiny.eps}
  4. \caption{\it Levels of multi modal information fusion}
  5. \label{mmfus}
  6. \end{center}
  7. \end{figure}


Please let me know if this helps

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Tue Jul 13, 2010 8:43 pm

pratikvimal.iitk wrote:[...] Please let me know if this helps

Not really. So I can only advice to read Section X (Floating structures, p. 8ff) of the IEEEtran manual. Seems that this caption format is the default setup. And by the way, you don't need to load a package three times.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
sommerfee
Posts: 495
Joined: Mon Apr 09, 2007 4:20 pm
Contact:

Postby sommerfee » Tue Jul 13, 2010 9:19 pm

pratikvimal.iitk wrote:My document class is IEEEtran as you can see in the code above.


The IEEEtran document class will only center figure captions in Conference Mode, i.e. document class option "conference" is set.

(See also IEEEtrans documentation "How to Use the IEEEtran LATEX Class", page 2: "Conference Mode Details: Conference mode makes a number of significant changes to the way IEEEtran behaves: [...]
• The figure captions are centered.")

Axel

Link:
BBcode:
HTML:
Hide post links
Show post links

pratikvimal.iitk
Posts: 3
Joined: Tue Jul 13, 2010 8:11 pm

Postby pratikvimal.iitk » Tue Jul 13, 2010 9:45 pm

Thanks localghost and Axel :)

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests