2

I found a issue when you try to change the table caption name option, while using a longtable:

\documentclass{scrartcl}

%CAPTION
\usepackage{caption}

%TABELLENÜBERSCHRIFT FORMATIERUNG
\captionsetup[table]{name=Tab.,labelfont=bf, font=footnotesize, justification=RaggedRight, singlelinecheck=false, format=plain, textformat=period}

\usepackage{longtable}
\usepackage{floatrow}

\begin{document}

%TABLE
\begin{table}
\centering
\renewcommand{\arraystretch}{1.5}
\ttabbox{\caption{Abc}}{\begin{tabular}{c|c|c|c}A & B & C & D \\A & B & C & D\end{tabular}}
\end{table}

%LONG TABLE
\renewcommand\arraystretch{1.5}
\begin{longtable}{c|c|c|c}
A & B & A & B \\ \hline 
A & B & A & B \\ \hline
A & B & A & B \\ \hline
A & B & A & B \\ \hline
\caption{Abc}
\end{longtable}

\end{document}

pdflatex.exe returns:

! Undefined control sequence. (longtable)

after removing name=Tab. from \captionsetup everything works fine.

How can I solve that issue, and how can I format the longtable caption like table caption (caption over table)?

LOG FILE :
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.6960 64-bit) (preloaded format=pdflatex 2019.3.4) 5 MAR 2019 09:33
  • Seems floatrow and longtable can not live together ... – Mensch Mar 5 '19 at 9:21
  • 1
    Did you saw related question tex.stackexchange.com/questions/320592/… ? – Mensch Mar 5 '19 at 9:25
  • 1
    You can compile also after deleting floatrow and command \ttabbox. Do you really need floatrow? – Mensch Mar 5 '19 at 9:50
  • For me, the problem seems to come from `caption: when I delete it, it compiles fine. – Bernard Mar 5 '19 at 11:32
  • It seems to be an incompatibility between caption and floatrow regarding the longtable environment which is patched by both. So the problem comes from neither one or the other package, it's the combination which causes a problem here. Solution: Don't use name=Tab. and load the caption package with \usepackage[tablename=Tab.]{caption} instead. In the meantime I will try to eliminate the incompatibility, please hold the line... – user2574 Mar 5 '19 at 19:20
1

This is a bug in the longtable code of the floatrow package (inside the re-definition of \LT@array). It sets the caption options for table and longtable without defining \@captype to table first.

This bug is only relevant if the combination floatrow, longtable, caption, \captionsetup{...} is used and if the caption options used needs \@captype to be defined (like the option name=...).

Work-around: Don't use \captionsetup[table]{name=...} but \usepackage[tablename=...]{caption} instead.

Since the floatrow package is unmaintained (so nobody will fix it) I included a patch of the faulty floatrow code to the caption package v3.4g, so the work-around is no longer needed when using this version (or newer) of the caption package.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.