说实话,我不太了解该bmpsize
包的文档。
我在旧资料中找到了它,但没有提到为什么需要它。所以我的第一个问题是为什么需要它,因为似乎我编译的所有内容在没有它的情况下都可以正常工作。背景可能是在创建 dvi 文件吗?或者使用 htlatex 之类的东西?
第二个问题是为什么xelatex
对于这个最小的例子来说编译会失败:
\documentclass{article}
\usepackage{bmpsize}
\begin{document}
Test
\end{document}
结果是:
his is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022/TeX Live for SUSE Linux) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24> (/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/base/inputenc.sty
Package inputenc Warning: inputenc package ignored with utf8 based engines.
) (/usr/share/texmf/tex/latex/base/fontenc.sty
(/usr/share/texmf/tex/latex/lm/t1lmr.fd))
(/usr/share/texmf/tex/latex/oberdiek/bmpsize.sty
(/usr/share/texmf/tex/generic/iftex/iftex.sty)
(/usr/share/texmf/tex/generic/pdftexcmds/pdftexcmds.sty
(/usr/share/texmf/tex/generic/infwarerr/infwarerr.sty)
(/usr/share/texmf/tex/generic/ltxcmds/ltxcmds.sty))
! Package bmpsize Error: You need pdfTeX 1.30.0 or newer.
See the bmpsize package documentation for explanation.
Type H <return> for immediate help.
...
l.53 }{Package loading is aborted.}
%
核心看起来是! Package bmpsize Error: You need pdfTeX 1.30.0 or newer.
这样的,我的 pdftex 确实更新很多,而且xelatex
不依赖于pdftex
,对吧?那么,这个提示是否意味着只有 pdflatex 才需要 bmpsize?那 呢lualatex
?
我检查了xelatex的版本:
$ xelatex -version
XeTeX 3.141592653-2.6-0.999994 (TeX Live 2022/TeX Live for SUSE Linux)
kpathsea version 6.3.4
Copyright 2022 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty. Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 72.1; using 72.1
Compiled with zlib version 1.2.13; using 1.2.13
Compiled with FreeType2 version 2.12.1; using 2.13.0
Compiled with Graphite2 version 1.3.14; using 1.3.14
Compiled with HarfBuzz version 6.0.0; using 7.1.0
Compiled with libpng version 1.6.39; using 1.6.39
Compiled with pplib version v2.05 less toxic i hope
Compiled with fontconfig version 2.14.2; using 2.14.2
答案1
您几乎肯定不需要这个,graphicx
(或者更确切地说它的使用extractbb
)意味着大多数格式都可以处理。
但它应该可以工作。
提供的文件在 pdflatex 和 lualatex 中运行时没有错误,但在 xelatex 中却出现了一个虚假错误,因为pdftexmds
无法定义包装器\filedump
\documentclass{article}
\makeatletter
\def\pdf@filedump#1#2#3{\filedump offset#1 length#2{#3}}
\makeatother
\usepackage{bmpsize}
\begin{document}
test
\end{document}
运行无错误