使用 datetime 包时 Pdflatex 失败

使用 datetime 包时 Pdflatex 失败

我一直在调试使用该包的类datetime。看来有问题的语句是\RequirePackage{datetime}

似乎包含该datetime包会导致 pdflatex 失败。我创建了一个最小工作示例:

\documentclass[12pt,a4paper]{book}
\usepackage{datetime}
\begin{document}
Test
\end{document}

当我使用 pdflatex 构建此文件时,没有创建 pdf 文件,并且日志文件为空。当我在终端中运行 pdflatex testfile 时,我得到:

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9)
entering extended mode
(C:\Users\martin\Desktop\Temp\test.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, 
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
 lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\book.cls"
Document Class: book 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\bk12.clo"))
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\datetime\datetime.sty"
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\etoolbox\etoolbox.sty"
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\misc\etex.sty"))

然后 pdflatex 崩溃。使用 latex testfile 和 xelatex testfile 也会在同一点崩溃。lualatex 没有崩溃,但只到达同一点并且不输出任何内容。

我知道该datetime 软件包已经过时并已被替换date­time2。但是,使用时也会出现同样的问题datetime2

datetime 和 datetime2 已安装并位于适当的位置。我还刷新了 FNDB。

关于为什么会发生这种情况/如何解决这个问题,您有什么想法吗?

答案1

在评论中你指出fntcount不可用。如果是这样,终端输出将是

$ pdflatex pp070
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./pp070.tex
LaTeX2e <2017-04-15>
Babel <3.11> and hyphenation patterns for 84 language(s) loaded.
(/home/davidc/texmf/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/home/davidc/texmf/tex/latex/base/bk12.clo))
(/usr/local/texlive/2017/texmf-dist/tex/latex/datetime/datetime.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/etoolbox/etoolbox.sty)

! LaTeX Error: File `fmtcount.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 

如果你没有收到该消息,则说明你正在以非停止模式运行

$ pdflatex -interaction=nonstopmode pp070
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./pp070.tex
LaTeX2e <2017-04-15>
Babel <3.11> and hyphenation patterns for 84 language(s) loaded.
(/home/davidc/texmf/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/home/davidc/texmf/tex/latex/base/bk12.clo))
(/usr/local/texlive/2017/texmf-dist/tex/latex/datetime/datetime.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/etoolbox/etoolbox.sty)

! LaTeX Error: File `fmtcount.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.45 \@ifundefined
                  {@FCmodulo}%^^M
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on pp070.log.

或批处理模式

$ pdflatex -interaction=batchmode pp070
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode

但即使在批处理模式下,终端输出被抑制,日志文件也会显示问题的原因

结尾是:

! LaTeX Error: File `fmtcount.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.45 \@ifundefined
                  {@FCmodulo}%^^M
*** (cannot \read from terminal in nonstop modes)

相关内容