latexdiff 使用简单表格产生错误

latexdiff 使用简单表格产生错误

我在使用时遇到了一个错误latexdiff,我已将其简化为以下 MWE。给定前后文件...

\documentclass{article}
\begin{document}
\thispagestyle{empty}
\begin{tabular}{ll}
A & B \\
C & D \\
E & F \\
\hline
\end{tabular}
\end{document}

\documentclass{article}
\begin{document}
\thispagestyle{empty}
\begin{tabular}{ll}
A & B \\
C & D \\
\hline
\end{tabular}
\end{document}

生成的 diff.tex 文件如下所示。

%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL revA.tex   Wed May 11 15:13:29 2016
%DIF ADD revB.tex   Wed May 11 15:13:32 2016
\documentclass{article}
%DIF PREAMBLE EXTENSION ADDED BY LATEXDIFF
%DIF UNDERLINE PREAMBLE %DIF PREAMBLE
\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}}                      %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}} %DIF PREAMBLE
\providecommand{\DIFdelFL}[1]{\DIFdel{#1}} %DIF PREAMBLE
\providecommand{\DIFaddbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFaddendFL}{} %DIF PREAMBLE
\providecommand{\DIFdelbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFdelendFL}{} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF

\begin{document}
\thispagestyle{empty}
\begin{tabular}{ll}
A & B \\
C & D \\
\DIFdelbegin \DIFdel{E }%DIFDELCMD < & %%%
\DIFdel{F }%DIFDELCMD < \\
%DIFDELCMD < %%%
\DIFdelend \hline
\end{tabular}
\end{document}

diff.tex 文件无法编译。控制台输出如下...

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9 64-bit)
entering extended mode
(diff.tex
LaTeX2e <2015/01/01> patch level 2
Babel <3.9m> and hyphenation patterns for 69 languages loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
(C:\Users\jj79207\AppData\Roaming\MiKTeX\2.9\tex\latex\ulem\ulem.sty)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\color.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\color.cfg")
("C:\Program Files\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"))) (diff.aux)
(C:\Users\jj79207\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
)
! Misplaced \noalign.
\hline ->\noalign 
                  {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
l.34 \DIFdelend \hline

? 

我没有足够的经验来理解错误消息,但我知道如果我\hline从两个输入文件中的每一个中删除,那么 diff 就可以很好地编译并产生以下输出。

在此处输入图片描述

我的输入文件是否无效?这是一个已知错误吗?是否有任何简单的解决方法可以避免\hline出现错误?

相关内容