# Longtable - aligning caption to left [duplicate]

Possible Duplicate:
Formating captions in longtable tables

Is it possible to align longtable caption to the left side of paper ? Standard table and tabular command align caption to the left and I would like to achieve the same effect in longtable. Is it possible ??

-

## marked as duplicate by Martin Scharrer♦Jul 4 '11 at 22:44

longtable centers the caption by default by using \multicolumn{<num>}{c}{...} internally. This seems to be hardcoded. But the manual states that you can use the caption package to change this. –  Martin Scharrer Jun 28 '11 at 18:47
This should be answered by Formating captions in longtable tables. Using \usepackage[singlelinecheck=off]{caption} works for me. –  Martin Scharrer Jun 28 '11 at 19:01

As Martin noted, use the caption package. It has options to change the formatting of the caption. To left align the caption for all tables use the package option singlelinecheck=off. I've used data from the example in your other question to construct the following example:

\documentclass{article}

\usepackage{longtable}

\usepackage[singlelinecheck=off]{caption}

\begin{document}

\begin{longtable}{|c|c|c|c|c|c|c|c|c|}
\caption{Wyniki rozpoznawania obrazów dla obrazu zapytania 004\_0001.jp w katalogu baseballbat}\\\hline
054\_0020.jpg & 209 & ring &054\_0020.jpg & 209 & 10089.1  & celu & time & 0.98  \\ \hline
\end{longtable}

\end{document}

-
Sorry, @N.N., but this doesn't work! Try reducing the caption to two words and you will see that it gets centered. The justification=raggedright doesn't has any effect here. I did the same MWE and figured you need (only!) singlelinecheck=off as shown in Formating captions in longtable tables, which makes it close enough to be a duplicate. –  Martin Scharrer Jun 29 '11 at 10:15
@Martin Scharrer True, singlelinecheck=off works with short captions (and I've changed my answer accordingly). They – justification=raggedright and singlelinecheck=off – have almost the same effect on long captions though. –  N.N. Jun 29 '11 at 12:11
singlelinecheck=off has no effect on long captions at all (since it only affects "short" resp. "single-line" captions). justification=raggedright has clearly an effect since it changes the justification of the text from justified to raggedright. So I would say, no, the above statement that both have almost the same effect on long captions is IMHO not correct. –  Axel Sommerfeldt Jul 14 '11 at 8:48