Graphics, Figures & TablesWhy the caption is always aligned at the left?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mojin
Posts: 4
Joined: Sun Mar 01, 2009 10:45 am

Why the caption is always aligned at the left?

Post by mojin »

I found in all my figures and tables, all captions are aligned at the left. But I really want to align them at the center. I don't know where to set it?

Here are the code that I used

\usepackage{graphics}

\begin{figure}
\begin{center}
\includegraphics[height=150mm]{flowchart.eps}
\caption{General procedure}
\end{center}
\label{fig:flowchart}
\end{figure}

Recommended reading 2024:

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

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

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Why the caption is always aligned at the left?

Post by josephwright »

Look at the caption package: the LaTeX kernel is not very helpful with the sort of thing.
Joseph Wright
mojin
Posts: 4
Joined: Sun Mar 01, 2009 10:45 am

Why the caption is always aligned at the left?

Post by mojin »

Thanks for your response. But I couldn't find caption.sty in my computer. I added the following lines, but it's still rendering the caption to the left.

Code: Select all

\usepackage{amsmath}    % need for subequations
\usepackage{graphics}
\usepackage{verbatim}   % useful for program listings
\usepackage{color}      % use if color is used in text
\usepackage{times}
\usepackage{hyperref}   % use for hypertext links, including those to external documents and URLs
\usepackage{thesis}
\usepackage{float, rotating, subfigure}  % use for side-by-side figures
\usepackage[center]{caption}
\usepackage[toc]{appendix}
daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: Why the caption is always aligned at the left?

Post by daleif »

it caption.sty is not found, then please upgrade, it is a fairly standard package these days

and if caption.sty does not exists

\usepackage[center]{caption}

would cause an error when compiling your document.

And by the way please post minimal examples not document sniplets.
mojin
Posts: 4
Joined: Sun Mar 01, 2009 10:45 am

Why the caption is always aligned at the left?

Post by mojin »

thanks to all guys. The file is built upon a template. After some test, I found the following command

Code: Select all

\makeatletter
make the caption align at the left.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Why the caption is always aligned at the left?

Post by phi »

mojin wrote:After some test, I found the following command

Code: Select all

\makeatletter
make the caption align at the left.
No, that's definitively not the case. \makeatletter does something entirely different and should not appear in "normal" documents. There must be something really wrong in your document if things like that are happening. Again, please post an MWE so that we can see what's going wrong.
Post Reply