我自動生成文檔,並收到錯誤! Extra alignment tab has been changed to \cr.
我知道這個錯誤,但我無法理解我的情況的原因。這是最小的例子:
\documentclass{report}
\usepackage{fancybox,fancyhdr}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames]{xcolor}
\usepackage{fixltx2e}
\usepackage[normalem]{ulem}
\usepackage[left=72pt,right=72pt, top=72pt,bottom=72pt,bindingoffset=0cm]{geometry}
\usepackage{array}
\usepackage{longtable}
\usepackage[export]{adjustbox}
\newcolumntype{R}[2]{>{\raggedleft \arraybackslash \hspace{0pt}}{#2}{#1}}
\newcolumntype{L}[2]{>{\raggedright\arraybackslash}{#2}{#1}}
\newcolumntype{C}[2]{>{\center\arraybackslash}{#2}{#1}}
\fancyhead[C]{\noindent\sbox{0}{\parbox{\textwidth}{\noindent\begin{longtable}{c}Text\end{longtable}}}
\ifdim\dimexpr\ht0+\dp0<14pt
\dp0\dimexpr14pt-\ht0\fi
\makebox{\usebox{0}}\\}\begin{document}
\pagestyle{fancy}
\noindent\sbox{0}{\parbox{\textwidth}{
\noindent\begin{longtable}{L{\textwidth}{p}}list
\begin{itemize}
\item item
\end{itemize}
\end{longtable}}}
\ifdim\dimexpr\ht0+\dp0<240.44036697248pt
\dp0\dimexpr240.44036697248pt-\ht0\fi
\makebox{\usebox{0}}\\
\noindent\begin{longtable}{L{450mm}{p}}Love\\\end{longtable}
\begin{longtable}{p{90mm}R{40mm}{p}rc}
Own party & & Unscored \\ [10pt]
Own parties & & & \\ [10pt]
Entity that is contracting on our behalf \\{Which of our own parties is contracting on our behalf?}&{Unknown}&Unscored& \\ [10pt]
Reference name \\ {Reference name used to refer to the own party}&{Unknown}&Unscored& \\ [10pt]
\end{longtable}
\begin{longtable}{p{90mm}R{40mm}{p}rc}
Counterparties & & Unscored \\ [10pt]
Counterparty & & & \\ [10pt]
Reference name \\{Reference name used to refer to the counterparty}&{Unknown}&Unscored& \\ [10pt]
Counterparty identity\\{None provided}&{Unknown}&Unscored& \\[10pt]
Whether we are contracting with a company, branch, individual or some other kind of entity? \\ {The type of entity you are planning to contract with is really important when deciding whether the deal is appropriate. For example, you can hold a company to account for most contract terms it agrees to. But the same is not true when you are dealing with an individual - they might be able to get out of these terms even if they had signed up to them. }&{Unknown}&Unscored& \\[10pt]
Name of counterparty \\ {None provided}&{Unknown}&Unscored& \\[10pt]
\end{longtable}
\end{document}
當我刪除部分文字(...)或從標題中刪除 parbox 時,或當我從第一個 longtable 中刪除 parbox 時,錯誤消失For example, you can hold a company
......我不明白為什麼會發生?如何在不刪除部分文件的情況下修復錯誤?
您能解釋一下,這種情況出了什麼問題嗎?
更新(由於評論):如果最後一個表看起來如此(沒有 last \\
),在小的 TEXT 更改後它仍然不起作用:
\begin{longtable}{p{90mm}R{40mm}{p}rc}
Counterparties & & Unscored \\ \\
Counterparty & & & \\ \\
Reference name \\{Reference name used to refer to the counterparty}&{Unknown}&Unscored& \\ \\
Counterparty identity\\{None provided}&{Unknown}&Unscored& \\ \\
Whether we are contracting with a company, branch, individual or some other kind of entity? \\ {The type of entity you are planning to contract with is really important when deciding whether the deal is appropriate. For example, you can hold a company to account for most contract terms it agrees to. But the same is not true when you are dealing with an individual - they might be able to get out of these terms even if they had signed up to them. }&{Unknown}&Unscored& \\ \\
Name of counterparty \\ {None provided}&{Unknown}&Unscored& \\
\end{longtable}
\end{document}
答案1
不使用\\ \\
。如果您需要更多空間,請使用類似\\[10pt]
在行後添加 10pt 的內容。當然,在標頭定義中使用\fancyhead
usetabular
和 _ not_ longtable
。