datetime 包在 TL 2016 中无法与 lualatex 配合使用

datetime 包在 TL 2016 中无法与 lualatex 配合使用

当我使用包时,我在今天安装的 TL 2016 下使用 lualatex 进行编译时出现错误datetime。此 MWE 在 TL 2015 下运行正常。如何解决此错误?看起来datetime包的 API 已更改。

\documentclass[11pt]{scrbook}%ext
\usepackage{luatex85} %needed else gets an error with lualatex in 2016
\usepackage[us,12hr]{datetime}
\begin{document}
\currenttime
\end{document}

错误是

lualatex foo.tex
This is LuaTeX, Version 0.95.0 (TeX Live 2016) 
 restricted system commands enabled.
(./foo.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 1 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrbook.cls
Document Class: scrbook 2016/05/10 v3.20 KOMA-Script document class (book)
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrkbase.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrbase.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrlfile.sty
Package scrlfile, 2016/05/10 v3.20 KOMA-Script package (loading files)
                  Copyright (C) Markus Kohm

))) (/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/tocbasic.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrsize11pt.clo)
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/typearea.sty
Package typearea, 2016/05/10 v3.20 KOMA-Script package (type area)
                  Copyright (C) Frank Neukam, 1992-1994
                  Copyright (C) Markus Kohm, 1994-

)) (/usr/local/texlive/2016/texmf-dist/tex/generic/luatex85/luatex85.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/datetime/datetime.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/fmtcount/fmtcount.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2016/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2016/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(/usr/local/texlive/2016/texmf-dist/tex/latex/fmtcount/fcprefix.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/fmtcount/fcnumparser.sty))
(/usr/local/texlive/2016/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsgen.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/fmtcount/fc-english.def))
(/usr/local/texlive/2016/texmf-dist/tex/latex/datetime/datetime-defaults.sty)
! Use of \@dt@getdate doesn't match its definition.
\pdfcreationdate ->\pdffeedback 
                                creationdate
l.233 }

? 

在 TL 2016 中使用 pdflatex 编译成功,在 2015 中使用 lualatex 编译成功:

\documentclass[11pt]{scrbook}%ext
\usepackage[us,12hr]{datetime}
\begin{document}
\currenttime
\end{document}

没有错误:

lualatex foo.tex
This is LuaTeX, Version beta-0.80.0.1 (TeX Live 2015) (rev 5863) 
 restricted \write18 enabled.
(./foo.tex
LaTeX2e <2015/10/01> patch level 2
Babel <3.9m> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/koma-script/scrbook.cls
Document Class: scrbook 2015/10/03 v3.19a KOMA-Script document class (book)
(/usr/local/texlive/2015/texmf-dist/tex/latex/koma-script/scrkbase.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/koma-script/scrbase.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/koma-script/scrlfile.sty
Package scrlfile, 2015/10/03 v3.19a KOMA-Script package (loading files)
                  Copyright (C) Markus Kohm

))) (/usr/local/texlive/2015/texmf-dist/tex/latex/koma-script/tocbasic.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/koma-script/scrsize11pt.clo)
(/usr/local/texlive/2015/texmf-dist/tex/latex/koma-script/typearea.sty
Package typearea, 2015/10/03 v3.19a KOMA-Script package (type area)
                  Copyright (C) Frank Neukam, 1992-1994
                  Copyright (C) Markus Kohm, 1994-

)) (/usr/local/texlive/2015/texmf-dist/tex/latex/datetime/datetime.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/fmtcount/fmtcount.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/fmtcount/fcprefix.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/fmtcount/fcnumparser.sty))
(/usr/local/texlive/2015/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/fmtcount/fc-english.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/datetime/datetime-defaults.sty))
No file foo.aux.
[1{/usr/local/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./foo.aux))
 275 words of node memory still in use:
   2 hlist, 1 vlist, 1 rule, 2 glue, 43 glue_spec, 1 write nodes
   avail lists: 1:3,2:26,3:2,4:25,5:3,6:32,7:2,9:12,10:3
<</usr/local/texlive/2015/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on foo.pdf (1 page, 11303 bytes).
Transcript written on foo.log.

更新:

在最新的 tlmgr 更新之后,luatex85.sty 2016/06/15 v1.4 pdftex aliases for luatex现在无需使用来\edef\pdfcreationdate {\pdffeedback creationdate}修复问题。因此,最终代码现在可以编译如下,错误也消失了:

\documentclass[11pt]{scrbook}%ext
\usepackage{luatex85} %needed else gets an error with lualatex in 2016
\usepackage[us,12hr]{datetime}
\listfiles
\begin{document}
\currenttime
\end{document}

但是首先需要运行来从 CTAN 中sudo /usr/local/texlive/2016/bin/x86_64-linux/tlmgr update --all选择luatex85刚刚更新的更新。

参考https://www.ctan.org/pkg/datetime?lang=en

答案1

% !TeX program = lualatex
\documentclass[11pt]{scrbook}%ext
\usepackage{luatex85} %needed else gets an error with lualatex in 2016
\edef\pdfcreationdate {\pdffeedback creationdate}
\usepackage[us,12hr]{datetime}
\begin{document}
\currenttime
\end{document}

http://github.com/josephwright/luatex85/issues/2

相关内容