# Longtable same header, different caption

The standard use case for longtable must be as follows:

• Caption on the first page
• Table x: Continued... on each subsequent page

So why does this seem so hard to do? This SE answer suggests that the right way to do this is:

\documentclass{article}
\usepackage{booktabs}
\usepackage{longtable}
\begin{document}
\begin{longtable}{ll}
\caption{My favourite caption}\label{tbl:table}\\
\toprule
& foo \\
\midrule
\caption{Continued...}\\
\toprule
& foo \\
\midrule
bar           & 1 \\
baz           & 2 \\
\bottomrule
\end{longtable}
\end{document}


But this seems to me to be a seriously flawed workflow. If I notice a typo in the column headers (and there may be many column headers!) I have to fix it in two different places!

Is there really no way to achieve what seems to me to be the completely standard use case without breaking this pretty fundamental rule of coding?

You do have a macro processor to hand....

\documentclass{article}
\usepackage{booktabs}
\usepackage{longtable}
\begin{document}
\newcommand\foo{%
\toprule
& foo \\
\midrule}
\begin{longtable}{ll}
\caption{My favourite caption}\label{tbl:table}\\
\foo
\caption{Continued...}\\
\foo

• True, @DavidCarlisle, but I suppose that my objection is to the extremely common nature of the use case. Basically everyone who uses longtable will want to do some variant on this, so it should be baked in. Oct 10, 2014 at 16:21
• @LondonRob I disagree (and it's my code so I win:-) It would mean implementing and documenting some kind of macro replacement system specific for this case in the general macro language of tex which seems odd. You can't just say "duplicate the header" as the non duplicated parts (the caption, the label, the continued....) might appear at the top or botom or middle of the header code so you'd have to implement and document positional options which is more complicated to implement and more complicated for the user who may be expected to be familiar with \newcommand Oct 10, 2014 at 16:31