Graphics, Figures & TablesAlign name of tables and Figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
tdcpina
Posts: 39
Joined: Wed Apr 15, 2009 4:22 pm

Align name of tables and Figures

Post by tdcpina »

Hi guys,

This problem is apparently very simple to solve, but happens that I don't know exactly how solve it.

I want to align the names of tables always to the left side, still leaving the table at the center. How can I do that?

Thanks a lot in advance,
Tiago

Recommended reading 2024:

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

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

fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Align name of tables and Figures

Post by fatra2 »

Something like this:

Code: Select all

\begin{table}
\begin{center}
\begin{tabular}{¦l¦l¦l¦}
column 1
& column 2
& column 3
\end{tabular}
\end{center}
\end{table}
The fact of putting "¦l¦l¦l¦" will produce a table of three columns. The table is in the center environment, but the content of the cells will be left justified (due to l). The ¦ will put a column marker between each column.

Hope this helps.

Cheers
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

Align name of tables and Figures

Post by Bozack »

The first answer by fatra2 seems to be a little misunderstanding - I think tdcpina asked for how to align the name of the table to the left, not the contents of the table.

tdcpina, I think you need to look a little on the caption package: You can find the documentation here: http://www.dd.chalmers.se/latex/Docs/PDF/caption.pdf

The package option nooneline should do the trick, even though this will do the change to other floats too.
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Align name of tables and Figures

Post by localghost »

fatra2 wrote:The fact of putting "¦l¦l¦l¦" will produce a table of three columns. The table is in the center environment, but the content of the cells will be left justified (due to l). The ¦ will put a column marker between each column.
The center environment should be replaced by the \centering command and vertical lines should be avoided in tables to improve legibility.
Bozack wrote:[...] tdcpina, I think you need to look a little on the caption package: You can find the documentation here: http://www.dd.chalmers.se/latex/Docs/PDF/caption.pdf [...]
When referring to a package documentation, you should always use its entry on CTAN because there usually is the current version available. Your link leads to an outdated manual.
tdcpina wrote:[...] I want to align the names of tables always to the left side, still leaving the table at the center. How can I do that? [...]
The current version of the caption package lets you setup the caption of certain floats so that it is always aligned to the left regardless of its width.

Code: Select all

\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\captionsetup[table]{singlelinecheck=false}
This is equivalent to the suggestion of Bozack for the nooneline option but adapted to the current version of the package.


Best regards
Thorsten
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

Align name of tables and Figures

Post by Bozack »

localghost wrote:Your link leads to an outdated manual.
Sorry for that - I just google'd it ;)

I'll link to CTAN next time :D
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
Post Reply