Edit: Thanks to Gonzalo Medina, I think I have an explanation. :)
tablename
and figurename
are indeed valid entries for \captionsetup
, as long as you are using it without the optional argument. The idea: \captionsetup
without the optional argument works globally, so it makes sense to set both figure
and table
names via figurename
and tablename
respectivelly.
The following code works:
\captionsetup{
tablename=Table,
listformat=empty,
justification=justified,
labelsep=quad,
position=above,
skip=\onelineskip,
width=\linewidth,
labelfont={small},
font={small}
}
We are setting the caption layout globally.
Now, when we provide the optional argument, we are limiting our scope to the float we are setting up. Say, if we use \captionsetup[table]{...}
, we are configuring the captions within the table
scope, so there's no point of using tablename
, but only name
.
We can use the name
key instead of tablename
, since we are configuring table
:
\documentclass[11pt]{memoir}
\usepackage{caption}
\captionsetup[table]{
name=Table,
listformat=empty,
justification=justified,
labelsep=quad,
position=above,
skip=\onelineskip,
width=\linewidth,
labelfont={small},
font={small}
}
\begin{document}
\begin{table}
\caption{A table.}
\end{table}
\end{document}
If we want to use tablename
instead, we must use \captionsetup
without the optional argument:
\documentclass[11pt]{memoir}
\usepackage{caption}
\captionsetup{
tablename=Table,
listformat=empty,
justification=justified,
labelsep=quad,
position=above,
skip=\onelineskip,
width=\linewidth,
labelfont={small},
font={small}
}
\begin{document}
\begin{table}
\caption{A table.}
\end{table}
\end{document}
Just for reference, another way to rename the table name is with \renewcommand{\tablename}{Table}
. However, as AstroPig mentioned in the comments, it doesn't work if we use babel
with the french
language.
You have forgotten to terminate the caption with an end of line \\
. longtabu
is base on the code from longtable (see the manual page 1 second paragraph), so the longtable-manual is actually part of the documentation for longtabu
. The need for \\
in captions, is documented on page 11 in that manual.
A suggestion: If you add a line
\tabulinesep=3pt
before the table, you get nicer spacing. Try this one:
\documentclass[11pt,a4paper]{book}
\usepackage[a4paper,showframe]{geometry}
\RequirePackage[latin1]{inputenc}
\usepackage{booktabs}
\usepackage{tabu}
\usepackage{longtable}
\usepackage[english]{babel}
\begin{document}
\begin{footnotesize}
\tabulinesep=3pt
\begin{longtabu} to 0.75\textwidth{cX[L]ll}
% We use commands from 'booktabs' package
% because it is recommended by 'tabu'.
%
\caption[Short caption for index.]{Long caption to be %
shown at the top of the first page %
of the table.\label{tab:label}}\\ % **NB**
\toprule
Col 1 & Col 2 & Col 3 & Col 4\\
\midrule
\endfirsthead
%
\caption[]{(Cont.) Long caption to be shown at %
the top of the rest of the table.}\\ % **NB**
\toprule
Col 1 & Col 2 & Col 3 & Col 4\\
\midrule
\endhead
%
\bottomrule
\endfoot
%
\endlastfoot
% Now the regular content :
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
$\Phi(z)$ &
Description wich is quite long, normally. &
$]0,1[$ &
This is a reference page.
\\
\addlinespace
\bottomrule
\end{longtabu}
\end{footnotesize}
\end{document}
Best Answer
longtable
and captionsThe reason for this is that for
longtable
to be able to split a table into pages, it cannot be in a floating environment. This is problematic for the\caption
-macro, which need to be in a floating environment, liketable
orfigure
. To get around this,longtable
redefines the\caption
-macro, essentially making it only some text in amulticolumn
This is described in the documentation for
longtable
Note that you can always locate the documentation using the command-line/terminal by writingtexdoc longtable
, and that works for any package. The documentation is also available at http://ctan.org/pkg/longtableWhy is this probematic for us?
when you specify that the seperator for labels should be a newline, that means that a
\\
will be inserted after Table #, but in tables,\\
, means something more than just to insert a newline, as you already know, it will create a new row, which gives us an error since we are effectively inside amulticolumn
now, because of the redefenition of\caption
, as mentioned above.Solution
Add a new label seperator, with the command
which we will use only in
longtables
. This will give us the intended result. The downside is that we have need to keep track of two different formats.Output
Code