\input{logreq.def} 中的 \if 不完整,包含快照和 biblatex

\input{logreq.def} 中的 \if 不完整,包含快照和 biblatex

截至今天,当我pdflatex在下面的 MWE 上运行时,我收到此错误:

/usr/local/texlive/2019/texmf-dist/tex/latex/logreq/logreq.sty:235: Incomplete 
\if; all text was ignored after line 6.
<inserted text> 
                \fi 
l.235 \input{logreq.def}

来源:

\RequirePackage{snapshot}   
\documentclass{article}
\usepackage{biblatex}

\begin{document}
Hello.
\end{document}

昨天我没有收到错误;今天我使用 TeX Live Utility (TeX Live 2019) 运行了每日软件包更新。因此,似乎是今天更新的某些软件包导致了错误。

如果我注释掉\RequirePackage{snapshot}\usepackage{biblatex},就不会出现错误。

以下是更多日志内容:

(/usr/local/texlive/2019/texmf-dist/tex/latex/biblatex/biblatex.sty
Package: biblatex 2019/08/31 v3.13a programmable bibliographies (PK/MW)

(/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2019/07/25 v0.30 Utility functions of pdfTeX for LuaTeX (HO
)

(/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
(/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
(/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)
(/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2018/09/07 v3.3 Provides the ifpdf switch
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(/usr/local/texlive/2019/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2019/09/09 v2.5g e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count88
)
(/usr/local/texlive/2019/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
(/usr/local/texlive/2019/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)

(/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)

(/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
)))
(/usr/local/texlive/2019/texmf-dist/tex/latex/logreq/logreq.sty
Package: logreq 2010/08/04 v1.0 xml request logger
\lrq@indent=\count89

(/usr/local/texlive/2019/texmf-dist/tex/latex/logreq/logreq.def
File: logreq.def 2010/08/04 v1.0 logreq spec v1.0
)
/usr/local/texlive/2019/texmf-dist/tex/latex/logreq/logreq.sty:235: Incomplete 
\if; all text was ignored after line 6.
<inserted text> 
                \fi 
l.235 \input{logreq.def}

答案1

snapshot包与的标题不一致logreq.def,即

\ProvidesFile{logreq.def}
[\lrq@rcsid $Id: logreq.def,v 1.0 2010/08/04 16:12:57 lehman stable $
 logreq spec v\LogreqDTDVersion]

可选参数中的宏会造成混淆\snap@providesfile以及它所执行的测试。

一个解决方法是修改的定义,\snap@providesfile以便它完全扩展可选参数。

\RequirePackage{snapshot}
\makeatletter
\def\snap@providesfile#1[#2]{%
  \wlog{File: #1 #2}%
  \if\expandafter\snap@graphic@test\expanded{#2}@@\@nil
    \snap@record@graphic#1\relax #2 (type ??)\@nil
  \else
    \expandafter\xdef\csname ver@#1\endcsname{#2}%
  \fi
  \endgroup
}
\makeatother

\documentclass{article}

\usepackage{biblatex}

\begin{document}
Hello.
\end{document}

相关内容