I am trying to achieve same thing as in this question, but with longtable environment. Table itself is centered.
Using caption package and
\captionsetup[longtable]{justification=raggedright,singlelinecheck=off}
makes caption aligned to the left, but the caption sticks past the left edge of the table.
And I can't just add margin=
or something, because my tables are not of the same width.
Is there a way to correct this, or maybe an alternative to longtable?
Example document:
\documentclass[a5paper,12pt,titlepage]{article}
\usepackage[a5paper]{geometry}
\usepackage{longtable}
\usepackage{caption}
\captionsetup[longtable]{skip=0pt,justification=raggedright,singlelinecheck=off}
\usepackage{lipsum}
\begin{document}
\lipsum[3-4]
\begin{longtable}{l|p{2.5cm}|p{2.5cm}}
%----------------------------------------
\caption{This label isn't where I want it}\label{tab:test}\\ \hline
Name & Description & Example\\
\endfirsthead
%----------------------------------------
\caption*{Table \ref{tab:test} (continued)}\\\hline
\endhead
%----------------------------------------
\hline
Something A & here's supposed to be some text & some text here \\ \hline
Something B & description of B & something more about B\\ \hline
Something C & describe C here & some example involving C \\ \hline
Something D & dfjashdfkjha sdflhasdkf hfsadf asdf & dsjkdlaskd ksjdla jdlkasj \\ \hline
\end{longtable}
\end{document}
Caption is aligned like this:
This is how I want it to look:
tabularx
with packageltablex
? It brings the functionalities oflongtable
to tabularx.