Я автоматически генерирую документ и получаю ошибку ! 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}
Ошибка исчезает, когда я удаляю часть текста ( For example, you can hold a company
... ) или когда я удаляю parbox из заголовка, или когда я удаляю parbox из первой длинной таблицы... Я не могу понять, почему это происходит??? Как исправить ошибку, не удаляя части документа?
Можете ли вы объяснить мне, что не так в этом случае?
Обновление (из-за комментариев): если последняя таблица выглядит так (без last \\
), то она все равно не работает после небольших изменений ТЕКСТА:
\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
и tabular
_ not_ longtable
.