Document ClassesProblem with table caption

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
tomileee
Posts: 9
Joined: Tue Jul 08, 2008 11:49 am

Problem with table caption

Post by tomileee »

Hi,
i have to place the caption of a table at the top left position and for images at the standard centered bottom position.
The following code places the label of the table at top centered position, altough the switch justification=raggedleft is set.
Does anybody know why?

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage[margin=10pt,font=small,labelfont=bf,justification=raggedleft]{caption}
\begin{document}
Table Test:
\begin{table}
\caption{Test Table}
    \begin{tabular} {|l|l|} \hline
		Item1         & Item2 \\ \hline
		\end{tabular}
    \label{tab:Test1}
\end{table}
\end{document}
Best regards,
Thomas

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10397
Joined: Mon Mar 10, 2008 9:44 pm

Problem with table caption

Post by Stefan Kottwitz »

Hi Thomas,

single lines are centered by default, that's the behaviour of the standard classes adapted by the caption package. But you can switch it off by the option singlelinecheck=false. Perhaps you want to use raggedright, try:

Code: Select all

\usepackage[margin=10pt,font=small,labelfont=bf,justification=raggedright,singlelinecheck=false]{caption}
Stefan
LaTeX.org admin
tomileee
Posts: 9
Joined: Tue Jul 08, 2008 11:49 am

Re: Problem with table caption

Post by tomileee »

Thank you very much Stefan, now it works.
Post Reply