![`longtabu` の奇妙な問題](https://rvso.com/image/254727/%60longtabu%60%20%E3%81%AE%E5%A5%87%E5%A6%99%E3%81%AA%E5%95%8F%E9%A1%8C.png)
LaTeX がコンパイルできない非常に単純な例を皆さんと共有したいと思います。
longtabu
パッケージによって提供される環境を使用します。のドキュメントで推奨されているようtabu
に、 のコマンドを使用しています。booktabs
tabu
\documentclass[11pt]{book}
\usepackage[a4paper,showframe]{geometry}
\RequirePackage[latin1]{inputenc}
\usepackage{booktabs}
\usepackage{tabu}
\usepackage{longtable}
\usepackage[english]{babel}
\begin{document}
\begin{footnotesize}
\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}}
\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.}
\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}
ファイル内に.log
次のエラーが表示されます:
! Misplaced \noalign.
\toprule ->\noalign
{\ifnum 0=`}\fi \@aboverulesep =\abovetopsep \global \@b...
l.88 \end{longtabu}
I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.
! Missing } inserted.
<inserted text>
}
l.88 \end{longtabu}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
他にも同様のエラーが多数発生しています。コンパイラは終了しません。強制的に停止する必要があります。
この問題は文に関連している可能性がありますcaption
。文を削除すると、例がコンパイルされ、適切なドキュメントが生成されるからです。
何が足りないのでしょうか? 馬鹿げた質問かもしれませんが、何が起こっているのか理解できないので、助けていただけると嬉しいです。
よろしくお願いします。
答え1
キャプションを行末で終了するのを忘れました\\
。longtabu
これは、次のコードに基づいています。ロングテーブル(見るマニュアル1ページ目の2番目の段落)なのでロングテーブルマニュアルは、実際には のドキュメントの一部ですlongtabu
。キャプションでの の必要性については\\
、そのマニュアルの 11 ページに記載されています。
提案: 行を追加すると
\tabulinesep=3pt
表の前に配置すれば、よりよい間隔が得られます。これを試してみてください:
\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}