latexdiff 生成 latex 并出现错误:!\showCODEN 定义中的参数编号非法

latexdiff 生成 latex 并出现错误:!\showCODEN 定义中的参数编号非法

我正在使用 latexdiff 来生成差异latexdiff-vc --git --flatten -r TAG paper.tex

不幸的是,当我尝试编译 PDF 时,出现以下错误

! Illegal parameter number in definition of \showCODEN.
<to be read again>
                   1
l.1003 ...undefined \def \showCODEN     \DIFadd{#1
                                                  }{\unskip}     \fi
?

生成的乳胶看起来像

%DIF > %% ====================================================================
%DIF > %% NOTE TO THE USER: you can override these defaults by providing
%DIF > %% customized versions of any of these macros before the \bibliography
%DIF > %% command.  Each of them MUST provide its own final punctuation,
%DIF > %% except for \shownote{}, \showDOI{}, and \showURL{}.  The latter two
%DIF > %% do not use final punctuation, in order to avoid confusing it with
%DIF > %% the Web address.
%DIF > %%
%DIF > %% To suppress output of a particular field, define its macro to expand
%DIF > %% to an empty string, or better, \unskip, like this:
%DIF > %%
%DIF > %% \newcommand{\showDOI}[1]{\unskip}   % LaTeX syntax
%DIF > %%
%DIF > %% \def \showDOI #1{\unskip}           % plain TeX syntax
%DIF > %%
%DIF > %% ====================================================================

\ifx \showCODEN    \undefined \def \showCODEN     \DIFadd{#1}{\unskip}     \fi
\ifx \showDOI      \undefined \def \showDOI       \DIFadd{#1}{{\tt \DIFadd{DOI:}}\penalty0{#1}\DIFadd{\ }}
  \fi
\ifx \showISBNx    \undefined \def \showISBNx     \DIFadd{#1}{\unskip}     \fi
\ifx \showISBNxiii \undefined \def \showISBNxiii  \DIFadd{#1}{\unskip}     \fi
\ifx \showISSN     \undefined \def \showISSN      \DIFadd{#1}{\unskip}     \fi
\ifx \showLCCN     \undefined \def \showLCCN      \DIFadd{#1}{\unskip}     \fi
\ifx \shownote     \undefined \def \shownote      \DIFadd{#1}{\DIFadd{#1}}          \fi
\ifx \showarticletitle \undefined \def \showarticletitle \DIFadd{#1}{\DIFadd{#1}}   \fi
\ifx \showURL      \undefined \def \showURL       \DIFadd{#1}{\DIFadd{#1}}          \fi

\bibitem{Baldonado-2000}
{\DIFadd{Michelle Q.~Wang Baldonado}}\DIFadd{, }{\DIFadd{Allison Woodruff}}\DIFadd{, }{\DIFadd{and}} {\DIFadd{Allan Kuchinsky}}\DIFadd{.
  2000.
}\newblock \showarticletitle{Guidelines for Using Multiple Views in Information
  Visualization}\DIFadd{. In }{\em \DIFadd{Proceedings of the working conference on Advanced
  visual interfaces, }{\DIFadd{AVI}} \DIFadd{2000, Palermo, Italy, May 23-26, 2000}}\DIFadd{. 110--119.
}\newblock
\showDOI{%
\url{http://dx.doi.org/10.1145/345513.345271}}

我如何手动修复代码来解决错误?

答案1

我找到了一个部分解决方案,所以我至少可以建立一个差异。

我手动替换

\ifx \showCODEN    \undefined \def \showCODEN     \DIFadd{#1}{\unskip}     \fi
\ifx \showDOI      \undefined \def \showDOI       \DIFadd{#1}{{\tt \DIFadd{DOI:}}\penalty0{#1}\DIFadd{\ }}
  \fi
\ifx \showISBNx    \undefined \def \showISBNx     \DIFadd{#1}{\unskip}     \fi
\ifx \showISBNxiii \undefined \def \showISBNxiii  \DIFadd{#1}{\unskip}     \fi
\ifx \showISSN     \undefined \def \showISSN      \DIFadd{#1}{\unskip}     \fi
\ifx \showLCCN     \undefined \def \showLCCN      \DIFadd{#1}{\unskip}     \fi
\ifx \shownote     \undefined \def \shownote      \DIFadd{#1}{\DIFadd{#1}}          \fi
\ifx \showarticletitle \undefined \def \showarticletitle \DIFadd{#1}{\DIFadd{#1}}   \fi
\ifx \showURL      \undefined \def \showURL       \DIFadd{#1}{\DIFadd{#1}}          \fi

\newcommand{\showDOI}[1]{#1}
\newcommand{\showURL}[1]{#1}
\newcommand{\showISSN}[1]{#1}
\newcommand{\showISBNx}[1]{#1}
\newcommand{\shownote}[1]{#1}

我的参考文献的差异现在毫无用处,但至少我可以为论文构建 PDF。

相关内容